Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions arch/arm/src/common/arm_checkstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,17 @@
* Name: arm_color_intstack
*
* Description:
* Set the interrupt stack to a value so that later we can determine how
* much stack space was used by interrupt handling logic
* Set the interrupt stack of the calling CPU to a value so that later we
* can determine how much stack space was used by interrupt handling logic.
* Another CPU can be in an interrupt handler at this time, so its stack
* is not touched. Each CPU calls this before it enables its interrupts.
*
****************************************************************************/

#if defined(CONFIG_ARCH_INTERRUPTSTACK) && CONFIG_ARCH_INTERRUPTSTACK > 3
Comment thread
xiaoxiang781216 marked this conversation as resolved.
Resolved
void arm_color_intstack(void)
{
#ifdef CONFIG_SMP
int cpu;

for (cpu = 0; cpu < CONFIG_SMP_NCPUS; cpu++)
{
arm_stack_color((void *)up_get_intstackbase(cpu), INTSTACK_SIZE);
}
#else
arm_stack_color((void *)g_intstackalloc, INTSTACK_SIZE);
#endif
arm_stack_color((void *)up_get_intstackbase(this_cpu()), INTSTACK_SIZE);
}
#endif

Expand Down Expand Up @@ -144,6 +137,7 @@ size_t arm_stack_check(void *stackbase, size_t nbytes)
for (j = 0; j < 64; j++)
{
int ch;

if (*ptr++ == STACK_COLOR)
{
ch = '.';
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/lc823450/lc823450_cpustart.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ static void cpu1_boot(void)
arm_initialize_stack();
#endif

arm_color_intstack();

if (cpu == 1)
{
putreg32((uint32_t)_stext, NVIC_VECTAB); /* use CPU0 vectors */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/src/rp23xx/rp23xx_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ void up_irqinitialize(void)
/* And finally, enable interrupts */

#ifndef CONFIG_SUPPRESS_INTERRUPTS
arm_color_intstack();
up_irq_enable();
#endif
}
Expand Down
Loading