diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-17 00:40:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-17 00:40:49 +0000 |
commit | e6dc1927ce61a16359477bb93a2292caade5df75 (patch) | |
tree | 3b7ed6b971413d6423d6012fe593980ee8370429 /nuttx/arch/arm/include/armv6-m/syscall.h | |
parent | c6e15be439a293e411a5ff571c48e0ca15dfaad5 (diff) | |
download | px4-nuttx-e6dc1927ce61a16359477bb93a2292caade5df75.tar.gz px4-nuttx-e6dc1927ce61a16359477bb93a2292caade5df75.tar.bz2 px4-nuttx-e6dc1927ce61a16359477bb93a2292caade5df75.zip |
Add support for calling to and returning from signal handlers in in user-mode threads
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5750 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/include/armv6-m/syscall.h')
-rw-r--r-- | nuttx/arch/arm/include/armv6-m/syscall.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/nuttx/arch/arm/include/armv6-m/syscall.h b/nuttx/arch/arm/include/armv6-m/syscall.h index f92dea7e8..9548ae494 100644 --- a/nuttx/arch/arm/include/armv6-m/syscall.h +++ b/nuttx/arch/arm/include/armv6-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 ****************************************************************************/ |