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 2021/06/14 07:58:36 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3913: arch: k210: Fix stack coloring for the idle thread stack

xiaoxiang781216 commented on a change in pull request #3913:
URL: https://github.com/apache/incubator-nuttx/pull/3913#discussion_r650329647



##########
File path: arch/risc-v/src/k210/k210_cpustart.c
##########
@@ -112,6 +112,25 @@ void k210_cpu_boot(int cpu)
   showprogress('b');
   DPRINTF("CPU%d Started\n", this_cpu());
 
+#ifdef CONFIG_STACK_COLORATION
+    {
+      FAR struct tcb_s *tcb = this_task();
+      register uint32_t *ptr;
+      register int i;
+
+      /* If stack debug is enabled, then fill the stack with a recognizable
+       * value that we can use later to test for high water marks.
+       */
+
+      for (i = 0, ptr = (uint32_t *)tcb->stack_alloc_ptr;
+           i < tcb->adj_stack_size;
+           i += sizeof(uint32_t))
+        {
+          *ptr++ = STACK_COLOR;
+        }
+    }

Review comment:
       can replace with riscv_stack_color?




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

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