1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/arm7_common: simplify irq_restore()

We do not manipulate the CPSR register outside of irq_%, so we can just
restore it's previous value and don't have to fiddle with the IRQ MASK bit.

See https://www.keil.com/pack/doc/CMSIS/Core_A/html/group__CMSIS__CPSR.html
This commit is contained in:
Benjamin Valentin 2020-05-15 11:32:47 +02:00
parent 8d0e902d38
commit e26ed32cd6

View File

@ -58,10 +58,7 @@ static inline __attribute__((always_inline)) unsigned irq_disable(void)
static inline __attribute__((always_inline)) void irq_restore(unsigned oldCPSR)
{
unsigned _cpsr;
_cpsr = __get_cpsr();
__set_cpsr((_cpsr & ~IRQ_MASK) | (oldCPSR & IRQ_MASK));
__set_cpsr(oldCPSR);
}
static inline __attribute__((always_inline)) unsigned irq_enable(void)