pussuw commented on code in PR #13520:
URL: https://github.com/apache/nuttx/pull/13520#discussion_r1771930758
##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -397,11 +324,59 @@ int arm64_syscall(uint64_t *regs)
break;
#endif
+ /* This is not an architecture-specific system call. If NuttX is built
+ * as a standalone kernel with a system call interface, then all of the
+ * additional system calls must be handled as in the default case.
+ */
+
default:
+ {
+#ifdef CONFIG_LIB_SYSCALL
- DEBUGPANIC();
- break;
+ /* Verify that the SYS call number is within range */
+
+ DEBUGASSERT(cmd >= CONFIG_SYS_RESERVED && cmd < SYS_maxsyscall);
+
+ /* Make sure that there is a no saved SYSCALL return address. We
+ * cannot yet handle nested system calls.
+ */
+
+ regs[REG_X0] = dispatch_syscall(regs[REG_X0], regs[REG_X1],
Review Comment:
This is completely unnecessary, the registers x0-x6 are already correct when
coming from userspace. There is NO REASON TO READ THEM FROM THE CONTEXT AREA.
What I had done is much more optimized than what this does.
--
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]