You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/16 08:03:39 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5754: arch/risc-v: Correct stack coloration in riscv_cpu_boot

pkarashchenko commented on a change in pull request #5754:
URL: https://github.com/apache/incubator-nuttx/pull/5754#discussion_r827721301



##########
File path: arch/risc-v/src/common/riscv_createstack.c
##########
@@ -218,7 +218,7 @@ void riscv_stack_color(void *stackbase, size_t nbytes)
   uint32_t *stkptr = (uint32_t *)(((uintptr_t)stackbase + 3) & ~3);
   uintptr_t stkend = nbytes ? (((uintptr_t)stackbase + nbytes) & ~3):
                      up_getsp(); /* 0: colorize the running stack */
-  size_t    nwords = (stkend - (uintptr_t)stackbase) >> 2;
+  size_t nwords = (stkend - (uintptr_t)(nbytes ? stackbase : stkptr)) >> 2;

Review comment:
       what about other archs? Do they have the same issue?




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org