Fix interrupt stack compilation problem

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2803 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2010-07-16 02:35:47 +00:00
parent 9c82ea75f9
commit bd34e373d1
2 changed files with 33 additions and 13 deletions

View File

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

View File

@ -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.
*/
sp = g_userstack;
lldbg("sp: %08x\n", sp);
}
/* Show user stack info */
/* Extract the user stack pointer. */
lldbg("User stack:\n");
lldbg(" base: %08x\n", ustackbase);
lldbg(" size: %08x\n", ustacksize);
if (current_regs)
{
sp = current_regs[REG_R13];
lldbg("sp: %08x\n", sp);
/* Show user stack info */
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) */