This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 908ac756eaff48350263ad5d8891161e18273bce
Author: p-szafonimateusz <[email protected]>
AuthorDate: Wed Nov 27 14:41:58 2024 +0100

    arch/x86_64/intel64: remove unnecessary nested syscalls logic
    
    remove unnecessary nested syscalls logic, it's already handled different way
---
 arch/x86_64/include/intel64/irq.h       |  9 ---------
 arch/x86_64/src/common/x86_64_syscall.c | 13 -------------
 2 files changed, 22 deletions(-)

diff --git a/arch/x86_64/include/intel64/irq.h 
b/arch/x86_64/include/intel64/irq.h
index bc8dd7cd6f..c21694d771 100644
--- a/arch/x86_64/include/intel64/irq.h
+++ b/arch/x86_64/include/intel64/irq.h
@@ -545,15 +545,6 @@ struct xcptcontext
 
   uint64_t *regs;
 
-#ifdef CONFIG_LIB_SYSCALL
-  /* The following array holds information needed to return from each nested
-   * system call.
-   */
-
-  uint8_t nsyscalls;
-  struct xcpt_syscall_s syscall[CONFIG_SYS_NNEST];
-#endif
-
 #ifdef CONFIG_ARCH_ADDRENV
 #  ifdef CONFIG_ARCH_KERNEL_STACK
   /* In this configuration, all syscalls execute from an internal kernel
diff --git a/arch/x86_64/src/common/x86_64_syscall.c 
b/arch/x86_64/src/common/x86_64_syscall.c
index 1da8e300b7..216727a2ca 100644
--- a/arch/x86_64/src/common/x86_64_syscall.c
+++ b/arch/x86_64/src/common/x86_64_syscall.c
@@ -296,14 +296,6 @@ uint64_t *x86_64_syscall(uint64_t *regs)
           struct tcb_s   *rtcb = nxsched_self();
           syscall_stub_t  stub = (syscall_stub_t)g_stublookup[nbr];
 
-          DEBUGASSERT(nbr < SYS_nsyscalls);
-          DEBUGASSERT(rtcb->xcp.nsyscalls < CONFIG_SYS_NNEST);
-
-          /* Setup nested syscall */
-
-          rtcb->xcp.syscall[rtcb->xcp.nsyscalls].sysreturn = regs[REG_RCX];
-          rtcb->xcp.nsyscalls += 1;
-
 #ifdef CONFIG_ARCH_KERNEL_STACK
           /* Store reference to user RSP for signals */
 
@@ -314,11 +306,6 @@ uint64_t *x86_64_syscall(uint64_t *regs)
 
           ret = stub(nbr, arg1, arg2, arg3, arg4, arg5, arg6);
 
-          /* Setup return from nested syscall */
-
-          rtcb->xcp.nsyscalls -= 1;
-          regs[REG_RCX] = rtcb->xcp.syscall[rtcb->xcp.nsyscalls].sysreturn;
-
           break;
         }
     }

Reply via email to