arch: arm: cortex_m: cpu_idle: Add missing irq masking/unmasking
This was missed during conversion from ASM to C. Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
This commit is contained in:
parent
fb6ab560a5
commit
b621802614
1 changed files with 14 additions and 9 deletions
|
@ -76,7 +76,7 @@ void arch_cpu_idle(void)
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set wake-up interrupt priority to the lowest and synchronise to
|
* Set wake-up interrupt priority to the lowest and synchronize to
|
||||||
* ensure that this is visible to the WFI instruction.
|
* ensure that this is visible to the WFI instruction.
|
||||||
*/
|
*/
|
||||||
__set_BASEPRI(0);
|
__set_BASEPRI(0);
|
||||||
|
@ -91,10 +91,6 @@ void arch_cpu_idle(void)
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Wait for all memory transactions to complete before entering low
|
|
||||||
* power state.
|
|
||||||
*/
|
|
||||||
SLEEP_IF_ALLOWED(__WFI);
|
SLEEP_IF_ALLOWED(__WFI);
|
||||||
|
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
@ -122,11 +118,20 @@ void arch_cpu_atomic_idle(unsigned int key)
|
||||||
* and never touched again.
|
* and never touched again.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
|
||||||
* Wait for all memory transactions to complete before entering low
|
/* No BASEPRI, call wfe directly. (SEVONPEND is set in z_arm_cpu_idle_init()) */
|
||||||
* power state.
|
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
|
||||||
*/
|
/* unlock BASEPRI so wfe gets interrupted by incoming interrupts */
|
||||||
|
__set_BASEPRI(0);
|
||||||
|
__ISB();
|
||||||
|
#else
|
||||||
|
#error Unsupported architecture
|
||||||
|
#endif
|
||||||
|
|
||||||
SLEEP_IF_ALLOWED(__WFE);
|
SLEEP_IF_ALLOWED(__WFE);
|
||||||
|
|
||||||
arch_irq_unlock(key);
|
arch_irq_unlock(key);
|
||||||
|
#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
|
||||||
|
__enable_irq();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue