summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/include/armv7-m/syscall.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/include/armv7-m/syscall.h')
-rw-r--r--nuttx/arch/arm/include/armv7-m/syscall.h26
1 files changed, 26 insertions, 0 deletions
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
****************************************************************************/