soc: nordic: vpr: finish pending transactions before calling `wfi`
To minimize time the CPU spends when preparing for sleep, make sure the pending transactions are finished before calling `wfi`. Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
This commit is contained in:
parent
04a74ce107
commit
1de13cc96a
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
#include <zephyr/irq.h>
|
||||
#include <zephyr/sys/barrier.h>
|
||||
#include <zephyr/tracing/tracing.h>
|
||||
|
||||
/*
|
||||
|
@ -13,6 +14,7 @@
|
|||
void arch_cpu_idle(void)
|
||||
{
|
||||
sys_trace_idle();
|
||||
barrier_dsync_fence_full();
|
||||
irq_unlock(MSTATUS_IEN);
|
||||
__asm__ volatile("wfi");
|
||||
}
|
||||
|
@ -20,6 +22,7 @@ void arch_cpu_idle(void)
|
|||
void arch_cpu_atomic_idle(unsigned int key)
|
||||
{
|
||||
sys_trace_idle();
|
||||
barrier_dsync_fence_full();
|
||||
irq_unlock(MSTATUS_IEN);
|
||||
__asm__ volatile("wfi");
|
||||
|
||||
|
|
Loading…
Reference in New Issue