Skip to content
Snippets Groups Projects
Commit bd34e373 authored by patacongo's avatar patacongo
Browse files

Fix interrupt stack compilation problem

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2803 42af7a65-404d-4744-a932-0658087f49c3
parent 9c82ea75
No related branches found
No related tags found
No related merge requests found
......@@ -120,7 +120,11 @@ extern uint32_t g_heapbase;
/* Address of the saved user stack pointer */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
# ifdef CONFIG_ARCH_CORTEXM3
extern void g_intstackbase;
# else
extern uint32_t g_userstack;
# endif
#endif
/* These 'addresses' of these values are setup by the linker script. They are
......
......@@ -187,7 +187,7 @@ static void up_dumpstate(void)
/* Get the limits on the interrupt stack memory */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
istackbase = (uint32_t)&g_userstack;
istackbase = (uint32_t)&g_intstackbase;
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3) - 4;
/* Show interrupt stack info */
......@@ -206,25 +206,40 @@ static void up_dumpstate(void)
/* Yes.. dump the interrupt stack */
up_stackdump(sp, istackbase);
}
/* Extract the user stack pointer which should lie
* at the base of the interrupt stack.
*/
/* Extract the user stack pointer. */
sp = g_userstack;
if (current_regs)
{
sp = current_regs[REG_R13];
lldbg("sp: %08x\n", sp);
}
/* Show user stack info */
/* Show user stack info */
lldbg("User stack:\n");
lldbg(" base: %08x\n", ustackbase);
lldbg(" size: %08x\n", ustacksize);
lldbg("User stack:\n");
lldbg(" base: %08x\n", ustackbase);
lldbg(" size: %08x\n", ustacksize);
/* Dump the user stack if the stack pointer lies within the allocated user
* stack memory.
*/
if (sp > ustackbase || sp <= ustackbase - ustacksize)
{
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
lldbg("ERROR: Stack pointer is not within allocated stack\n");
#endif
}
else
{
up_stackdump(sp, ustackbase);
}
}
#else
lldbg("sp: %08x\n", sp);
lldbg("stack base: %08x\n", ustackbase);
lldbg("stack size: %08x\n", ustacksize);
#endif
/* Dump the user stack if the stack pointer lies within the allocated user
* stack memory.
......@@ -240,6 +255,7 @@ static void up_dumpstate(void)
{
up_stackdump(sp, ustackbase);
}
#endif
/* Then dump the registers (if available) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment