arch:xtensa: Add SYS_flush_context syscall

This syscall do nothing as flush context was done in interrupt handler.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
zhuyanlin
2022-05-11 10:47:38 +08:00
committed by Abdelatif Guettouche
parent 6e93b440fe
commit b99ba04a8c
2 changed files with 31 additions and 7 deletions
+14 -7
View File
@@ -91,9 +91,9 @@
*/ */
#ifndef CONFIG_BUILD_FLAT #ifndef CONFIG_BUILD_FLAT
# define CONFIG_SYS_RESERVED 8 # define CONFIG_SYS_RESERVED 9
#else #else
# define CONFIG_SYS_RESERVED 4 # define CONFIG_SYS_RESERVED 5
#endif #endif
/* Xtensa system calls ******************************************************/ /* Xtensa system calls ******************************************************/
@@ -119,6 +119,13 @@
#define SYS_switch_context (2) #define SYS_switch_context (2)
/* SYS call 3:
*
* void xtensa_flushcontext(void);
*/
#define SYS_flush_context (3)
#ifdef CONFIG_LIB_SYSCALL #ifdef CONFIG_LIB_SYSCALL
/* SYS call 3: /* SYS call 3:
@@ -126,7 +133,7 @@
* void xtensa_syscall_return(void); * void xtensa_syscall_return(void);
*/ */
#define SYS_syscall_return (3) #define SYS_syscall_return (4)
#endif /* CONFIG_LIB_SYSCALL */ #endif /* CONFIG_LIB_SYSCALL */
#ifndef CONFIG_BUILD_FLAT #ifndef CONFIG_BUILD_FLAT
@@ -136,7 +143,7 @@
* noreturn_function; * noreturn_function;
*/ */
#define SYS_task_start (4) #define SYS_task_start (5)
/* SYS call 5: /* SYS call 5:
* *
@@ -145,7 +152,7 @@
* noreturn_function * noreturn_function
*/ */
#define SYS_pthread_start (5) #define SYS_pthread_start (6)
/* SYS call 6: /* SYS call 6:
* *
@@ -153,14 +160,14 @@
* siginfo_t *info, void *ucontext); * siginfo_t *info, void *ucontext);
*/ */
#define SYS_signal_handler (6) #define SYS_signal_handler (7)
/* SYS call 7: /* SYS call 7:
* *
* void signal_handler_return(void); * void signal_handler_return(void);
*/ */
#define SYS_signal_handler_return (7) #define SYS_signal_handler_return (8)
#endif /* !CONFIG_BUILD_FLAT */ #endif /* !CONFIG_BUILD_FLAT */
/**************************************************************************** /****************************************************************************
+17
View File
@@ -165,6 +165,23 @@ int xtensa_swint(int irq, void *context, void *arg)
CURRENT_REGS = (uint32_t *)regs[REG_A4]; CURRENT_REGS = (uint32_t *)regs[REG_A4];
} }
break;
/* A2=SYS_flush_context: This flush windows to the stack:
*
* int xtensa_flushcontext(void);
*
* At this point, the following values are saved in context:
*
* A2 = SYS_flush_context
*
* In this case, we simply need to do nothing.
* As flush the register windows to the stack has be done by
* interrupt enter handler.
*/
case SYS_flush_context:
break; break;
} }