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

xiaoxiang pushed a commit to branch releases/12.11
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/releases/12.11 by this push:
     new e83012b5400 arm/armv8-r: remove redundant and misleading pointer in 
arm_syscall()
e83012b5400 is described below

commit e83012b5400a498f3490c801a6e642e37dad9c2c
Author: wangchengdong <[email protected]>
AuthorDate: Tue Sep 9 19:51:41 2025 +0800

    arm/armv8-r: remove redundant and misleading pointer in arm_syscall()
    
     replace **running_task with *running_task, and updated several other places
     accordingly
    
    Signed-off-by: Chengdong Wang <[email protected]>
---
 arch/arm/src/armv8-r/arm_syscall.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/arm/src/armv8-r/arm_syscall.c 
b/arch/arm/src/armv8-r/arm_syscall.c
index af389c945e9..09e5ac374b8 100644
--- a/arch/arm/src/armv8-r/arm_syscall.c
+++ b/arch/arm/src/armv8-r/arm_syscall.c
@@ -159,7 +159,7 @@ static void dispatch_syscall(void)
 uint32_t *arm_syscall(uint32_t *regs)
 {
   int cpu = this_cpu();
-  struct tcb_s **running_task = &g_running_tasks[cpu];
+  struct tcb_s *running_task = g_running_tasks[cpu];
   struct tcb_s *tcb = this_task();
   uint32_t cmd;
 #ifdef CONFIG_BUILD_PROTECTED
@@ -180,13 +180,13 @@ uint32_t *arm_syscall(uint32_t *regs)
 
   cmd = regs[REG_R0];
 
-  /* if cmd == SYS_restore_context (*running_task)->xcp.regs is valid
+  /* if cmd == SYS_restore_context running_task->xcp.regs is valid
    * should not be overwritten
    */
 
   if (cmd != SYS_restore_context)
     {
-      (*running_task)->xcp.regs = regs;
+      running_task->xcp.regs = regs;
     }
 
   /* The SVCall software interrupt is called with R0 = system call command
@@ -270,8 +270,9 @@ uint32_t *arm_syscall(uint32_t *regs)
         nxsched_resume_scheduler(tcb);
 
       case SYS_restore_context:
-        nxsched_suspend_scheduler(*running_task);
-        *running_task = tcb;
+        nxsched_suspend_scheduler(running_task);
+        running_task = tcb;
+        g_running_tasks[cpu] = running_task;
 
         /* Restore the cpu lock */
 
@@ -553,11 +554,11 @@ uint32_t *arm_syscall(uint32_t *regs)
 
   up_set_interrupt_context(false);
 
-  /* (*running_task)->xcp.regs is about to become invalid
+  /* running_task->xcp.regs is about to become invalid
    * and will be marked as NULL to avoid misusage.
    */
 
-  (*running_task)->xcp.regs = NULL;
+  running_task->xcp.regs = NULL;
 
   /* Return the last value of curent_regs.  This supports context switches
    * on return from the exception.  That capability is only used with the

Reply via email to