xiaoxiang781216 commented on code in PR #8227:
URL: https://github.com/apache/nuttx/pull/8227#discussion_r1086814458


##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -436,11 +436,31 @@ int arm64_syscall(uint64_t *regs)
 
           if (rtcb->xcp.kstack != NULL)
             {
-              DEBUGASSERT(rtcb->xcp.kstkptr == NULL &&
-                          rtcb->xcp.ustkptr != NULL);
+              uint32_t usp;

Review Comment:
   change to uint64_t? uint32_t isn't enough for arm64.



##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -538,8 +557,15 @@ int arm64_syscall(uint64_t *regs)
           if (index == 0 && rtcb->xcp.kstack != NULL)
             {
               rtcb->xcp.ustkptr = (uint32_t *)regs[REG_SP];
-              regs[REG_SP]      = (uint32_t)rtcb->xcp.kstack +
+              if (rtcb->xcp.kstkptr != NULL)
+                {
+                  regs[REG_SP]  = (uint32_t)rtcb->xcp.kstkptr;

Review Comment:
   cast to uint64_t



##########
arch/arm64/src/common/arm64_syscall.c:
##########
@@ -538,8 +557,15 @@ int arm64_syscall(uint64_t *regs)
           if (index == 0 && rtcb->xcp.kstack != NULL)
             {
               rtcb->xcp.ustkptr = (uint32_t *)regs[REG_SP];
-              regs[REG_SP]      = (uint32_t)rtcb->xcp.kstack +
+              if (rtcb->xcp.kstkptr != NULL)
+                {
+                  regs[REG_SP]  = (uint32_t)rtcb->xcp.kstkptr;
+                }
+              else
+                {
+                  regs[REG_SP]  = (uint32_t)rtcb->xcp.kstack +

Review Comment:
   ```suggestion
                     regs[REG_SP]  = (uint64_t)rtcb->xcp.kstack +
   ```



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