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.
This commit is contained in:
Marian Buschsieweke 2020-07-15 12:20:08 +02:00
parent c5c83cfe3c
commit 1a8defd209
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
2 changed files with 1 additions and 23 deletions

View File

@ -21,7 +21,7 @@
__attribute__((naked)) void thread_yield_higher(void) __attribute__((naked)) void thread_yield_higher(void)
{ {
__asm__("push r2"); /* save SR */ __asm__("push r2"); /* save SR */
__disable_irq(); irq_disable();
__save_context(); __save_context();

View File

@ -45,28 +45,6 @@ extern "C" {
*/ */
#define ISR(a,b) void __attribute__((naked, interrupt (a))) b(void) #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) * @brief The current ISR state (inside or not)
*/ */