From 1a8defd2095d33c818aefbfdfc8bcb70ff398823 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 15 Jul 2020 12:20:08 +0200 Subject: [PATCH] cpu/msp430_common: Refactor cpu.{c,h} Drop `__enable_irq()` and `__disable_irq()` and replace single remaining call of them with the standard IRQ API, as this is now equally fast. --- cpu/msp430_common/cpu.c | 2 +- cpu/msp430_common/include/cpu.h | 22 ---------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/cpu/msp430_common/cpu.c b/cpu/msp430_common/cpu.c index 9ac7a369bb..6bc2c710f2 100644 --- a/cpu/msp430_common/cpu.c +++ b/cpu/msp430_common/cpu.c @@ -21,7 +21,7 @@ __attribute__((naked)) void thread_yield_higher(void) { __asm__("push r2"); /* save SR */ - __disable_irq(); + irq_disable(); __save_context(); diff --git a/cpu/msp430_common/include/cpu.h b/cpu/msp430_common/include/cpu.h index 529c2183c2..871e0ae2a6 100644 --- a/cpu/msp430_common/include/cpu.h +++ b/cpu/msp430_common/include/cpu.h @@ -45,28 +45,6 @@ extern "C" { */ #define ISR(a,b) void __attribute__((naked, interrupt (a))) b(void) -/** - * @brief Globally disable IRQs - */ -static inline void __attribute__((always_inline)) __disable_irq(void) -{ - __asm__ __volatile__("bic %0, r2" : : "i"(GIE)); - /* this NOP is needed to handle a "delay slot" that all MSP430 MCUs - impose silently after messing with the GIE bit, DO NOT REMOVE IT! */ - __asm__ __volatile__("nop"); -} - -/** - * @brief Globally enable IRQs - */ -static inline void __attribute__((always_inline)) __enable_irq(void) -{ - __asm__ __volatile__("bis %0, r2" : : "i"(GIE)); - /* this NOP is needed to handle a "delay slot" that all MSP430 MCUs - impose silently after messing with the GIE bit, DO NOT REMOVE IT! */ - __asm__ __volatile__("nop"); -} - /** * @brief The current ISR state (inside or not) */