stack: update up_get_intstackbase API to support cpu id

For crash dump all the CPU intstack

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2024-03-28 17:57:03 +08:00 committed by Alan Carvalho de Assis
parent 93beeeeab0
commit 3844efb5b8
50 changed files with 137 additions and 125 deletions

View File

@ -158,7 +158,7 @@ void up_initial_state(struct tcb_s *tcb)
noinline_function void arm_initialize_stack(void)
{
#ifdef CONFIG_SMP
uint32_t stack = (uint32_t)arm_intstack_top();
uint32_t stack = (uint32_t)arm_intstack_top(up_cpu_index());
#else
uint32_t stack = (uint32_t)g_intstacktop;
#endif

View File

@ -181,7 +181,7 @@ void up_initial_state(struct tcb_s *tcb)
noinline_function void arm_initialize_stack(void)
{
#ifdef CONFIG_SMP
uint32_t stack = (uint32_t)arm_intstack_top();
uint32_t stack = (uint32_t)arm_intstack_top(up_cpu_index());
#else
uint32_t stack = (uint32_t)g_intstacktop;
#endif

View File

@ -187,9 +187,9 @@ void up_initial_state(struct tcb_s *tcb)
noinline_function void arm_initialize_stack(void)
{
#ifdef CONFIG_SMP
uint32_t stack = (uint32_t)arm_intstack_top();
uint32_t stack = (uint32_t)arm_intstack_top(up_cpu_index());
#ifdef CONFIG_ARMV8M_STACKCHECK_HARDWARE
uint32_t stacklim = (uint32_t)arm_intstack_alloc();
uint32_t stacklim = (uint32_t)arm_intstack_alloc(up_cpu_index());
#endif
#else
uint32_t stack = (uint32_t)g_intstacktop;

View File

@ -122,7 +122,7 @@ int up_backtrace(struct tcb_s *tcb,
{
#if CONFIG_ARCH_INTERRUPTSTACK > 7
# ifdef CONFIG_SMP
istacklimit = (void *)arm_intstack_top();
istacklimit = (void *)arm_intstack_top(up_cpu_index());
# else
istacklimit = g_intstacktop;
# endif /* CONFIG_SMP */

View File

@ -260,7 +260,7 @@ int up_backtrace(struct tcb_s *tcb,
unsigned long top;
#if CONFIG_ARCH_INTERRUPTSTACK > 7
# ifdef CONFIG_SMP
top = arm_intstack_top();
top = arm_intstack_top(up_cpu_index());
# else
top = (unsigned long)g_intstacktop;
# endif /* CONFIG_SMP */

View File

@ -725,7 +725,7 @@ int up_backtrace(struct tcb_s *tcb,
{
#if CONFIG_ARCH_INTERRUPTSTACK > 7
# ifdef CONFIG_SMP
frame.stack_top = arm_intstack_top();
frame.stack_top = arm_intstack_top(up_cpu_index());
# else
frame.stack_top = (unsigned long)&g_intstacktop;
# endif /* CONFIG_SMP */

View File

@ -224,9 +224,9 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 3
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return arm_stack_check((void *)up_get_intstackbase(),
return arm_stack_check((void *)up_get_intstackbase(cpu),
STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK));
}
#endif

View File

@ -37,10 +37,10 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
#ifdef CONFIG_SMP
return arm_intstack_alloc();
return arm_intstack_alloc(cpu);
#else
return (uintptr_t)g_intstackalloc;
#endif

View File

@ -57,7 +57,7 @@ volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
static inline void arm_color_intstack(void)
{
#ifdef CONFIG_SMP
uint32_t *ptr = (uint32_t *)arm_intstack_alloc();
uint32_t *ptr = (uint32_t *)arm_intstack_alloc(up_cpu_index());
#else
uint32_t *ptr = (uint32_t *)g_intstackalloc;
#endif

View File

@ -350,8 +350,8 @@ void arm_pminitialize(void);
/* Interrupt handling *******************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void);
uintptr_t arm_intstack_top(void);
uintptr_t arm_intstack_alloc(int cpu);
uintptr_t arm_intstack_top(int cpu);
#endif
#if CONFIG_ARCH_INTERRUPTSTACK > 7

View File

@ -582,9 +582,9 @@ int up_prioritize_irq(int irq, int priority)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(void)
uintptr_t arm_intstack_top(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()];
return g_cpu_intstack_top[cpu];
}
#endif
@ -598,8 +598,8 @@ uintptr_t arm_intstack_top(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void)
uintptr_t arm_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -136,10 +136,11 @@ void up_irqinitialize(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(void)
uintptr_t arm_intstack_top(int cpu)
{
return g_irqstack_top[up_cpu_index()];
return g_irqstack_top[cpu];
}
#endif
/****************************************************************************
@ -152,8 +153,8 @@ uintptr_t arm_intstack_top(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void)
uintptr_t arm_intstack_alloc(int cpu)
{
return g_irqstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_irqstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -161,9 +161,9 @@ void up_irqinitialize(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(void)
uintptr_t arm_intstack_top(int cpu)
{
return g_irqstack_top[up_cpu_index()];
return g_irqstack_top[cpu];
}
#endif
@ -177,8 +177,8 @@ uintptr_t arm_intstack_top(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void)
uintptr_t arm_intstack_alloc(int cpu)
{
return g_irqstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_irqstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -829,9 +829,9 @@ int lc823450_irq_register(int irq, struct lc823450_irq_ops *ops)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(void)
uintptr_t arm_intstack_top(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()];
return g_cpu_intstack_top[cpu];
}
#endif
@ -845,8 +845,8 @@ uintptr_t arm_intstack_top(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void)
uintptr_t arm_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -136,9 +136,9 @@ void up_irqinitialize(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(void)
uintptr_t arm_intstack_top(int cpu)
{
return g_irqstack_top[up_cpu_index()];
return g_irqstack_top[cpu];
}
#endif
@ -152,8 +152,8 @@ uintptr_t arm_intstack_top(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void)
uintptr_t arm_intstack_alloc(int cpu)
{
return g_irqstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_irqstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -447,9 +447,9 @@ int up_prioritize_irq(int irq, int priority)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_top(void)
uintptr_t arm_intstack_top(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()];
return g_cpu_intstack_top[cpu];
}
#endif
@ -463,8 +463,8 @@ uintptr_t arm_intstack_top(void)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t arm_intstack_alloc(void)
uintptr_t arm_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -477,7 +477,7 @@ int up_backtrace(struct tcb_s *tcb, void **buffer, int size, int skip)
#if CONFIG_ARCH_INTERRUPTSTACK > 7
ret = backtrace_push(
# ifdef CONFIG_SMP
arm_intstack_top(),
arm_intstack_top(up_cpu_index()),
# else
g_intstacktop,
# endif /* CONFIG_SMP */

View File

@ -132,7 +132,7 @@ int up_backtrace(struct tcb_s *tcb,
{
#if CONFIG_ARCH_INTERRUPTSTACK > 7
# ifdef CONFIG_SMP
istacklimit = (void *)arm64_intstack_top();
istacklimit = (void *)arm64_intstack_top(up_cpu_index());
# else
istacklimit = g_interrupt_stack + INTSTACK_SIZE;
# endif /* CONFIG_SMP */

View File

@ -202,9 +202,9 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 7
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return arm64_stack_check((void *)up_get_intstackbase(),
return arm64_stack_check((void *)up_get_intstackbase(cpu),
STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK));
}
#endif

View File

@ -37,10 +37,10 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
#ifdef CONFIG_SMP
return arm64_intstack_alloc();
return arm64_intstack_alloc(cpu);
#else
return (uintptr_t)g_interrupt_stack;
#endif

View File

@ -103,9 +103,9 @@ INIT_STACK_DEFINE(g_interrupt_fiq_stack, INTSTACK_SIZE);
****************************************************************************/
#ifdef CONFIG_SMP
uintptr_t arm64_intstack_alloc(void)
uintptr_t arm64_intstack_alloc(int cpu)
{
return (uintptr_t)(g_interrupt_stacks[up_cpu_index()]);
return (uintptr_t)(g_interrupt_stacks[cpu]);
}
/****************************************************************************
@ -117,9 +117,9 @@ uintptr_t arm64_intstack_alloc(void)
*
****************************************************************************/
uintptr_t arm64_intstack_top(void)
uintptr_t arm64_intstack_top(int cpu)
{
return (uintptr_t)(g_interrupt_stacks[up_cpu_index()] + INTSTACK_SIZE);
return (uintptr_t)(g_interrupt_stacks[cpu] + INTSTACK_SIZE);
}
#endif

View File

@ -168,8 +168,8 @@ INIT_STACK_ARRAY_DEFINE_EXTERN(g_interrupt_fiq_stacks, CONFIG_SMP_NCPUS,
INTSTACK_SIZE);
#endif
uintptr_t arm64_intstack_alloc(void);
uintptr_t arm64_intstack_top(void);
uintptr_t arm64_intstack_alloc(int cpu);
uintptr_t arm64_intstack_top(int cpu);
#else
/* idle thread stack for primary core */

View File

@ -149,7 +149,7 @@ size_t up_check_tcbstack(FAR struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 3
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
uintptr_t start = (uintptr_t)g_intstackalloc;
return avr_stack_check(start, CONFIG_ARCH_INTERRUPTSTACK & ~3);

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -143,7 +143,7 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
tcb->adj_stack_size);
}
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return ceva_stack_check((uintptr_t)g_intstackalloc,
g_intstackbase - g_intstackalloc);

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -120,7 +120,7 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 3
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return or1k_stack_check((uintptr_t)g_intstackalloc,
(CONFIG_ARCH_INTERRUPTSTACK & ~3));

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -181,7 +181,7 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 15
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return riscv_stack_check((uintptr_t)g_intstackalloc,
(CONFIG_ARCH_INTERRUPTSTACK & ~15));

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -204,9 +204,9 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 7
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return sparc_stack_check((void *)sparc_intstack_alloc(),
return sparc_stack_check((void *)sparc_intstack_alloc(cpu),
STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK));
}
#endif

View File

@ -37,8 +37,8 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)sparc_intstack_alloc();
return (uintptr_t)sparc_intstack_alloc(cpu);
}
#endif

View File

@ -103,7 +103,7 @@ volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 7
static inline void up_color_intstack(void)
{
uint32_t *ptr = (uint32_t *)sparc_intstack_alloc();
uint32_t *ptr = (uint32_t *)sparc_intstack_alloc(up_cpu_index());
ssize_t size;
for (size = ((CONFIG_ARCH_INTERRUPTSTACK & ~7) * CONFIG_SMP_NCPUS);

View File

@ -198,8 +198,8 @@ void sparc_sigdeliver(void);
/* Interrupt handling *******************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t sparc_intstack_alloc(void);
uintptr_t sparc_intstack_top(void);
uintptr_t sparc_intstack_alloc(int cpu);
uintptr_t sparc_intstack_top(int cpu);
#endif
/* Chip-specific functions **************************************************/

View File

@ -508,10 +508,10 @@ int up_prioritize_irq(int irq, int priority)
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t sparc_intstack_top(void)
uintptr_t sparc_intstack_top(int cpu)
{
#if defined(CONFIG_SMP)
return g_cpu_intstack_top[up_cpu_index()];
return g_cpu_intstack_top[cpu];
#else
return g_cpu_intstack_top[0];
#endif
@ -528,10 +528,10 @@ uintptr_t sparc_intstack_top(void)
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 7
uintptr_t sparc_intstack_alloc(void)
uintptr_t sparc_intstack_alloc(int cpu)
{
#if defined(CONFIG_SMP)
return g_cpu_intstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
#else
return g_cpu_intstack_top[0] - INTSTACK_SIZE;
#endif

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -37,7 +37,7 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
return (uintptr_t)g_intstackalloc;
}

View File

@ -230,8 +230,8 @@ void xtensa_window_spill(void);
/* IRQs */
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
uintptr_t xtensa_intstack_alloc(void);
uintptr_t xtensa_intstack_top(void);
uintptr_t xtensa_intstack_alloc(int cpu);
uintptr_t xtensa_intstack_top(int cpu);
#endif
uint32_t *xtensa_int_decode(uint32_t cpuints, uint32_t *regs);

View File

@ -237,7 +237,7 @@ int up_backtrace(struct tcb_s *tcb, void **buffer, int size, int skip)
#if CONFIG_ARCH_INTERRUPTSTACK > 15
void *istackbase;
#ifdef CONFIG_SMP
istackbase = xtensa_intstack_alloc();
istackbase = xtensa_intstack_alloc(up_cpu_index());
#else
istackbase = g_intstackalloc;
#endif

View File

@ -163,9 +163,9 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
}
#if CONFIG_ARCH_INTERRUPTSTACK > 15
size_t up_check_intstack(void)
size_t up_check_intstack(int cpu)
{
return xtensa_stack_check(up_get_intstackbase(), INTSTACK_SIZE);
return xtensa_stack_check(up_get_intstackbase(cpu), INTSTACK_SIZE);
}
#endif

View File

@ -37,10 +37,10 @@
****************************************************************************/
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void)
uintptr_t up_get_intstackbase(int cpu)
{
#ifdef CONFIG_SMP
return (uintptr_t)xtensa_intstack_alloc();
return (uintptr_t)xtensa_intstack_alloc(cpu);
#else
return (uintptr_t)g_intstackalloc;
#endif

View File

@ -61,7 +61,7 @@ volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
static inline void xtensa_color_intstack(void)
{
#ifdef CONFIG_SMP
uint32_t *ptr = (uint32_t *)xtensa_intstack_alloc();
uint32_t *ptr = (uint32_t *)xtensa_intstack_alloc(up_cpu_index());
#else
uint32_t *ptr = (uint32_t *)g_intstackalloc;
#endif

View File

@ -749,9 +749,9 @@ void up_enable_irq(int irq)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
uintptr_t xtensa_intstack_top(void)
uintptr_t xtensa_intstack_top(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()];
return g_cpu_intstack_top[cpu];
}
/****************************************************************************
@ -763,9 +763,9 @@ uintptr_t xtensa_intstack_top(void)
*
****************************************************************************/
uintptr_t xtensa_intstack_alloc(void)
uintptr_t xtensa_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -696,9 +696,9 @@ void up_enable_irq(int irq)
****************************************************************************/
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
uintptr_t xtensa_intstack_top(void)
uintptr_t xtensa_intstack_top(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()];
return g_cpu_intstack_top[cpu];
}
/****************************************************************************
@ -710,9 +710,9 @@ uintptr_t xtensa_intstack_top(void)
*
****************************************************************************/
uintptr_t xtensa_intstack_alloc(void)
uintptr_t xtensa_intstack_alloc(int cpu)
{
return g_cpu_intstack_top[up_cpu_index()] - INTSTACK_SIZE;
return g_cpu_intstack_top[cpu] - INTSTACK_SIZE;
}
#endif

View File

@ -187,7 +187,8 @@ void board_crashdump(uintptr_t sp, struct tcb_s *tcb,
/* Get the limits on the interrupt stack memory */
#ifdef CONFIG_SMP
pdump->info.stacks.interrupt.top = (uint32_t)arm_intstack_top();
pdump->info.stacks.interrupt.top =
(uint32_t)arm_intstack_top(up_cpu_index());
#else
pdump->info.stacks.interrupt.top = (uint32_t)g_intstacktop;
#endif

View File

@ -2536,12 +2536,12 @@ void irq_dispatch(int irq, FAR void *context);
struct tcb_s;
size_t up_check_tcbstack(FAR struct tcb_s *tcb);
#if defined(CONFIG_ARCH_INTERRUPTSTACK) && CONFIG_ARCH_INTERRUPTSTACK > 3
size_t up_check_intstack(void);
size_t up_check_intstack(int cpu);
#endif
#endif
#if defined(CONFIG_ARCH_INTERRUPTSTACK) && CONFIG_ARCH_INTERRUPTSTACK > 3
uintptr_t up_get_intstackbase(void);
uintptr_t up_get_intstackbase(int cpu);
#endif
/****************************************************************************

View File

@ -194,7 +194,7 @@ static void dump_stack(FAR const char *tag, uintptr_t sp,
static void dump_stacks(FAR struct tcb_s *rtcb, uintptr_t sp)
{
#if CONFIG_ARCH_INTERRUPTSTACK > 0
uintptr_t intstack_base = up_get_intstackbase();
uintptr_t intstack_base = up_get_intstackbase(up_cpu_index());
size_t intstack_size = CONFIG_ARCH_INTERRUPTSTACK;
uintptr_t intstack_top = intstack_base + intstack_size;
uintptr_t intstack_sp = 0;
@ -243,7 +243,7 @@ static void dump_stacks(FAR struct tcb_s *rtcb, uintptr_t sp)
intstack_base,
intstack_size,
#ifdef CONFIG_STACK_COLORATION
up_check_intstack()
up_check_intstack(up_cpu_index())
#else
0
#endif
@ -405,17 +405,8 @@ static void dump_backtrace(FAR struct tcb_s *tcb, FAR void *arg)
static void dump_tasks(void)
{
#if CONFIG_ARCH_INTERRUPTSTACK > 0 && defined(CONFIG_STACK_COLORATION)
size_t stack_used = up_check_intstack();
size_t stack_filled = 0;
if (stack_used > 0)
{
/* Use fixed-point math with one decimal place */
stack_filled = 10 * 100 *
stack_used / CONFIG_ARCH_INTERRUPTSTACK;
}
#if CONFIG_ARCH_INTERRUPTSTACK > 0
int cpu;
#endif
/* Dump interesting properties of each task in the crash environment */
@ -438,31 +429,50 @@ static void dump_tasks(void)
" COMMAND\n");
#if CONFIG_ARCH_INTERRUPTSTACK > 0
_alert(" ---- ---"
# ifdef CONFIG_SMP
" ----"
# endif
" --- --------"
" ------- ---"
" ------- ----------"
" ----------------"
" %p"
" %7u"
for (cpu = 0; cpu < CONFIG_SMP_NCPUS; cpu++)
{
# ifdef CONFIG_STACK_COLORATION
" %7zu %3zu.%1zu%%%c"
size_t stack_used = up_check_intstack(cpu);
size_t stack_filled = 0;
if (stack_used > 0)
{
/* Use fixed-point math with one decimal place */
stack_filled = 10 * 100 *
stack_used / CONFIG_ARCH_INTERRUPTSTACK;
}
# endif
_alert(" ---- ---"
# ifdef CONFIG_SMP
" %4d"
# endif
" --- --------"
" ------- ---"
" ------- ----------"
" ----------------"
" %p"
" %7u"
# ifdef CONFIG_STACK_COLORATION
" %7zu %3zu.%1zu%%%c"
# endif
# ifndef CONFIG_SCHED_CPULOAD_NONE
" ----"
" ----"
# endif
" irq\n"
, (FAR void *)up_get_intstackbase()
, CONFIG_ARCH_INTERRUPTSTACK
" irq\n"
#ifdef CONFIG_SMP
, cpu
#endif
, (FAR void *)up_get_intstackbase(cpu)
, CONFIG_ARCH_INTERRUPTSTACK
# ifdef CONFIG_STACK_COLORATION
, stack_used
, stack_filled / 10, stack_filled % 10,
(stack_filled >= 10 * 80 ? '!' : ' ')
, stack_used
, stack_filled / 10, stack_filled % 10,
(stack_filled >= 10 * 80 ? '!' : ' ')
# endif
);
);
}
#endif
nxsched_foreach(dump_task, NULL);