mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
arch: Colorize the idle thread stack in an unified way
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Idae8da53e5a4799a8edc0e882f17fd515b70cb14
This commit is contained in:
committed by
David Sidrane
parent
dbf9c87a42
commit
fa0d123f87
@@ -59,9 +59,24 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
if (tcb->pid == 0)
|
||||
{
|
||||
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
|
||||
CONFIG_IDLETHREAD_STACKSIZE);
|
||||
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
|
||||
char *stack_ptr = (char *)(g_idle_topstack -
|
||||
CONFIG_IDLETHREAD_STACKSIZE);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
char *stack_end = (char *)up_getsp();
|
||||
|
||||
/* If stack debug is enabled, then fill the stack with a
|
||||
* recognizable value that we can use later to test for high
|
||||
* water marks.
|
||||
*/
|
||||
|
||||
while (stack_ptr < stack_end)
|
||||
{
|
||||
*--stack_end = 0xaa;
|
||||
}
|
||||
#endif /* CONFIG_STACK_COLORATION */
|
||||
|
||||
tcb->stack_alloc_ptr = stack_ptr;
|
||||
tcb->stack_base_ptr = stack_ptr;
|
||||
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,9 +63,24 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
if (tcb->pid == 0)
|
||||
{
|
||||
tcb->stack_alloc_ptr = (void *)(g_idle_topstack -
|
||||
CONFIG_IDLETHREAD_STACKSIZE);
|
||||
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
|
||||
char *stack_ptr = (char *)(g_idle_topstack -
|
||||
CONFIG_IDLETHREAD_STACKSIZE);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
char *stack_end = (char *)up_getsp();
|
||||
|
||||
/* If stack debug is enabled, then fill the stack with a
|
||||
* recognizable value that we can use later to test for high
|
||||
* water marks.
|
||||
*/
|
||||
|
||||
while (stack_ptr < stack_end)
|
||||
{
|
||||
*--stack_end = 0xaa;
|
||||
}
|
||||
#endif /* CONFIG_STACK_COLORATION */
|
||||
|
||||
tcb->stack_alloc_ptr = stack_ptr;
|
||||
tcb->stack_base_ptr = stack_ptr;
|
||||
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user