diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-17 22:45:58 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-17 22:45:58 +0000 |
commit | c7feb32b31c66cf2fb41ed1546b94e068b3dc14a (patch) | |
tree | 96a0bde2330b185d23ea07e54b5eccb4512d25e5 /nuttx/arch | |
parent | 548e3a80c49949bb6cec2fa34d67872c05d09451 (diff) | |
download | px4-nuttx-c7feb32b31c66cf2fb41ed1546b94e068b3dc14a.tar.gz px4-nuttx-c7feb32b31c66cf2fb41ed1546b94e068b3dc14a.tar.bz2 px4-nuttx-c7feb32b31c66cf2fb41ed1546b94e068b3dc14a.zip |
Add special handling for idle task stack dump
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@85 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/c5471/src/up_assert.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nuttx/arch/c5471/src/up_assert.c b/nuttx/arch/c5471/src/up_assert.c index 678bb4f27..c2d1d82ee 100644 --- a/nuttx/arch/c5471/src/up_assert.c +++ b/nuttx/arch/c5471/src/up_assert.c @@ -83,14 +83,26 @@ static inline uint32 up_getsp(void) static void up_stackdump(void) { _TCB *rtcb = (_TCB*)g_readytorun.head; - uint32 stack_base = (uint32)rtcb->adj_stack_ptr; uint32 sp = up_getsp(); + uint32 stack_base; + uint32 stack_size; + + if (rtcb->pid == 0) + { + stack_base = g_heapbase - CONFIG_PROC_STACK_SIZE; + stack_size = CONFIG_PROC_STACK_SIZE; + } + else + { + stack_base = (uint32)rtcb->adj_stack_ptr; + stack_size = (uint32)rtcb->adj_stack_size; + } lldbg("stack_base: %08x\n", stack_base); - lldbg("stack_size: %08x\n", rtcb->adj_stack_size); + lldbg("stack_size: %08x\n", stack_size); lldbg("sp: %08x\n", sp); - if (sp >= stack_base || sp < stack_base - rtcb->adj_stack_size) + if (sp >= stack_base || sp < stack_base - stack_size) { lldbg("ERROR: Stack pointer is not within allocated stack\n"); return; |