1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/msp430_common/irq.c
Marian Buschsieweke c5c83cfe3c
cpu/msp430_common: Update to inline-able IRQ API
- Updated to inline-able IRQ API
- Improved robustness of functions
    - Added memory barrier to prevent the compiler from moving code outside of
      a critical section guarded by irq_disable() ... irq_restore()
- Reduced overhead of `irq_disable()`
    - After clearing the global interrupt enable (GIE) bit, IRQs remain enabled
      for up to one CPU cycle
    - The previous implementation just added a nop to fill that cycle
    - This implementation uses the cycle for masking the return value
- Reduced overhead of `irq_restore()`
    - Now only one CPU cycle is needed
- `irq_disable()`, `irq_restore()`, and `irq_enable()` work now in constant time
2020-06-25 21:32:17 +02:00

28 lines
545 B
C

/*
* Copyright (C) 2014 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_msp430_common
* @{
*
* @file
* @brief ISR related variables
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
*
* @}
*/
#include "irq.h"
#include "cpu.h"
volatile int __irq_is_in = 0;
char __isr_stack[ISR_STACKSIZE];