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:
parent
8d0e902d38
commit
e26ed32cd6
@ -58,10 +58,7 @@ static inline __attribute__((always_inline)) unsigned irq_disable(void)
|
|||||||
|
|
||||||
static inline __attribute__((always_inline)) void irq_restore(unsigned oldCPSR)
|
static inline __attribute__((always_inline)) void irq_restore(unsigned oldCPSR)
|
||||||
{
|
{
|
||||||
unsigned _cpsr;
|
__set_cpsr(oldCPSR);
|
||||||
|
|
||||||
_cpsr = __get_cpsr();
|
|
||||||
__set_cpsr((_cpsr & ~IRQ_MASK) | (oldCPSR & IRQ_MASK));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline __attribute__((always_inline)) unsigned irq_enable(void)
|
static inline __attribute__((always_inline)) unsigned irq_enable(void)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user