pussuw commented on code in PR #14739:
URL: https://github.com/apache/nuttx/pull/14739#discussion_r1839633156


##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -192,22 +192,22 @@ uint64_t *arm64_syscall(uint64_t *regs)
            * set will determine the restored context.
            */
 
-          ret_regs = (uint64_t *)regs[REG_X1];
-          regs[REG_X1] = 0; /* set the saveregs = 0 */
+          tcb = (struct tcb_s *)regs[REG_X1];
+          ret_regs = (uint64_t *)tcb->xcp.regs;

Review Comment:
   No need for cast



##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -217,10 +217,13 @@ uint64_t *arm64_syscall(uint64_t *regs)
 
       case SYS_switch_context:
         {
+          struct tcb_s *rtcb = (struct tcb_s *)regs[REG_X1];
+
           DEBUGASSERT(regs[REG_X1] != 0 && regs[REG_X2] != 0);
-          *(uint64_t **)regs[REG_X1] = regs;
+          tcb = (struct tcb_s *)regs[REG_X2];
+          rtcb->xcp.regs = regs;
 
-          ret_regs = (uint64_t *)regs[REG_X2];
+          ret_regs = (uint64_t *)tcb->xcp.regs;

Review Comment:
   No need for cast



-- 
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