diff --git a/arch/risc-v/src/bl602/bl602_head.S b/arch/risc-v/src/bl602/bl602_head.S index a1e870e36e..2439e13f3e 100644 --- a/arch/risc-v/src/bl602/bl602_head.S +++ b/arch/risc-v/src/bl602/bl602_head.S @@ -85,7 +85,7 @@ exception_common: mv a1, sp /* context = sp */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 /* Switch to interrupt stack */ lui sp, %hi(g_intstacktop) diff --git a/arch/risc-v/src/bl602/bl602_irq.c b/arch/risc-v/src/bl602/bl602_irq.c index 4686bd828b..5b08b01856 100644 --- a/arch/risc-v/src/bl602/bl602_irq.c +++ b/arch/risc-v/src/bl602/bl602_irq.c @@ -78,10 +78,10 @@ void up_irqinitialize(void) up_irq_save(); -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3 +#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 15 /* Colorize the interrupt stack for debug purposes */ - size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~15); riscv_stack_color((FAR void *)&g_intstackalloc, intstack_size); #endif diff --git a/arch/risc-v/src/c906/c906_head.S b/arch/risc-v/src/c906/c906_head.S index f183286b72..0bd0f6d83e 100644 --- a/arch/risc-v/src/c906/c906_head.S +++ b/arch/risc-v/src/c906/c906_head.S @@ -191,7 +191,7 @@ exception_common: mv a1, sp /* context = sp */ -#if CONFIG_ARCH_INTERRUPTSTACK > 7 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 /* Load mhartid (cpuid) */ csrr s0, mhartid @@ -203,7 +203,7 @@ exception_common: j 4f 3: la sp, g_intstacktop - addi sp, sp, -(CONFIG_ARCH_INTERRUPTSTACK & ~7) + addi sp, sp, -(CONFIG_ARCH_INTERRUPTSTACK & ~15) 4: #endif diff --git a/arch/risc-v/src/c906/c906_irq.c b/arch/risc-v/src/c906/c906_irq.c index eae7ca814c..4b0dff714b 100644 --- a/arch/risc-v/src/c906/c906_irq.c +++ b/arch/risc-v/src/c906/c906_irq.c @@ -72,8 +72,8 @@ void up_irqinitialize(void) /* Colorize the interrupt stack for debug purposes */ -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 7 - size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~7); +#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 15 + size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~15); riscv_stack_color((FAR void *)&g_intstackalloc, intstack_size); #endif diff --git a/arch/risc-v/src/common/riscv_checkstack.c b/arch/risc-v/src/common/riscv_checkstack.c index ca35375e3c..5429696cc5 100644 --- a/arch/risc-v/src/common/riscv_checkstack.c +++ b/arch/risc-v/src/common/riscv_checkstack.c @@ -176,16 +176,16 @@ ssize_t up_check_stack_remain(void) return up_check_tcbstack_remain(this_task()); } -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 size_t up_check_intstack(void) { return do_stackcheck((uintptr_t)&g_intstackalloc, - (CONFIG_ARCH_INTERRUPTSTACK & ~3)); + (CONFIG_ARCH_INTERRUPTSTACK & ~15)); } size_t up_check_intstack_remain(void) { - return (CONFIG_ARCH_INTERRUPTSTACK & ~3) - up_check_intstack(); + return (CONFIG_ARCH_INTERRUPTSTACK & ~15) - up_check_intstack(); } #endif diff --git a/arch/risc-v/src/common/riscv_initialize.c b/arch/risc-v/src/common/riscv_initialize.c index abbbe16990..bcf07ba26b 100644 --- a/arch/risc-v/src/common/riscv_initialize.c +++ b/arch/risc-v/src/common/riscv_initialize.c @@ -53,13 +53,13 @@ * ****************************************************************************/ -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3 +#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 15 static inline void up_color_intstack(void) { uint32_t *ptr = (uint32_t *)&g_intstackalloc; ssize_t size; - for (size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + for (size = (CONFIG_ARCH_INTERRUPTSTACK & ~15); size > 0; size -= sizeof(uint32_t)) { diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index 6c1e4a033d..80d89d1678 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -113,7 +113,7 @@ EXTERN uint32_t g_idle_topstack; /* Address of the saved user stack pointer */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 EXTERN uint32_t g_intstackalloc; /* Allocated stack base */ EXTERN uint32_t g_intstacktop; /* Initial top of interrupt stack */ #endif diff --git a/arch/risc-v/src/esp32c3/esp32c3_interrupt.S b/arch/risc-v/src/esp32c3/esp32c3_interrupt.S index 3b73c2c1a2..d0cf1ba2be 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_interrupt.S +++ b/arch/risc-v/src/esp32c3/esp32c3_interrupt.S @@ -115,7 +115,7 @@ _interrupt_handler: csrr a0, mcause /* Handler arg0: Exception cause */ mv a1, sp /* Handler arg1: Context (saved registers on stack) */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 lui sp, %hi(g_intstacktop) addi sp, sp, %lo(g_intstacktop) #endif diff --git a/arch/risc-v/src/fe310/fe310_head.S b/arch/risc-v/src/fe310/fe310_head.S index 642f338325..5cf81a30f1 100644 --- a/arch/risc-v/src/fe310/fe310_head.S +++ b/arch/risc-v/src/fe310/fe310_head.S @@ -139,7 +139,7 @@ exception_common: mv a1, sp /* context = sp */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 /* Switch to interrupt stack */ lui sp, %hi(g_intstacktop) diff --git a/arch/risc-v/src/fe310/fe310_irq.c b/arch/risc-v/src/fe310/fe310_irq.c index 7a49608146..9fb90a0106 100644 --- a/arch/risc-v/src/fe310/fe310_irq.c +++ b/arch/risc-v/src/fe310/fe310_irq.c @@ -59,8 +59,8 @@ void up_irqinitialize(void) /* Colorize the interrupt stack for debug purposes */ -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3 - size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); +#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 15 + size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~15); riscv_stack_color((FAR void *)&g_intstackalloc, intstack_size); #endif diff --git a/arch/risc-v/src/k210/k210_head.S b/arch/risc-v/src/k210/k210_head.S index f5bdc32ba9..852c53bcf0 100644 --- a/arch/risc-v/src/k210/k210_head.S +++ b/arch/risc-v/src/k210/k210_head.S @@ -170,7 +170,7 @@ normal_irq: mv a1, sp /* context = sp */ -#if CONFIG_ARCH_INTERRUPTSTACK > 7 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 /* Load mhartid (cpuid) */ csrr s0, mhartid @@ -182,7 +182,7 @@ normal_irq: j 4f 3: la sp, g_intstacktop - addi sp, sp, -(CONFIG_ARCH_INTERRUPTSTACK & ~7) + addi sp, sp, -(CONFIG_ARCH_INTERRUPTSTACK & ~15) 4: #endif diff --git a/arch/risc-v/src/k210/k210_irq.c b/arch/risc-v/src/k210/k210_irq.c index 4c0a484db7..293a5779e3 100644 --- a/arch/risc-v/src/k210/k210_irq.c +++ b/arch/risc-v/src/k210/k210_irq.c @@ -80,8 +80,8 @@ void up_irqinitialize(void) /* Colorize the interrupt stack for debug purposes */ -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 7 - size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~7); +#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 15 + size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~15); riscv_stack_color((FAR void *)&g_intstackalloc, intstack_size); #endif diff --git a/arch/risc-v/src/litex/litex_head.S b/arch/risc-v/src/litex/litex_head.S index c44e9895bf..e9a514e594 100644 --- a/arch/risc-v/src/litex/litex_head.S +++ b/arch/risc-v/src/litex/litex_head.S @@ -126,7 +126,7 @@ exception_common: mv a1, sp /* context = sp */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 /* Switch to interrupt stack */ lui sp, %hi(g_intstacktop) diff --git a/arch/risc-v/src/litex/litex_irq.c b/arch/risc-v/src/litex/litex_irq.c index 150783837a..55100dfdab 100644 --- a/arch/risc-v/src/litex/litex_irq.c +++ b/arch/risc-v/src/litex/litex_irq.c @@ -58,8 +58,8 @@ void up_irqinitialize(void) /* Colorize the interrupt stack for debug purposes */ -#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3 - size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3); +#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 15 + size_t intstack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~15); riscv_stack_color((FAR void *)&g_intstackalloc, intstack_size); #endif diff --git a/arch/risc-v/src/rv32im/riscv_assert.c b/arch/risc-v/src/rv32im/riscv_assert.c index a541082509..68b8f224e7 100644 --- a/arch/risc-v/src/rv32im/riscv_assert.c +++ b/arch/risc-v/src/rv32im/riscv_assert.c @@ -173,7 +173,7 @@ static void riscv_dumpstate(void) uint32_t sp = riscv_getsp(); uint32_t ustackbase; uint32_t ustacksize; -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 uint32_t istackbase; uint32_t istacksize; #endif @@ -189,9 +189,9 @@ static void riscv_dumpstate(void) /* Get the limits on the interrupt stack memory */ -#if CONFIG_ARCH_INTERRUPTSTACK > 3 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 istackbase = (uint32_t)&g_intstackalloc; - istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3); + istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~15); /* Show interrupt stack info */ diff --git a/arch/risc-v/src/rv64gc/riscv_assert.c b/arch/risc-v/src/rv64gc/riscv_assert.c index d7a9b801ed..6a99759a1d 100644 --- a/arch/risc-v/src/rv64gc/riscv_assert.c +++ b/arch/risc-v/src/rv64gc/riscv_assert.c @@ -184,7 +184,7 @@ static void up_dumpstate(void) uint64_t sp = riscv_getsp(); uintptr_t ustackbase; uintptr_t ustacksize; -#if CONFIG_ARCH_INTERRUPTSTACK > 7 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 uintptr_t istackbase; uintptr_t istacksize; #endif @@ -200,9 +200,9 @@ static void up_dumpstate(void) /* Get the limits on the interrupt stack memory */ -#if CONFIG_ARCH_INTERRUPTSTACK > 7 +#if CONFIG_ARCH_INTERRUPTSTACK > 15 istackbase = (uintptr_t)&g_intstackalloc; - istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~7); + istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~15); /* Show interrupt stack info */