From 075758389217cc8a440441115842f4c1cad53f2e Mon Sep 17 00:00:00 2001 From: Wayne Ren Date: Fri, 9 Aug 2019 10:00:42 +0800 Subject: [PATCH] arch: arc: the caculation of exception stack is wrong after appling the new "_get_curr_cpu_irq_stack" in _exc_entry, the caculation of exception stack is wrong, this will cause stack overflow, make the exception handling corrupt. Signed-off-by: Wayne Ren --- arch/arc/core/fault_s.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arc/core/fault_s.S b/arch/arc/core/fault_s.S index 176195a273b..4339fa38178 100644 --- a/arch/arc/core/fault_s.S +++ b/arch/arc/core/fault_s.S @@ -65,9 +65,9 @@ _exc_entry: * and exception is raised, then here it's guaranteed that * exception handling has necessary stack to use */ - mov_s ilink, sp + mov ilink, sp _get_curr_cpu_irq_stack sp - add sp, sp, EXCEPTION_STACK_SIZE + sub sp, sp, (CONFIG_ISR_STACK_SIZE - EXCEPTION_STACK_SIZE) /* * save caller saved registers