summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/cortexm3/up_svcall.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/cortexm3/up_svcall.c')
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_svcall.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/cortexm3/up_svcall.c b/nuttx/arch/arm/src/cortexm3/up_svcall.c
index ec67617a7..f7e55a98b 100644
--- a/nuttx/arch/arm/src/cortexm3/up_svcall.c
+++ b/nuttx/arch/arm/src/cortexm3/up_svcall.c
@@ -57,7 +57,20 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+/* Configuration ************************************************************/
+
+#undef SYSCALL_INTERRUPTIBLE
+#if defined(CONFIG_NUTTX_KERNEL)
+# if CONFIG_ARCH_INTERRUPTSTACK > 3
+# warning "CONFIG_ARCH_INTERRUPTSTACK and CONFIG_NUTTX_KERNEL are incompatible"
+# warning "options as currently implemented. Interrupts will have to be disabled"
+# warning "during SYScall processing to avoid un-handled nested interrupts"
+# else
+# define SYSCALL_INTERRUPTIBLE 1
+# endif
+#endif
+/* Debug ********************************************************************/
/* Debug output from this file may interfere with context switching! To get
* debug output you must enabled the following in your NuttX configuration:
*
@@ -116,6 +129,12 @@ static inline void dispatch_syscall(uint32_t *regs)
int index = cmd - CONFIG_SYS_RESERVED;
+ /* Enable interrupts while the SYSCALL executes */
+
+#ifdef SYSCALL_INTERRUPTIBLE
+ irqenable();
+#endif
+
/* Call the correct stub for each SYS call, based on the number of parameters */
svcdbg("Calling stub%d at %p\n", index, g_stubloopkup[index].stub0);
@@ -177,6 +196,10 @@ static inline void dispatch_syscall(uint32_t *regs)
cmd, g_stubnparms[index]);
break;
}
+
+#ifdef SYSCALL_INTERRUPTIBLE
+ irqdisable();
+#endif
}
/* Set up the return vaue. First, check if a context switch occurred.