arch: Move the content from svcall.h to syscall.h

and remove svcall.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-02-25 02:46:21 +08:00
committed by archer
parent 0c7517e579
commit 087b9e5ff3
62 changed files with 338 additions and 1147 deletions
+90
View File
@@ -39,6 +39,96 @@
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* This logic uses three system calls {0,1,2} for context switching and one
* for the syscall return.
* So a minimum of four syscall values must be reserved.
* If CONFIG_BUILD_PROTECTED is defined, then four more syscall values
* must be reserved.
*/
#ifdef CONFIG_LIB_SYSCALL
# ifdef CONFIG_BUILD_PROTECTED
# ifndef CONFIG_SYS_RESERVED
# error "CONFIG_SYS_RESERVED must be defined to have the value 8"
# elif CONFIG_SYS_RESERVED != 8
# error "CONFIG_SYS_RESERVED must have the value 8"
# endif
# else
# ifndef CONFIG_SYS_RESERVED
# error "CONFIG_SYS_RESERVED must be defined to have the value 4"
# elif CONFIG_SYS_RESERVED != 4
# error "CONFIG_SYS_RESERVED must have the value 4"
# endif
# endif
#endif
/* CEVA system calls ********************************************************/
/* SYS call 0:
*
* int up_saveusercontext(uint32_t *saveregs);
*/
#define SYS_save_context 0x00
/* SYS call 1:
*
* void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
*/
#define SYS_restore_context 0x01
/* SYS call 2:
*
* void up_switchcontext(uint32_t **saveregs, uint32_t *restoreregs);
*/
#define SYS_switch_context 0x02
#ifdef CONFIG_LIB_SYSCALL
/* SYS call 3:
*
* void up_syscall_return(void);
*/
#define SYS_syscall_return 0x03
#endif /* CONFIG_LIB_SYSCALL */
#ifndef CONFIG_BUILD_FLAT
/* SYS call 4:
*
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
* noreturn_function;
*/
#define SYS_task_start 0x04
/* SYS call 5:
*
* void up_pthread_start(pthread_startroutine_t entrypt, pthread_addr_t arg)
* noreturn_function
*/
#define SYS_pthread_start 0x05
/* SYS call 6:
*
* void signal_handler(_sa_sigaction_t sighand, int signo,
* FAR siginfo_t *info, FAR void *ucontext);
*/
#define SYS_signal_handler 0x06
/* SYS call 7:
*
* void signal_handler_return(void);
*/
#define SYS_signal_handler_return 0x07
#endif /* !CONFIG_BUILD_FLAT */
/****************************************************************************
* Public Types
****************************************************************************/
-130
View File
@@ -1,130 +0,0 @@
/****************************************************************************
* arch/ceva/src/common/svcall.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __ARCH_CEVA_SRC_COMMON_SVCALL_H
#define __ARCH_CEVA_SRC_COMMON_SVCALL_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <syscall.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* This logic uses three system calls {0,1,2} for context switching and one
* for the syscall return.
* So a minimum of four syscall values must be reserved.
* If CONFIG_BUILD_PROTECTED is defined, then four more syscall values
* must be reserved.
*/
#ifdef CONFIG_LIB_SYSCALL
# ifdef CONFIG_BUILD_PROTECTED
# ifndef CONFIG_SYS_RESERVED
# error "CONFIG_SYS_RESERVED must be defined to have the value 8"
# elif CONFIG_SYS_RESERVED != 8
# error "CONFIG_SYS_RESERVED must have the value 8"
# endif
# else
# ifndef CONFIG_SYS_RESERVED
# error "CONFIG_SYS_RESERVED must be defined to have the value 4"
# elif CONFIG_SYS_RESERVED != 4
# error "CONFIG_SYS_RESERVED must have the value 4"
# endif
# endif
#endif
/* CEVA system calls ********************************************************/
/* SYS call 0:
*
* int up_saveusercontext(uint32_t *saveregs);
*/
#define SYS_save_context 0x00
/* SYS call 1:
*
* void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
*/
#define SYS_restore_context 0x01
/* SYS call 2:
*
* void up_switchcontext(uint32_t **saveregs, uint32_t *restoreregs);
*/
#define SYS_switch_context 0x02
#ifdef CONFIG_LIB_SYSCALL
/* SYS call 3:
*
* void up_syscall_return(void);
*/
#define SYS_syscall_return 0x03
#ifdef CONFIG_BUILD_PROTECTED
/* SYS call 4:
*
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
* noreturn_function;
*/
#define SYS_task_start 0x04
/* SYS call 5:
*
* void up_pthread_start(pthread_startroutine_t entrypt, pthread_addr_t arg)
* noreturn_function
*/
#define SYS_pthread_start 0x05
/* SYS call 6:
*
* void signal_handler(_sa_sigaction_t sighand, int signo,
* FAR siginfo_t *info, FAR void *ucontext);
*/
#define SYS_signal_handler 0x06
/* SYS call 7:
*
* void signal_handler_return(void);
*/
#define SYS_signal_handler_return 0x07
#endif /* CONFIG_BUILD_PROTECTED */
#endif /* CONFIG_LIB_SYSCALL */
/****************************************************************************
* Inline Functions
****************************************************************************/
#endif /* __ARCH_CEVA_SRC_COMMON_SVCALL_H */
+2 -1
View File
@@ -22,7 +22,8 @@
* Included Files
****************************************************************************/
#include "svcall.h"
#include <arch/syscall.h>
#include "up_internal.h"
/****************************************************************************
+1 -1
View File
@@ -26,7 +26,7 @@
#include <pthread.h>
#include <nuttx/arch.h>
#include "svcall.h"
#include <arch/syscall.h>
#if ((defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)) || \
defined(CONFIG_BUILD_KERNEL)) && !defined(CONFIG_DISABLE_PTHREAD)
+2 -1
View File
@@ -25,7 +25,8 @@
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include "svcall.h"
#include <arch/syscall.h>
#include "up_internal.h"
/****************************************************************************
+1 -1
View File
@@ -25,7 +25,7 @@
#include <nuttx/config.h>
#include <nuttx/arch.h>
#include "svcall.h"
#include <arch/syscall.h>
#if ((defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)) || \
defined(CONFIG_BUILD_KERNEL)) && !defined(CONFIG_DISABLE_SIGNALS)
+1 -1
View File
@@ -27,12 +27,12 @@
#include <string.h>
#include <assert.h>
#include <debug.h>
#include <syscall.h>
#include <nuttx/irq.h>
#include <nuttx/sched.h>
#include <nuttx/userspace.h>
#include "svcall.h"
#include "up_internal.h"
/****************************************************************************
+2 -1
View File
@@ -22,7 +22,8 @@
* Included Files
****************************************************************************/
#include "svcall.h"
#include <arch/syscall.h>
#include "up_internal.h"
/****************************************************************************
+1 -1
View File
@@ -25,7 +25,7 @@
#include <nuttx/config.h>
#include <nuttx/arch.h>
#include "svcall.h"
#include <arch/syscall.h>
#if defined(CONFIG_BUILD_PROTECTED) || defined(CONFIG_BUILD_KERNEL)
+2 -2
View File
@@ -24,7 +24,7 @@
#include <nuttx/config.h>
#include "svcall.h"
#include <arch/syscall.h>
#if (defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)) && \
!defined(CONFIG_DISABLE_SIGNALS)
@@ -54,7 +54,7 @@
*
* Returned Value:
* None. This function does not return in the normal sense. It returns
* via the SYS_signal_handler_return (see svcall.h)
* via the SYS_signal_handler_return (see syscall.h)
*
****************************************************************************/
+2 -2
View File
@@ -24,7 +24,7 @@
#include <nuttx/config.h>
#include "svcall.h"
#include <arch/syscall.h>
#ifdef CONFIG_LIB_SYSCALL
@@ -59,7 +59,7 @@
*
* Returned Value:
* None. This function does not return in the normal sense. It returns
* via the SYS_syscall_return (see svcall.h)
* via the SYS_syscall_return (see syscall.h)
*
****************************************************************************/
+1 -1
View File
@@ -25,7 +25,7 @@
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include "svcall.h"
#include <arch/syscall.h>
/****************************************************************************
* Public Symbols
+2 -2
View File
@@ -24,7 +24,7 @@
#include <nuttx/config.h>
#include "svcall.h"
#include <arch/syscall.h>
#if (defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)) && \
!defined(CONFIG_DISABLE_SIGNALS)
@@ -54,7 +54,7 @@
*
* Return:
* None. This function does not return in the normal sense. It returns
* via the SYS_signal_handler_return (see svcall.h)
* via the SYS_signal_handler_return (see syscall.h)
*
****************************************************************************/
+2 -2
View File
@@ -24,7 +24,7 @@
#include <nuttx/config.h>
#include "svcall.h"
#include <arch/syscall.h>
#ifdef CONFIG_LIB_SYSCALL
@@ -59,7 +59,7 @@
*
* Return:
* None. This function does not return in the normal sense. It returns
* via the SYS_syscall_return (see svcall.h)
* via the SYS_syscall_return (see syscall.h)
*
****************************************************************************/
+1 -1
View File
@@ -25,7 +25,7 @@
#include <nuttx/config.h>
#include <nuttx/irq.h>
#include "svcall.h"
#include <arch/syscall.h>
/****************************************************************************
* Pre-processor Definitions