From 5a00e2e36c42fe456c447fad0ecb4b19eab6dde4 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 29 Jul 2020 12:00:30 +0200 Subject: [PATCH] cpu/msp430_common: use __stack for ISR stacks --- cpu/msp430_common/include/cpu.h | 8 ++------ cpu/msp430_common/irq.c | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cpu/msp430_common/include/cpu.h b/cpu/msp430_common/include/cpu.h index 6af17c0d1d..5b23da760f 100644 --- a/cpu/msp430_common/include/cpu.h +++ b/cpu/msp430_common/include/cpu.h @@ -49,11 +49,6 @@ extern "C" { */ extern volatile int __irq_is_in; -/** - * @brief Memory used as stack for the interrupt context - */ -extern char __isr_stack[ISR_STACKSIZE]; - /** * @brief Save the current thread context from inside an ISR */ @@ -102,8 +97,9 @@ static inline void __attribute__((always_inline)) __restore_context(void) */ static inline void __attribute__((always_inline)) __enter_isr(void) { + extern char __stack; /* defined by linker script to end of RAM */ __save_context(); - __asm__("mov.w %0,r1" : : "i"(__isr_stack + ISR_STACKSIZE)); + __asm__("mov.w %0,r1" : : "i"(&__stack)); __irq_is_in = 1; } diff --git a/cpu/msp430_common/irq.c b/cpu/msp430_common/irq.c index 86abfd7c48..f6bcc1ad66 100644 --- a/cpu/msp430_common/irq.c +++ b/cpu/msp430_common/irq.c @@ -23,5 +23,3 @@ #include "cpu.h" volatile int __irq_is_in = 0; - -char __isr_stack[ISR_STACKSIZE];