arch: Make the comment and definition of CONFIG_SYS_RESERVED correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-14 21:28:17 +08:00 committed by Petro Karashchenko
parent ea42981cc6
commit b6bc460b2c
7 changed files with 15 additions and 19 deletions

View File

@ -52,7 +52,7 @@
/* This logic uses three system calls {0,1,2} for context switching and one /* This logic uses three system calls {0,1,2} for context switching and one
* for the syscall return. * for the syscall return.
* So a minimum of four syscall values must be reserved. * So a minimum of four syscall values must be reserved.
* If CONFIG_BUILD_PROTECTED is defined, then four more syscall values must * If CONFIG_BUILD_FLAT isn't defined, then four more syscall values must
* be reserved. * be reserved.
*/ */

View File

@ -44,7 +44,7 @@
/* This logic uses three system calls {0,1,2} for context switching and one /* This logic uses three system calls {0,1,2} for context switching and one
* for the syscall return. * for the syscall return.
* So a minimum of four syscall values must be reserved. * So a minimum of four syscall values must be reserved.
* If CONFIG_BUILD_PROTECTED is defined, then four more syscall values * If CONFIG_BUILD_FLAT isn't defined, then four more syscall values
* must be reserved. * must be reserved.
*/ */

View File

@ -49,8 +49,10 @@
* must, therefore, be reserved (0 is not used). * must, therefore, be reserved (0 is not used).
*/ */
#ifdef CONFIG_BUILD_KERNEL #ifndef CONFIG_BUILD_FLAT
# define CONFIG_SYS_RESERVED 4 # define CONFIG_SYS_RESERVED 4
#else
# define CONFIG_SYS_RESERVED 3
#endif #endif
/* sys_call macros **********************************************************/ /* sys_call macros **********************************************************/
@ -112,7 +114,7 @@
/* System call SYS_ argument and six additional parameters. */ /* System call SYS_ argument and six additional parameters. */
#define sys_call5(nbr,parm1,parm2,parm3,parm4,parm5,parm6) __extension__({ \ #define sys_call6(nbr,parm1,parm2,parm3,parm4,parm5,parm6) __extension__({ \
uintptr_t __result; \ uintptr_t __result; \
__asm__ __volatile__ (\ __asm__ __volatile__ (\
"\tmove $4, %0\n" \ "\tmove $4, %0\n" \

View File

@ -49,8 +49,10 @@
* must, therefore, be reserved (0 is not used). * must, therefore, be reserved (0 is not used).
*/ */
#ifdef CONFIG_BUILD_KERNEL #ifndef CONFIG_BUILD_FLAT
# define CONFIG_SYS_RESERVED 4 # define CONFIG_SYS_RESERVED 4
#else
# define CONFIG_SYS_RESERVED 3
#endif #endif
/* sys_call macros **********************************************************/ /* sys_call macros **********************************************************/

View File

@ -45,7 +45,7 @@
/* This logic uses three system calls {0,1,2} for context switching and one /* 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 * for the syscall return. So a minimum of four syscall values must be
* reserved. If CONFIG_BUILD_PROTECTED is defined, then four more syscall * reserved. If CONFIG_BUILD_FLAT isn't defined, then four more syscall
* values must be reserved. * values must be reserved.
*/ */

View File

@ -49,8 +49,10 @@
* therefore, be reserved (0 is not used). * therefore, be reserved (0 is not used).
*/ */
#ifdef CONFIG_BUILD_KERNEL #ifndef CONFIG_BUILD_FLAT
# define CONFIG_SYS_RESERVED 4 # define CONFIG_SYS_RESERVED 4
#else
# define CONFIG_SYS_RESERVED 3
#endif #endif
/* sys_call macros **********************************************************/ /* sys_call macros **********************************************************/

View File

@ -45,23 +45,13 @@
#define SYS_syscall 0x00 #define SYS_syscall 0x00
/* The SYS_signal_handler_return is executed here... its value is not always
* available in this context and so is assumed to be 7.
*/
#ifndef SYS_signal_handler_return
# define SYS_signal_handler_return (7)
#elif SYS_signal_handler_return != 7
# error "SYS_signal_handler_return was assumed to be 7"
#endif
/* This logic uses three system calls {0,1,2} for context switching and one /* 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 * for the syscall return. So a minimum of four syscall values must be
* reserved. If CONFIG_BUILD_PROTECTED is defined, then four more syscall * reserved. If CONFIG_BUILD_FLAT isn't defined, then four more syscall
* values must be reserved. * values must be reserved.
*/ */
#ifdef CONFIG_BUILD_PROTECTED #ifndef CONFIG_BUILD_FLAT
# define CONFIG_SYS_RESERVED 8 # define CONFIG_SYS_RESERVED 8
#else #else
# define CONFIG_SYS_RESERVED 4 # define CONFIG_SYS_RESERVED 4