diff options
Diffstat (limited to 'nuttx/arch/arm/include/armv7-m')
-rw-r--r-- | nuttx/arch/arm/include/armv7-m/irq.h | 8 | ||||
-rw-r--r-- | nuttx/arch/arm/include/armv7-m/syscall.h | 26 |
2 files changed, 34 insertions, 0 deletions
diff --git a/nuttx/arch/arm/include/armv7-m/irq.h b/nuttx/arch/arm/include/armv7-m/irq.h index 7556d0747..afeebdb4f 100644 --- a/nuttx/arch/arm/include/armv7-m/irq.h +++ b/nuttx/arch/arm/include/armv7-m/irq.h @@ -124,6 +124,14 @@ struct xcptcontext uint32_t saved_primask; #endif uint32_t saved_xpsr; + +# ifdef CONFIG_NUTTX_KERNEL + /* This is the saved address to use when returning from a user-space + * signal handler. + */ + + uint32_t sigreturn; +# endif #endif #ifdef CONFIG_NUTTX_KERNEL diff --git a/nuttx/arch/arm/include/armv7-m/syscall.h b/nuttx/arch/arm/include/armv7-m/syscall.h index 4278c3a36..91220f359 100644 --- a/nuttx/arch/arm/include/armv7-m/syscall.h +++ b/nuttx/arch/arm/include/armv7-m/syscall.h @@ -54,8 +54,22 @@ * Pro-processor Definitions ****************************************************************************/ +/* This is the value used as the argument to the SVC instruction. It is not + * used. + */ + #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 + /**************************************************************************** * Public Types ****************************************************************************/ @@ -218,6 +232,18 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, return reg0; } +/* This inline function is used by user-space code in order to return from + * a signal handler. + */ + +#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__) +static inline void signal_handler_return(void) noreturn_function; +static inline void signal_handler_return(void) +{ + sys_call0(SYS_signal_handler_return); +} +#endif + /**************************************************************************** * Public Variables ****************************************************************************/ |