Swatantra-66 commented on code in PR #21140:
URL: https://github.com/apache/nuttx/pull/21140#discussion_r4422676776


##########
arch/arm/src/armv7-r/arm_syscall.c:
##########
@@ -42,6 +43,22 @@
 #include "sched/sched.h"
 #include "signal/signal.h"
 
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* From user mode, the only reserved system call that is allowed is the
+ * return from a signal handler that the kernel dispatched.  Without full
+ * signal support the kernel dispatches no handler, so none is allowed.
+ */
+
+#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ENABLE_ALL_SIGNALS)
+#  define USER_SIGRETURN(tcb, cmd) \
+     ((cmd) == SYS_signal_handler_return && (tcb)->xcp.sigreturn != 0)

Review Comment:
   Moving SYS_signal_handler_return out of the reserved numbers in 
syscall.h/syscall.csv would require renumbering the standard syscall table and 
updating assembly trampolines/lookup headers across the tree.
   
   To keep this PR clean, self-contained, and strictly within the 8 ARM files, 
I simplified the check by removing the USER_SIGRETURN macro entirely and 
directly excluding SYS_signal_handler_return (cmd < CONFIG_SYS_RESERVED && cmd 
!= SYS_signal_handler_return), along with checking rtcb->xcp.sigreturn == 0 
inside the return handler. If you'd like a global syscall renumbering, I can do 
that in a dedicated PR across all architectures



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to