mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
arch: Rename g_intstackbase to g_intstacktop
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
97e6d35c3a
commit
8640d82ce0
@@ -73,11 +73,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -86,7 +86,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -177,7 +177,7 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -194,17 +194,17 @@ static void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
_alert("Interrupt Stack\n", sp);
|
_alert("Interrupt Stack\n", sp);
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ arm_vectorirq:
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
/* Call arm_decodeirq() on the interrupt stack */
|
/* Call arm_decodeirq() on the interrupt stack */
|
||||||
|
|
||||||
ldr sp, .Lirqstackbase /* SP = interrupt stack base */
|
ldr sp, .Lirqstacktop /* SP = interrupt stack top */
|
||||||
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
||||||
bl arm_decodeirq /* Call the handler */
|
bl arm_decodeirq /* Call the handler */
|
||||||
ldr sp, [sp] /* Restore the user stack pointer */
|
ldr sp, [sp] /* Restore the user stack pointer */
|
||||||
@@ -126,8 +126,8 @@ arm_vectorirq:
|
|||||||
ldmia sp, {r0-r15}^ /* Return */
|
ldmia sp, {r0-r15}^ /* Return */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.Lirqstackbase:
|
.Lirqstacktop:
|
||||||
.word g_intstackbase
|
.word g_intstacktop
|
||||||
#endif
|
#endif
|
||||||
.size arm_vectorirq, . - arm_vectorirq
|
.size arm_vectorirq, . - arm_vectorirq
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ arm_vectorfiq:
|
|||||||
.size arm_vectorfiq, . - arm_vectorfiq
|
.size arm_vectorfiq, . - arm_vectorfiq
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
@@ -423,13 +423,13 @@ arm_vectorfiq:
|
|||||||
|
|
||||||
.globl g_intstackalloc
|
.globl g_intstackalloc
|
||||||
.type g_intstackalloc, object
|
.type g_intstackalloc, object
|
||||||
.globl g_intstackbase
|
.globl g_intstacktop
|
||||||
.type g_intstackbase, object
|
.type g_intstacktop, object
|
||||||
|
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackbase, 0
|
.size g_intstacktop, 0
|
||||||
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -85,7 +85,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -215,7 +215,7 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -232,16 +232,16 @@ static void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ exception_common:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
ldr r7, =g_intstackbase /* R7=Base of the interrupt stack */
|
ldr r7, =g_intstacktop /* R7=Top of the interrupt stack */
|
||||||
mov sp, r7 /* Set the new stack point */
|
mov sp, r7 /* Set the new stack point */
|
||||||
push {r1} /* Save the MSP on the interrupt stack */
|
push {r1} /* Save the MSP on the interrupt stack */
|
||||||
bl arm_doirq /* R0=IRQ, R1=register save area on stack */
|
bl arm_doirq /* R0=IRQ, R1=register save area on stack */
|
||||||
@@ -248,7 +248,7 @@ exception_common:
|
|||||||
.size exception_common, .-exception_common
|
.size exception_common, .-exception_common
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Shouldn't happen
|
* Shouldn't happen
|
||||||
@@ -258,11 +258,11 @@ exception_common:
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.bss
|
.bss
|
||||||
.global g_intstackalloc
|
.global g_intstackalloc
|
||||||
.global g_intstackbase
|
.global g_intstacktop
|
||||||
.balign 4
|
.balign 4
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackalloc, .-g_intstackalloc
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -88,7 +88,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -221,9 +221,9 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
istackbase = (uint32_t)arm_intstack_base();
|
istackbase = (uint32_t)arm_intstack_alloc();
|
||||||
#else
|
#else
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
#endif
|
#endif
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
||||||
|
|
||||||
@@ -251,8 +251,7 @@ static void up_dumpstate(void)
|
|||||||
|
|
||||||
if (rtcb->xcp.kstack)
|
if (rtcb->xcp.kstack)
|
||||||
{
|
{
|
||||||
kstackbase = (uint32_t)rtcb->xcp.kstack +
|
kstackbase = (uint32_t)rtcb->xcp.kstack;
|
||||||
CONFIG_ARCH_KERNEL_STACKSIZE;
|
|
||||||
|
|
||||||
_alert("Kernel stack:\n");
|
_alert("Kernel stack:\n");
|
||||||
_alert(" base: %08x\n", kstackbase);
|
_alert(" base: %08x\n", kstackbase);
|
||||||
@@ -263,17 +262,17 @@ static void up_dumpstate(void)
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
/* Does the current stack pointer lie within the interrupt stack? */
|
/* Does the current stack pointer lie within the interrupt stack? */
|
||||||
|
|
||||||
if (sp >= istackbase - istacksize && sp < istackbase)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
_alert("Interrupt Stack\n", sp);
|
_alert("Interrupt Stack\n", sp);
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -303,10 +302,11 @@ static void up_dumpstate(void)
|
|||||||
* kernel stack memory.
|
* kernel stack memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if (sp >= (uint32_t)rtcb->xcp.kstack && sp < kstackbase)
|
else if (sp >= kstackbase &&
|
||||||
|
sp < kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE)
|
||||||
{
|
{
|
||||||
_alert("Kernel Stack\n", sp);
|
_alert("Kernel Stack\n", sp);
|
||||||
up_stackdump(sp, kstackbase);
|
up_stackdump(sp, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
@@ -314,7 +314,7 @@ static void up_dumpstate(void)
|
|||||||
_alert("ERROR: Stack pointer is not within the allocated stack\n");
|
_alert("ERROR: Stack pointer is not within the allocated stack\n");
|
||||||
up_stackdump(ustackbase - ustacksize, ustackbase);
|
up_stackdump(ustackbase - ustacksize, ustackbase);
|
||||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||||
up_stackdump((uint32_t)rtcb->xcp.kstack, kstackbase);
|
up_stackdump(kstackbase, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.macro setirqstack, tmp1, tmp2
|
.macro setirqstack, tmp1, tmp2
|
||||||
ldr sp, .Lirqstackbase /* SP = IRQ stack top */
|
ldr sp, .Lirqstacktop /* SP = IRQ stack top */
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.macro setfiqstack, tmp1, tmp2
|
.macro setfiqstack, tmp1, tmp2
|
||||||
ldr sp, .Lfiqstackbase /* SP = FIQ stack top */
|
ldr sp, .Lfiqstacktop /* SP = FIQ stack top */
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ arm_vectorirq:
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
/* Call arm_decodeirq() on the interrupt stack */
|
/* Call arm_decodeirq() on the interrupt stack */
|
||||||
|
|
||||||
setirqstack r1, r3 /* SP = interrupt stack base */
|
setirqstack r1, r3 /* SP = interrupt stack top */
|
||||||
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
||||||
mov r4, sp /* Save the SP in a preserved register */
|
mov r4, sp /* Save the SP in a preserved register */
|
||||||
bic sp, sp, #7 /* Force 8-byte alignment */
|
bic sp, sp, #7 /* Force 8-byte alignment */
|
||||||
@@ -257,8 +257,8 @@ arm_vectorirq:
|
|||||||
ldmia r0, {r0-r15}^ /* Return */
|
ldmia r0, {r0-r15}^ /* Return */
|
||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.Lirqstackbase:
|
.Lirqstacktop:
|
||||||
.word g_intstackbase
|
.word g_intstacktop
|
||||||
#endif
|
#endif
|
||||||
.size arm_vectorirq, . - arm_vectorirq
|
.size arm_vectorirq, . - arm_vectorirq
|
||||||
|
|
||||||
@@ -903,7 +903,7 @@ arm_vectorfiq:
|
|||||||
mov r0, sp /* Get r0=xcp */
|
mov r0, sp /* Get r0=xcp */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
setfiqstack r1, r4 /* SP = interrupt stack base */
|
setfiqstack r1, r4 /* SP = interrupt stack top */
|
||||||
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
||||||
mov r4, sp /* Save the SP in a preserved register */
|
mov r4, sp /* Save the SP in a preserved register */
|
||||||
bic sp, sp, #7 /* Force 8-byte alignment */
|
bic sp, sp, #7 /* Force 8-byte alignment */
|
||||||
@@ -954,8 +954,8 @@ arm_vectorfiq:
|
|||||||
ldmia r0, {r0-r15}^ /* Return */
|
ldmia r0, {r0-r15}^ /* Return */
|
||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.Lfiqstackbase:
|
.Lfiqstacktop:
|
||||||
.word g_fiqstackbase
|
.word g_fiqstacktop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -964,7 +964,7 @@ arm_vectorfiq:
|
|||||||
.size arm_vectorfiq, . - arm_vectorfiq
|
.size arm_vectorfiq, . - arm_vectorfiq
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
@@ -973,28 +973,28 @@ arm_vectorfiq:
|
|||||||
|
|
||||||
.globl g_intstackalloc
|
.globl g_intstackalloc
|
||||||
.type g_intstackalloc, object
|
.type g_intstackalloc, object
|
||||||
.globl g_intstackbase
|
.globl g_intstacktop
|
||||||
.type g_intstackbase, object
|
.type g_intstacktop, object
|
||||||
|
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackbase, 0
|
.size g_intstacktop, 0
|
||||||
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_fiqstackalloc/g_fiqstackbase
|
* Name: g_fiqstackalloc/g_fiqstacktop
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl g_fiqstackalloc
|
.globl g_fiqstackalloc
|
||||||
.type g_fiqstackalloc, object
|
.type g_fiqstackalloc, object
|
||||||
.globl g_fiqstackbase
|
.globl g_fiqstacktop
|
||||||
.type g_fiqstackbase, object
|
.type g_fiqstacktop, object
|
||||||
|
|
||||||
g_fiqstackalloc:
|
g_fiqstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_fiqstackbase:
|
g_fiqstacktop:
|
||||||
.size g_fiqstackbase, 0
|
.size g_fiqstacktop, 0
|
||||||
.size g_fiqstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
.size g_fiqstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
||||||
|
|
||||||
#endif /* !CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 7 */
|
#endif /* !CONFIG_SMP && CONFIG_ARCH_INTERRUPTSTACK > 7 */
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -88,7 +88,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -224,9 +224,9 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
istackbase = (uint32_t)arm_intstack_base();
|
istackbase = (uint32_t)arm_intstack_alloc();
|
||||||
#else
|
#else
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
#endif
|
#endif
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
||||||
|
|
||||||
@@ -244,16 +244,16 @@ static void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.macro setintstack, tmp1, tmp2
|
.macro setintstack, tmp1, tmp2
|
||||||
ldr sp, =g_intstackbase
|
ldr sp, =g_intstacktop
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ exception_common:
|
|||||||
.size exception_common, .-exception_common
|
.size exception_common, .-exception_common
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Shouldn't happen
|
* Shouldn't happen
|
||||||
@@ -321,11 +321,11 @@ exception_common:
|
|||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.bss
|
.bss
|
||||||
.global g_intstackalloc
|
.global g_intstackalloc
|
||||||
.global g_intstackbase
|
.global g_intstacktop
|
||||||
.balign 8
|
.balign 8
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackalloc, .-g_intstackalloc
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.macro setintstack, tmp1, tmp2
|
.macro setintstack, tmp1, tmp2
|
||||||
ldr sp, =g_intstackbase
|
ldr sp, =g_intstacktop
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ exception_common:
|
|||||||
.size exception_common, .-exception_common
|
.size exception_common, .-exception_common
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Shouldn't happen
|
* Shouldn't happen
|
||||||
@@ -339,11 +339,11 @@ exception_common:
|
|||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.bss
|
.bss
|
||||||
.global g_intstackalloc
|
.global g_intstackalloc
|
||||||
.global g_intstackbase
|
.global g_intstacktop
|
||||||
.balign 8
|
.balign 8
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackalloc, .-g_intstackalloc
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -85,7 +85,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -217,7 +217,7 @@ static void up_dumpstate(void)
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -244,8 +244,7 @@ static void up_dumpstate(void)
|
|||||||
|
|
||||||
if (rtcb->xcp.kstack)
|
if (rtcb->xcp.kstack)
|
||||||
{
|
{
|
||||||
kstackbase = (uint32_t)rtcb->xcp.kstack +
|
kstackbase = (uint32_t)rtcb->xcp.kstack;
|
||||||
CONFIG_ARCH_KERNEL_STACKSIZE;
|
|
||||||
|
|
||||||
_alert("Kernel stack:\n");
|
_alert("Kernel stack:\n");
|
||||||
_alert(" base: %08x\n", kstackbase);
|
_alert(" base: %08x\n", kstackbase);
|
||||||
@@ -256,17 +255,17 @@ static void up_dumpstate(void)
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
/* Does the current stack pointer lie within the interrupt stack? */
|
/* Does the current stack pointer lie within the interrupt stack? */
|
||||||
|
|
||||||
if (sp >= istackbase - istacksize && sp < istackbase)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
_alert("Interrupt Stack\n", sp);
|
_alert("Interrupt Stack\n", sp);
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -296,10 +295,11 @@ static void up_dumpstate(void)
|
|||||||
* kernel stack memory.
|
* kernel stack memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if (sp >= (uint32_t)rtcb->xcp.kstack && sp < kstackbase)
|
else if (sp >= kstackbase &&
|
||||||
|
sp < kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE)
|
||||||
{
|
{
|
||||||
_alert("Kernel Stack\n", sp);
|
_alert("Kernel Stack\n", sp);
|
||||||
up_stackdump(sp, kstackbase);
|
up_stackdump(sp, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
@@ -307,7 +307,7 @@ static void up_dumpstate(void)
|
|||||||
_alert("ERROR: Stack pointer is not within the allocated stack\n");
|
_alert("ERROR: Stack pointer is not within the allocated stack\n");
|
||||||
up_stackdump(ustackbase - ustacksize, ustackbase);
|
up_stackdump(ustackbase - ustacksize, ustackbase);
|
||||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||||
up_stackdump((uint32_t)rtcb->xcp.kstack, kstackbase);
|
up_stackdump(kstackbase, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ arm_vectorirq:
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
/* Call arm_decodeirq() on the interrupt stack */
|
/* Call arm_decodeirq() on the interrupt stack */
|
||||||
|
|
||||||
ldr sp, .Lirqstackbase /* SP = interrupt stack base */
|
ldr sp, .Lirqstacktop /* SP = interrupt stack top */
|
||||||
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
||||||
mov r4, sp /* Save the SP in a preserved register */
|
mov r4, sp /* Save the SP in a preserved register */
|
||||||
bic sp, sp, #7 /* Force 8-byte alignment */
|
bic sp, sp, #7 /* Force 8-byte alignment */
|
||||||
@@ -211,8 +211,8 @@ arm_vectorirq:
|
|||||||
ldmia r0, {r0-r15}^ /* Return */
|
ldmia r0, {r0-r15}^ /* Return */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.Lirqstackbase:
|
.Lirqstacktop:
|
||||||
.word g_intstackbase
|
.word g_intstacktop
|
||||||
#endif
|
#endif
|
||||||
.size arm_vectorirq, . - arm_vectorirq
|
.size arm_vectorirq, . - arm_vectorirq
|
||||||
|
|
||||||
@@ -857,7 +857,7 @@ arm_vectorfiq:
|
|||||||
mov r0, sp /* Get r0=xcp */
|
mov r0, sp /* Get r0=xcp */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
ldr sp, .Lfiqstackbase /* SP = interrupt stack base */
|
ldr sp, .Lfiqstacktop /* SP = interrupt stack top */
|
||||||
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
str r0, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
||||||
mov r4, sp /* Save the SP in a preserved register */
|
mov r4, sp /* Save the SP in a preserved register */
|
||||||
bic sp, sp, #7 /* Force 8-byte alignment */
|
bic sp, sp, #7 /* Force 8-byte alignment */
|
||||||
@@ -908,8 +908,8 @@ arm_vectorfiq:
|
|||||||
ldmia r0, {r0-r15}^ /* Return */
|
ldmia r0, {r0-r15}^ /* Return */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.Lfiqstackbase:
|
.Lfiqstacktop:
|
||||||
.word g_fiqstackbase
|
.word g_fiqstacktop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -918,7 +918,7 @@ arm_vectorfiq:
|
|||||||
.size arm_vectorfiq, . - arm_vectorfiq
|
.size arm_vectorfiq, . - arm_vectorfiq
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
@@ -927,28 +927,28 @@ arm_vectorfiq:
|
|||||||
|
|
||||||
.globl g_intstackalloc
|
.globl g_intstackalloc
|
||||||
.type g_intstackalloc, object
|
.type g_intstackalloc, object
|
||||||
.globl g_intstackbase
|
.globl g_intstacktop
|
||||||
.type g_intstackbase, object
|
.type g_intstacktop, object
|
||||||
|
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackbase, 0
|
.size g_intstacktop, 0
|
||||||
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_fiqstackalloc/g_fiqstackbase
|
* Name: g_fiqstackalloc/g_fiqstacktop
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
.globl g_fiqstackalloc
|
.globl g_fiqstackalloc
|
||||||
.type g_fiqstackalloc, object
|
.type g_fiqstackalloc, object
|
||||||
.globl g_fiqstackbase
|
.globl g_fiqstacktop
|
||||||
.type g_fiqstackbase, object
|
.type g_fiqstacktop, object
|
||||||
|
|
||||||
g_fiqstackalloc:
|
g_fiqstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_fiqstackbase:
|
g_fiqstacktop:
|
||||||
.size g_fiqstackbase, 0
|
.size g_fiqstacktop, 0
|
||||||
.size g_fiqstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
.size g_fiqstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~7)
|
||||||
|
|
||||||
#endif /* CONFIG_ARCH_INTERRUPTSTACK > 7 */
|
#endif /* CONFIG_ARCH_INTERRUPTSTACK > 7 */
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -88,7 +88,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -224,9 +224,9 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
istackbase = (uint32_t)arm_intstack_base();
|
istackbase = (uint32_t)arm_intstack_alloc();
|
||||||
#else
|
#else
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
#endif
|
#endif
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
||||||
|
|
||||||
@@ -244,16 +244,16 @@ static void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
ldr \tmp1, =g_intstackalloc
|
ldr \tmp1, =g_intstackalloc
|
||||||
msr msplim, \tmp1
|
msr msplim, \tmp1
|
||||||
#endif
|
#endif
|
||||||
ldr sp, =g_intstackbase
|
ldr sp, =g_intstacktop
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ exception_common:
|
|||||||
.size exception_common, .-exception_common
|
.size exception_common, .-exception_common
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Shouldn't happen
|
* Shouldn't happen
|
||||||
@@ -357,11 +357,11 @@ exception_common:
|
|||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.bss
|
.bss
|
||||||
.global g_intstackalloc
|
.global g_intstackalloc
|
||||||
.global g_intstackbase
|
.global g_intstacktop
|
||||||
.balign 8
|
.balign 8
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackalloc, .-g_intstackalloc
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
ldr \tmp1, =g_intstackalloc
|
ldr \tmp1, =g_intstackalloc
|
||||||
msr msplim, \tmp1
|
msr msplim, \tmp1
|
||||||
#endif
|
#endif
|
||||||
ldr sp, =g_intstackbase
|
ldr sp, =g_intstacktop
|
||||||
.endm
|
.endm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -362,7 +362,7 @@ exception_common:
|
|||||||
.size exception_common, .-exception_common
|
.size exception_common, .-exception_common
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Shouldn't happen
|
* Shouldn't happen
|
||||||
@@ -372,11 +372,11 @@ exception_common:
|
|||||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
.bss
|
.bss
|
||||||
.global g_intstackalloc
|
.global g_intstackalloc
|
||||||
.global g_intstackbase
|
.global g_intstacktop
|
||||||
.balign 8
|
.balign 8
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackalloc, .-g_intstackalloc
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ arm_vectorirq:
|
|||||||
mov r1, sp /* Get r1=xcp */
|
mov r1, sp /* Get r1=xcp */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
ldr sp, .Lirqstackbase /* SP = interrupt stack base */
|
ldr sp, .Lirqstacktop /* SP = interrupt stack top */
|
||||||
str r1, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
str r1, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */
|
||||||
bl arm_doirq /* Call the handler */
|
bl arm_doirq /* Call the handler */
|
||||||
ldr sp, [sp] /* Restore the user stack pointer */
|
ldr sp, [sp] /* Restore the user stack pointer */
|
||||||
@@ -162,8 +162,8 @@ arm_vectorirq:
|
|||||||
.Lirqtmp:
|
.Lirqtmp:
|
||||||
.word g_irqtmp
|
.word g_irqtmp
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.Lirqstackbase:
|
.Lirqstacktop:
|
||||||
.word g_intstackbase
|
.word g_intstacktop
|
||||||
#endif
|
#endif
|
||||||
.align 5
|
.align 5
|
||||||
|
|
||||||
@@ -446,7 +446,7 @@ arm_vectoraddrexcptn:
|
|||||||
b arm_vectoraddrexcptn
|
b arm_vectoraddrexcptn
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Shouldn't happen
|
* Shouldn't happen
|
||||||
@@ -457,13 +457,13 @@ arm_vectoraddrexcptn:
|
|||||||
.bss
|
.bss
|
||||||
.balign 4
|
.balign 4
|
||||||
.global g_intstackalloc
|
.global g_intstackalloc
|
||||||
.global g_intstackbase
|
.global g_intstacktop
|
||||||
.type g_intstackalloc, object
|
.type g_intstackalloc, object
|
||||||
.type g_intstackbase, object
|
.type g_intstacktop, object
|
||||||
g_intstackalloc:
|
g_intstackalloc:
|
||||||
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
g_intstackbase:
|
g_intstacktop:
|
||||||
.size g_intstackbase, 0
|
.size g_intstacktop, 0
|
||||||
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.size g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
#endif
|
#endif
|
||||||
.end
|
.end
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ EXTERN const uintptr_t g_idle_topstack;
|
|||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
|
EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
|
||||||
EXTERN uint32_t g_intstackbase; /* Initial top of interrupt stack */
|
EXTERN uint32_t g_intstacktop; /* Initial top of interrupt stack */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These 'addresses' of these values are setup by the linker script. They
|
/* These 'addresses' of these values are setup by the linker script. They
|
||||||
|
|||||||
@@ -629,16 +629,16 @@ int up_prioritize_irq(int irq, int priority)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: arm_intstack_base
|
* Name: arm_intstack_top
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return a pointer to the "base" the correct interrupt stack allocation
|
* Return a pointer to the top the correct interrupt stack allocation
|
||||||
* for the current CPU. NOTE: Here, the base means "top" of the stack
|
* for the current CPU.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
uintptr_t arm_intstack_base(void)
|
uintptr_t arm_intstack_top(void)
|
||||||
{
|
{
|
||||||
return g_cpu_intstack_top[up_cpu_index()];
|
return g_cpu_intstack_top[up_cpu_index()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ extern "C"
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
EXTERN uintptr_t arm_intstack_base(void);
|
|
||||||
EXTERN uintptr_t arm_intstack_alloc(void);
|
EXTERN uintptr_t arm_intstack_alloc(void);
|
||||||
|
EXTERN uintptr_t arm_intstack_top(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|||||||
@@ -173,16 +173,16 @@ void up_irqinitialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: arm_intstack_base
|
* Name: arm_intstack_top
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return a pointer to the "base" the correct interrupt stack allocation
|
* Return a pointer to the top the correct interrupt stack allocation
|
||||||
* for the current CPU. NOTE: Here, the base means "top" of the stack
|
* for the current CPU.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
uintptr_t arm_intstack_base(void)
|
uintptr_t arm_intstack_top(void)
|
||||||
{
|
{
|
||||||
return g_irqstack_top[up_cpu_index()];
|
return g_irqstack_top[up_cpu_index()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ extern "C"
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
EXTERN uintptr_t arm_intstack_base(void);
|
|
||||||
EXTERN uintptr_t arm_intstack_alloc(void);
|
EXTERN uintptr_t arm_intstack_alloc(void);
|
||||||
|
EXTERN uintptr_t arm_intstack_top(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|||||||
@@ -861,16 +861,16 @@ int lc823450_irq_register(int irq, struct lc823450_irq_ops *ops)
|
|||||||
#endif /* CONFIG_LC823450_VIRQ */
|
#endif /* CONFIG_LC823450_VIRQ */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: arm_intstack_base
|
* Name: arm_intstack_top
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return a pointer to the "base" the correct interrupt stack allocation
|
* Return a pointer to the top the correct interrupt stack allocation
|
||||||
* for the current CPU. NOTE: Here, the base means "top" of the stack
|
* for the current CPU.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
uintptr_t arm_intstack_base(void)
|
uintptr_t arm_intstack_top(void)
|
||||||
{
|
{
|
||||||
return g_cpu_intstack_top[up_cpu_index()];
|
return g_cpu_intstack_top[up_cpu_index()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ extern "C"
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
EXTERN uintptr_t arm_intstack_base(void);
|
|
||||||
EXTERN uintptr_t arm_intstack_alloc(void);
|
EXTERN uintptr_t arm_intstack_alloc(void);
|
||||||
|
EXTERN uintptr_t arm_intstack_top(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|||||||
@@ -470,16 +470,16 @@ int up_prioritize_irq(int irq, int priority)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: arm_intstack_base
|
* Name: arm_intstack_top
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return a pointer to the "base" the correct interrupt stack allocation
|
* Return a pointer to the top the correct interrupt stack allocation
|
||||||
* for the current CPU. NOTE: Here, the base means "top" of the stack
|
* for the current CPU.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
uintptr_t arm_intstack_base(void)
|
uintptr_t arm_intstack_top(void)
|
||||||
{
|
{
|
||||||
return g_cpu_intstack_top[up_cpu_index()];
|
return g_cpu_intstack_top[up_cpu_index()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ extern "C"
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
#if defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
EXTERN uintptr_t arm_intstack_base(void);
|
|
||||||
EXTERN uintptr_t arm_intstack_alloc(void);
|
EXTERN uintptr_t arm_intstack_alloc(void);
|
||||||
|
EXTERN uintptr_t arm_intstack_top(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|||||||
@@ -145,17 +145,19 @@ excpt_common:
|
|||||||
reti
|
reti
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Name: up_interruptstack
|
* Name: g_intstackalloc
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.bss
|
.bss
|
||||||
.align 4
|
.align 4
|
||||||
.globl up_interruptstack
|
.globl g_intstackalloc
|
||||||
.type up_interruptstack, object
|
.type g_intstackalloc, object
|
||||||
up_interruptstack:
|
.globl g_intstacktop
|
||||||
|
.type g_intstacktop, object
|
||||||
|
g_intstackalloc:
|
||||||
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
.Lintstackbase:
|
g_intstacktop:
|
||||||
.size up_interruptstack, .-up_interruptstack
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
.end
|
.end
|
||||||
|
|||||||
@@ -234,17 +234,19 @@ excpt_common:
|
|||||||
reti
|
reti
|
||||||
|
|
||||||
/****************************************************************************************************
|
/****************************************************************************************************
|
||||||
* Name: up_interruptstack
|
* Name: g_intstackalloc
|
||||||
****************************************************************************************************/
|
****************************************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 0
|
#if CONFIG_ARCH_INTERRUPTSTACK > 0
|
||||||
.bss
|
.bss
|
||||||
.align 4
|
.align 4
|
||||||
.globl up_interruptstack
|
.globl g_intstackalloc
|
||||||
.type up_interruptstack, object
|
.type g_intstackalloc, object
|
||||||
up_interruptstack:
|
.globl g_intstacktop
|
||||||
|
.type g_intstacktop, object
|
||||||
|
g_intstackalloc:
|
||||||
.skip CONFIG_ARCH_INTERRUPTSTACK
|
.skip CONFIG_ARCH_INTERRUPTSTACK
|
||||||
.Lintstackbase:
|
g_intstacktop:
|
||||||
.size up_interruptstack, .-up_interruptstack
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
.end
|
.end
|
||||||
|
|||||||
@@ -47,7 +47,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.global g_intstackbase
|
.global g_intstackalloc
|
||||||
|
.global g_intstacktop
|
||||||
.global g_nestlevel
|
.global g_nestlevel
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -167,9 +167,8 @@ ssize_t up_check_stack_remain(void)
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
size_t up_check_intstack(void)
|
size_t up_check_intstack(void)
|
||||||
{
|
{
|
||||||
uintptr_t start = (uintptr_t)g_intstackbase -
|
uintptr_t start = (uintptr_t)g_intstackalloc;
|
||||||
(CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
return do_stackcheck(start, CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
return do_stackcheck(start, (CONFIG_ARCH_INTERRUPTSTACK & ~3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t up_check_intstack_remain(void)
|
size_t up_check_intstack_remain(void)
|
||||||
|
|||||||
@@ -47,11 +47,11 @@
|
|||||||
* Name: up_stackdump
|
* Name: up_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void up_stackdump(uint16_t sp, uint16_t stack_base)
|
static void up_stackdump(uint16_t sp, uint16_t stack_top)
|
||||||
{
|
{
|
||||||
uint16_t stack ;
|
uint16_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~3; stack < stack_base; stack += 12)
|
for (stack = sp & ~3; stack < stack_top; stack += 12)
|
||||||
{
|
{
|
||||||
uint8_t *ptr = (uint8_t *)stack;
|
uint8_t *ptr = (uint8_t *)stack;
|
||||||
_alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
|
_alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
|
||||||
@@ -145,7 +145,7 @@ void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 0
|
#if CONFIG_ARCH_INTERRUPTSTACK > 0
|
||||||
istackbase = (uint16_t)&g_intstackbase;
|
istackbase = (uint16_t)&g_intstackalloc;
|
||||||
istacksize = CONFIG_ARCH_INTERRUPTSTACK;
|
istacksize = CONFIG_ARCH_INTERRUPTSTACK;
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -162,16 +162,16 @@ void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -47,11 +47,11 @@
|
|||||||
* Name: up_stackdump
|
* Name: up_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -115,7 +115,7 @@ void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -132,16 +132,16 @@ void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ avr32_common:
|
|||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
mov r7, sp
|
mov r7, sp
|
||||||
lddpc sp, .Linstackbaseptr
|
lddpc sp, .Linstacktopptr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Call up_doirq with r12=IRQ number and r11=register save area */
|
/* Call up_doirq with r12=IRQ number and r11=register save area */
|
||||||
@@ -335,8 +335,8 @@ avr32_common:
|
|||||||
.word up_fullcontextrestore
|
.word up_fullcontextrestore
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.Linstackbaseptr:
|
.Linstacktopptr:
|
||||||
.word .Lintstackbase
|
.word g_intstacktop
|
||||||
#endif
|
#endif
|
||||||
.size vectortab, .-vectortab
|
.size vectortab, .-vectortab
|
||||||
|
|
||||||
@@ -347,11 +347,13 @@ avr32_common:
|
|||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.bss
|
.bss
|
||||||
.align 4
|
.align 4
|
||||||
.globl up_interruptstack
|
.globl g_intstackalloc
|
||||||
.type up_interruptstack, object
|
.type g_intstackalloc, object
|
||||||
up_interruptstack:
|
.globl g_intstacktop
|
||||||
|
.type g_intstacktop, object
|
||||||
|
g_intstackalloc:
|
||||||
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
.Lintstackbase:
|
g_intstacktop:
|
||||||
.size up_interruptstack, .-up_interruptstack
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
.end
|
.end
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void up_initial_state(struct tcb_s *tcb)
|
|||||||
xcp->regs[REG_LR] = 0;
|
xcp->regs[REG_LR] = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set the initial stack pointer to the "base" of the allocated stack */
|
/* Set the initial stack pointer to the top of the allocated stack */
|
||||||
|
|
||||||
xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr;
|
xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr;
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ typedef void (*up_vector_t)(void);
|
|||||||
/* Address of the saved user stack pointer */
|
/* Address of the saved user stack pointer */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
extern void g_intstackbase;
|
extern void g_intstackalloc;
|
||||||
|
extern void g_intstacktop;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These 'addresses' of these values are setup by the linker script. They
|
/* These 'addresses' of these values are setup by the linker script. They
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ extern uint16_t g_idle_topstack;
|
|||||||
/* Address of the saved user stack pointer */
|
/* Address of the saved user stack pointer */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 1
|
#if CONFIG_ARCH_INTERRUPTSTACK > 1
|
||||||
extern uint32_t g_intstackbase;
|
extern uint32_t g_intstackalloc;
|
||||||
|
extern uint32_t g_intstacktop;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ static uint8_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint16_t sp, uint16_t stack_base)
|
static void up_stackdump(uint16_t sp, uint16_t stack_top)
|
||||||
{
|
{
|
||||||
uint16_t stack;
|
uint16_t stack;
|
||||||
|
|
||||||
for (stack = sp; stack < stack_base; stack += 16)
|
for (stack = sp; stack < stack_top; stack += 16)
|
||||||
{
|
{
|
||||||
uint8_t *ptr = (uint8_t *)stack;
|
uint8_t *ptr = (uint8_t *)stack;
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint16_t)&g_intstackbase;
|
istackbase = (uint16_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -204,23 +204,23 @@ static void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
|
|
||||||
/* Extract the user stack pointer which should lie
|
/* Extract the user stack pointer which should lie
|
||||||
* at the base of the interrupt stack.
|
* at the base of the interrupt stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sp = g_intstackbase;
|
sp = g_intstacktop;
|
||||||
_alert("sp: %04x\n", sp);
|
_alert("sp: %04x\n", sp);
|
||||||
}
|
}
|
||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show user stack info */
|
/* Show user stack info */
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ up_fullcontextrestore:
|
|||||||
.comm .Lspsave, 2, 1
|
.comm .Lspsave, 2, 1
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: up_interruptstack/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_ARCH_INTERRUPTSTACK is defined, this sets aside memory for the
|
* If CONFIG_ARCH_INTERRUPTSTACK is defined, this sets aside memory for the
|
||||||
@@ -426,8 +426,8 @@ up_fullcontextrestore:
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 1
|
#if CONFIG_ARCH_INTERRUPTSTACK > 1
|
||||||
.comm .up_interruptstack:, CONFIG_ARCH_INTERRUPTSTACK, 1
|
.comm .g_intstackalloc:, CONFIG_ARCH_INTERRUPTSTACK, 1
|
||||||
up_interruptstack_base:
|
g_intstacktop:
|
||||||
.size up_interruptstack, .-up_interruptstack
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
#endif
|
#endif
|
||||||
.end
|
.end
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ extern uint32_t g_idle_topstack;
|
|||||||
/* Address of the saved user stack pointer */
|
/* Address of the saved user stack pointer */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
extern void g_intstackbase;
|
extern void g_intstackalloc;
|
||||||
|
extern void g_intstacktop;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These 'addresses' of these values are setup by the linker script. They are
|
/* These 'addresses' of these values are setup by the linker script. They are
|
||||||
|
|||||||
@@ -48,11 +48,11 @@
|
|||||||
* Name: up_stackdump
|
* Name: up_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08" PRIx32 ": %08" PRIx32 " %08" PRIx32
|
_alert("%08" PRIx32 ": %08" PRIx32 " %08" PRIx32
|
||||||
@@ -145,7 +145,7 @@ void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -159,23 +159,23 @@ void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
|
|
||||||
/* Extract the user stack pointer which should lie
|
/* Extract the user stack pointer which should lie
|
||||||
* at the base of the interrupt stack.
|
* at the base of the interrupt stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sp = g_intstackbase;
|
sp = g_intstacktop;
|
||||||
_alert("sp: %08" PRIx32 "\n", sp);
|
_alert("sp: %08" PRIx32 "\n", sp);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show user stack info */
|
/* Show user stack info */
|
||||||
|
|||||||
@@ -41,7 +41,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.global g_intstackbase
|
.global g_intstackalloc
|
||||||
|
.global g_intstacktop
|
||||||
#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
|
#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
|
||||||
.global g_nestlevel
|
.global g_nestlevel
|
||||||
#endif
|
#endif
|
||||||
@@ -391,7 +392,7 @@
|
|||||||
* interrupt stack first.
|
* interrupt stack first.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
la \tmp3, g_intstackbase
|
la \tmp3, g_intstacktop
|
||||||
lw \tmp4, (\tmp3)
|
lw \tmp4, (\tmp3)
|
||||||
sw sp, (\tmp4)
|
sw sp, (\tmp4)
|
||||||
move sp, \tmp4
|
move sp, \tmp4
|
||||||
|
|||||||
@@ -102,7 +102,8 @@
|
|||||||
.global halt
|
.global halt
|
||||||
.global devconfig
|
.global devconfig
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.global g_intstackbase
|
.global g_intstackalloc
|
||||||
|
.global g_intstacktop
|
||||||
#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
|
#ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS
|
||||||
.global g_nestlevel
|
.global g_nestlevel
|
||||||
#endif
|
#endif
|
||||||
@@ -661,15 +662,20 @@ devconfig0:
|
|||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
|
|
||||||
/* g_instackbase is a pointer to the final, aligned word of the interrupt
|
/* g_instacktop is a pointer to the final, aligned word of the interrupt
|
||||||
* stack.
|
* stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.sdata
|
.sdata
|
||||||
.type g_intstackbase, object
|
.type g_intstackalloc, object
|
||||||
g_intstackbase:
|
g_intstackalloc:
|
||||||
|
.long PIC32MX_INTSTACK_BASE
|
||||||
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
|
|
||||||
|
.type g_intstacktop, object
|
||||||
|
g_intstacktop:
|
||||||
.long PIC32MX_INTSTACK_TOP
|
.long PIC32MX_INTSTACK_TOP
|
||||||
.size g_intstackbase, .-g_intstackbase
|
.size g_intstacktop, .-g_intstacktop
|
||||||
|
|
||||||
/* g_nextlevel is the exception nesting level... the interrupt stack is not
|
/* g_nextlevel is the exception nesting level... the interrupt stack is not
|
||||||
* available to nested exceptions.
|
* available to nested exceptions.
|
||||||
|
|||||||
@@ -41,7 +41,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.global g_intstackbase
|
.global g_intstackalloc
|
||||||
|
.global g_intstacktop
|
||||||
#ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS
|
#ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS
|
||||||
.global g_nestlevel
|
.global g_nestlevel
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -167,7 +167,8 @@
|
|||||||
.global halt
|
.global halt
|
||||||
.global devcfg
|
.global devcfg
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
.global g_intstackbase
|
.global g_intstackalloc
|
||||||
|
.global g_intstacktop
|
||||||
#ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS
|
#ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS
|
||||||
.global g_nestlevel
|
.global g_nestlevel
|
||||||
#endif
|
#endif
|
||||||
@@ -918,15 +919,20 @@ adevcfg0:
|
|||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
|
|
||||||
/* g_instackbase is a pointer to the final, aligned word of the interrupt
|
/* g_instacktop is a pointer to the final, aligned word of the interrupt
|
||||||
* stack.
|
* stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.sdata
|
.sdata
|
||||||
.type g_intstackbase, object
|
.type g_intstackalloc, object
|
||||||
g_intstackbase:
|
g_intstackalloc:
|
||||||
|
.long PIC32MZ_INTSTACK_BASE
|
||||||
|
.size g_intstackalloc, .-g_intstackalloc
|
||||||
|
|
||||||
|
.type g_intstacktop, object
|
||||||
|
g_intstacktop:
|
||||||
.long PIC32MZ_INTSTACK_TOP
|
.long PIC32MZ_INTSTACK_TOP
|
||||||
.size g_intstackbase, .-g_intstackbase
|
.size g_intstacktop, .-g_intstacktop
|
||||||
|
|
||||||
/* g_nextlevel is the exception nesting level... the interrupt stack is not
|
/* g_nextlevel is the exception nesting level... the interrupt stack is not
|
||||||
* available to nested exceptions.
|
* available to nested exceptions.
|
||||||
|
|||||||
@@ -62,11 +62,11 @@
|
|||||||
* Name: up_stackdump
|
* Name: up_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -147,7 +147,7 @@ void lm32_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -161,23 +161,23 @@ void lm32_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
|
|
||||||
/* Extract the user stack pointer which should lie
|
/* Extract the user stack pointer which should lie
|
||||||
* at the base of the interrupt stack.
|
* at the base of the interrupt stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sp = g_intstackbase;
|
sp = g_intstacktop;
|
||||||
_alert("sp: %08x\n", sp);
|
_alert("sp: %08x\n", sp);
|
||||||
}
|
}
|
||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show user stack info */
|
/* Show user stack info */
|
||||||
|
|||||||
@@ -62,11 +62,11 @@
|
|||||||
* Name: up_stackdump
|
* Name: up_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack;
|
uint32_t stack;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *) stack;
|
uint32_t *ptr = (uint32_t *) stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -154,7 +154,7 @@ void minerva_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t) & g_intstackbase;
|
istackbase = (uint32_t) &g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -166,23 +166,23 @@ void minerva_dumpstate(void)
|
|||||||
|
|
||||||
/* Does the current stack pointer lie within the interrupt stack? */
|
/* Does the current stack pointer lie within the interrupt stack? */
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
|
|
||||||
/* Extract the user stack pointer which should lie at the base of the
|
/* Extract the user stack pointer which should lie at the base of the
|
||||||
* interrupt stack.
|
* interrupt stack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sp = g_intstackbase;
|
sp = g_intstacktop;
|
||||||
_alert("sp: %08x\n", sp);
|
_alert("sp: %08x\n", sp);
|
||||||
}
|
}
|
||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show user stack info */
|
/* Show user stack info */
|
||||||
|
|||||||
@@ -71,11 +71,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_STACKDUMP
|
#ifdef CONFIG_ARCH_STACKDUMP
|
||||||
static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
static void up_stackdump(uint32_t sp, uint32_t stack_top)
|
||||||
{
|
{
|
||||||
uint32_t stack ;
|
uint32_t stack ;
|
||||||
|
|
||||||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)stack;
|
uint32_t *ptr = (uint32_t *)stack;
|
||||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
@@ -84,7 +84,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define up_stackdump(sp,stack_base)
|
# define up_stackdump(sp,stack_top)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -215,7 +215,7 @@ static void up_dumpstate(void)
|
|||||||
/* Get the limits on the interrupt stack memory */
|
/* Get the limits on the interrupt stack memory */
|
||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
istackbase = (uint32_t)&g_intstackbase;
|
istackbase = (uint32_t)&g_intstackalloc;
|
||||||
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
|
||||||
/* Show interrupt stack info */
|
/* Show interrupt stack info */
|
||||||
@@ -232,16 +232,16 @@ static void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
up_stackdump(sp, istackbase);
|
up_stackdump(sp, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
else if (CURRENT_REGS)
|
else if (CURRENT_REGS)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
up_stackdump(istackbase - istacksize, istackbase);
|
up_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract the user stack pointer if we are in an interrupt handler.
|
/* Extract the user stack pointer if we are in an interrupt handler.
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ EXTERN const uint32_t g_idle_topstack;
|
|||||||
|
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
|
EXTERN uint32_t g_intstackalloc; /* Allocated stack base */
|
||||||
EXTERN uint32_t g_intstackbase; /* Initial top of interrupt stack */
|
EXTERN uint32_t g_intstacktop; /* Initial top of interrupt stack */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These 'addresses' of these values are setup by the linker script. They
|
/* These 'addresses' of these values are setup by the linker script. They
|
||||||
|
|||||||
@@ -257,7 +257,8 @@ extern uint32_t g_svarvect; /* Start of variable vectors */
|
|||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
# if CONFIG_ARCH_INTERRUPTSTACK > 3
|
# if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
extern uint16_t g_intstackbase;
|
extern uint16_t g_intstackalloc;
|
||||||
|
extern uint16_t g_intstacktop;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -63,11 +63,11 @@ static inline uint16_t m16c_getusersp(void)
|
|||||||
* Name: m16c_stackdump
|
* Name: m16c_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void m16c_stackdump(uint16_t sp, uint16_t stack_base)
|
static void m16c_stackdump(uint16_t sp, uint16_t stack_top)
|
||||||
{
|
{
|
||||||
uint16_t stack;
|
uint16_t stack;
|
||||||
|
|
||||||
for (stack = sp & ~7; stack < stack_base; stack += 8)
|
for (stack = sp & ~7; stack < stack_top; stack += 8)
|
||||||
{
|
{
|
||||||
uint8_t *ptr = (uint8_t *)stack;
|
uint8_t *ptr = (uint8_t *)stack;
|
||||||
_alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
_alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||||
@@ -165,11 +165,11 @@ void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
m16c_stackdump(sp, istackbase);
|
m16c_stackdump(sp, istackbase + istacksize);
|
||||||
|
|
||||||
/* Extract the user stack pointer from the register area */
|
/* Extract the user stack pointer from the register area */
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ void up_dumpstate(void)
|
|||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
m16c_stackdump(istackbase - istacksize, istackbase);
|
m16c_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show user stack info */
|
/* Show user stack info */
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ static inline uint16_t rx65n_getusersp(void)
|
|||||||
* Name: rx65n_stackdump
|
* Name: rx65n_stackdump
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void rx65n_stackdump(uint16_t sp, uint16_t stack_base)
|
static void rx65n_stackdump(uint16_t sp, uint16_t stack_top)
|
||||||
{
|
{
|
||||||
uint16_t stack;
|
uint16_t stack;
|
||||||
|
|
||||||
for (stack = sp & ~7; stack < stack_base; stack += 8) /* check */
|
for (stack = sp & ~7; stack < stack_top; stack += 8) /* check */
|
||||||
|
|
||||||
{
|
{
|
||||||
uint8_t *ptr = (uint8_t *)&stack;
|
uint8_t *ptr = (uint8_t *)&stack;
|
||||||
@@ -162,11 +162,11 @@ void up_dumpstate(void)
|
|||||||
* stack?
|
* stack?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (sp < istackbase && sp >= istackbase - istacksize)
|
if (sp >= istackbase && sp < istackbase + istacksize)
|
||||||
{
|
{
|
||||||
/* Yes.. dump the interrupt stack */
|
/* Yes.. dump the interrupt stack */
|
||||||
|
|
||||||
rx65n_stackdump(sp, istackbase);
|
rx65n_stackdump(sp, istackbase + istacksize);
|
||||||
|
|
||||||
/* Extract the user stack pointer from the register area */
|
/* Extract the user stack pointer from the register area */
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ void up_dumpstate(void)
|
|||||||
else if (g_current_regs)
|
else if (g_current_regs)
|
||||||
{
|
{
|
||||||
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
_alert("ERROR: Stack pointer is not within the interrupt stack\n");
|
||||||
rx65n_stackdump(istackbase - istacksize, istackbase);
|
rx65n_stackdump(istackbase, istackbase + istacksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show user stack info */
|
/* Show user stack info */
|
||||||
|
|||||||
@@ -774,7 +774,7 @@ _uprx65_groupal1_handler:
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: g_intstackalloc/g_intstackbase
|
* Name: g_intstackalloc/g_intstacktop
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Should not happen
|
* Should not happen
|
||||||
@@ -789,12 +789,12 @@ _uprx65_groupal1_handler:
|
|||||||
.align 2
|
.align 2
|
||||||
.global _g_intstackalloc
|
.global _g_intstackalloc
|
||||||
.type _g_intstackalloc, object
|
.type _g_intstackalloc, object
|
||||||
.global _g_intstackbase
|
.global _g_intstacktop
|
||||||
.type _g_intstackbase, object
|
.type _g_intstacktop, object
|
||||||
_g_intstackalloc:
|
_g_intstackalloc:
|
||||||
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.skip (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
_g_intstackbase:
|
_g_intstacktop:
|
||||||
.size _g_intstackbase, 0
|
.size _g_intstacktop, 0
|
||||||
.size _g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
.size _g_intstackalloc, (CONFIG_ARCH_INTERRUPTSTACK & ~3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user