arch: arm: aarch32: Add memory barriers to arch_cpu_idle
This commit adds the required memory barriers to the `arch_cpu_idle` function in order to ensure proper idle operation in all cases. 1. Add ISB after setting BASEPRI to ensure that the new wake-up interrupt priority is visible to the WFI instruction. 2. Add DSB before WFI to ensure that all memory transactions are completed before going to sleep. 3. Add ISB after CPSIE to ensure that the pending wake-up interrupt is serviced immediately. Co-authored-by:Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no> Signed-off-by:
Stephanos Ioannidis <root@stephanos.io>
Loading
Please sign in to comment