wfe

Wait For Event (A32)

WFE

Enters low-power state until an event occurs.

Details

Suspends execution and transitions the processor to a low-power state until an event occurs (signaled by another processor's SEV instruction or an external event). The processor may exit the wait state before an event actually occurs due to implementation-specific reasons. No condition flags are affected. This is an A32-only hint instruction.

Pseudocode Operation

Wait for event; if event is signaled or implementation permits exit, resume execution

Example

WFE

Encoding

Binary Layout
cond
00110
0
10
00
00
1
1
1
1
000000000010
 
Format System Hint
Opcode 0x0320F002
Extension A32 (Base)

Operands

Reference (Arm AArch32 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x0320F002 WFE{<c>}{<q>} A32 cond | 00110 | 0 | 10 | 00 | 00 | 1 | 1 | 1 | 1 | 000000000010
0xBF20 WFE{<c>}{<q>} T32 10111111 | 0010 | 0000
0xF3AF8002 WFE{<c>}.W T32 111100111010 | 1 | 1 | 1 | 1 | 10 | 0 | 0 | 0 | 000 | 0000 | 0010

Description

Wait For Event is a hint instruction that indicates that the PE can enter a low-power state and remain there until a wakeup event occurs. Wakeup events include the event signaled as a result of executing the SEV instruction on any PE in the multiprocessor system. For more information, see Wait For Event and Send Event. As described in Wait For Event and Send Event, the execution of a WFE instruction that would otherwise cause entry to a low-power state can be trapped to a higher Exception level, see:

Operation

if ConditionPassed() then
    EncodingSpecificOperations();
    if IsEventRegisterSet() then
        ClearEventRegister();
    else
        if PSTATE.EL == EL0 then
            // Check for traps described by the OS.
            AArch32.CheckForWFxTrap(EL1, WFxType_WFE);
        if PSTATE.EL IN {EL0, EL1} && EL2Enabled() && !IsInHost() then
            // Check for traps described by the Hypervisor.
            AArch32.CheckForWFxTrap(EL2, WFxType_WFE);
        if HaveEL(EL3) && PSTATE.M != M32_Monitor then
            // Check for traps described by the Secure Monitor.
            AArch32.CheckForWFxTrap(EL3, WFxType_WFE);
        integer localtimeout = 1 << 64;  // No local timeout event is generated
        WaitForEvent(localtimeout);