From 720136491afdbdb324f6ca88ddfb6ccd702b7b03 Mon Sep 17 00:00:00 2001
From: MohmadAyman <no.future2e1@gmail.com>
Date: Wed, 1 Jun 2016 19:37:40 +0200
Subject: [PATCH] cpu: unify naming of ISR stacksize macro

---
 boards/qemu-i386/include/cpu_conf.h  | 1 +
 cpu/atmega2560/include/cpu_conf.h    | 1 +
 cpu/lpc2387/include/cpu_conf.h       | 2 ++
 cpu/msp430-common/include/cpu.h      | 4 ++--
 cpu/msp430-common/include/cpu_conf.h | 2 +-
 cpu/msp430-common/irq.c              | 2 +-
 cpu/native/include/cpu_conf.h        | 4 ++--
 7 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/boards/qemu-i386/include/cpu_conf.h b/boards/qemu-i386/include/cpu_conf.h
index f2ec3a0e96..69959d5d70 100644
--- a/boards/qemu-i386/include/cpu_conf.h
+++ b/boards/qemu-i386/include/cpu_conf.h
@@ -30,6 +30,7 @@ extern "C" {
 #define THREAD_EXTRA_STACKSIZE_PRINTF            (8192)
 #define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT      (8192)
 #define THREAD_STACKSIZE_MINIMUM                 (8192)
+#define ISR_STACKSIZE                            (0)
 
 #ifdef __cplusplus
 }
diff --git a/cpu/atmega2560/include/cpu_conf.h b/cpu/atmega2560/include/cpu_conf.h
index 4ebd7ee854..4c32f88842 100644
--- a/cpu/atmega2560/include/cpu_conf.h
+++ b/cpu/atmega2560/include/cpu_conf.h
@@ -40,6 +40,7 @@ extern "C" {
 #endif
 
 #define THREAD_STACKSIZE_IDLE      (128)
+#define ISR_STACKSIZE              (0)
 /** @} */
 
 #ifdef __cplusplus
diff --git a/cpu/lpc2387/include/cpu_conf.h b/cpu/lpc2387/include/cpu_conf.h
index f5a831065a..b61f072d7f 100644
--- a/cpu/lpc2387/include/cpu_conf.h
+++ b/cpu/lpc2387/include/cpu_conf.h
@@ -51,6 +51,8 @@ extern "C" {
 #endif
 
 #define THREAD_STACKSIZE_IDLE      (160)
+
+#define ISR_STACKSIZE              (0)
 /** @} */
 
 /**
diff --git a/cpu/msp430-common/include/cpu.h b/cpu/msp430-common/include/cpu.h
index 105088e3d3..18b245af8c 100644
--- a/cpu/msp430-common/include/cpu.h
+++ b/cpu/msp430-common/include/cpu.h
@@ -75,7 +75,7 @@ extern volatile int __irq_is_in;
 /**
  * @brief   Memory used as stack for the interrupt context
  */
-extern char __isr_stack[MSP430_ISR_STACK_SIZE];
+extern char __isr_stack[ISR_STACKSIZE];
 
 /**
  * @brief   Save the current thread context from inside an ISR
@@ -126,7 +126,7 @@ static inline void __attribute__((always_inline)) __restore_context(void)
 static inline void __attribute__((always_inline)) __enter_isr(void)
 {
     __save_context();
-    __asm__("mov.w %0,r1" : : "i"(__isr_stack + MSP430_ISR_STACK_SIZE));
+    __asm__("mov.w %0,r1" : : "i"(__isr_stack + ISR_STACKSIZE));
     __irq_is_in = 1;
 }
 
diff --git a/cpu/msp430-common/include/cpu_conf.h b/cpu/msp430-common/include/cpu_conf.h
index 22771f10cc..0a2f9c1178 100644
--- a/cpu/msp430-common/include/cpu_conf.h
+++ b/cpu/msp430-common/include/cpu_conf.h
@@ -25,7 +25,7 @@ extern "C" {
 #endif
 
 #define THREAD_STACKSIZE_IDLE      (96)
-#define MSP430_ISR_STACK_SIZE           (256)
+#define ISR_STACKSIZE              (256)
 
 #ifndef GNRC_PKTBUF_SIZE
 #define GNRC_PKTBUF_SIZE                (2560)    /* TODO: Make this value
diff --git a/cpu/msp430-common/irq.c b/cpu/msp430-common/irq.c
index 75e2d13157..b251f74473 100644
--- a/cpu/msp430-common/irq.c
+++ b/cpu/msp430-common/irq.c
@@ -24,7 +24,7 @@
 
 volatile int __irq_is_in = 0;
 
-char __isr_stack[MSP430_ISR_STACK_SIZE];
+char __isr_stack[ISR_STACKSIZE];
 
 unsigned int irq_disable(void)
 {
diff --git a/cpu/native/include/cpu_conf.h b/cpu/native/include/cpu_conf.h
index 614ec47cb4..88c71d9c1e 100644
--- a/cpu/native/include/cpu_conf.h
+++ b/cpu/native/include/cpu_conf.h
@@ -36,7 +36,7 @@ extern "C" {
 #define THREAD_STACKSIZE_MINIMUM            (163840)
 /* native internal */
 #define THREAD_STACKSIZE_MINIMUM            (163840)
-#define NATIVE_ISR_STACKSIZE                (163840)
+#define ISR_STACKSIZE                       (163840)
 
 #else /* Linux etc. */
 #define THREAD_STACKSIZE_DEFAULT            (8192)
@@ -46,7 +46,7 @@ extern "C" {
 /* for core/include/thread.h */
 #define THREAD_STACKSIZE_MINIMUM            (8192)
 /* native internal */
-#define NATIVE_ISR_STACKSIZE                (8192)
+#define ISR_STACKSIZE                       (8192)
 #endif /* OS */
 /** @} */
 
-- 
GitLab