05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The System Level Programmers’ Model<br />

The WaitForEvent() pseudocode procedure optionally suspends execution until a WFE wake-up event or<br />

reset occurs, or until some earlier time if the implementation chooses. It is IMPLEMENTATION DEFINED<br />

whether restarting execution after the period of suspension causes a ClearEventRegister() to occur.<br />

The SendEvent() pseudocode procedure sets the Event Register of every processor in the multiprocessor<br />

system.<br />

B1.6.9 Wait For Interrupt<br />

Previous versions of the <strong>ARM</strong> architecture have included a Wait For Interrupt concept, <strong>and</strong> Wait For<br />

Interrupt is a required feature of the architecture from <strong>ARM</strong>v6. In <strong>ARM</strong>v7, Wait For Interrupt is supported<br />

only through an instruction, WFI, that is provided in the <strong>ARM</strong> <strong>and</strong> Thumb instruction sets. For more<br />

information, see WFI on page A8-810.<br />

Note<br />

In <strong>ARM</strong>v7 the CP15 c7 encoding previously used for WFI is redefined as a NOP, see CP15 c7, No<br />

Operation (NOP) on page B3-138 <strong>and</strong> CP15 c7, Miscellaneous functions on page B4-72.<br />

When a processor issues a WFI instruction it can suspend execution <strong>and</strong> enter a low-power state. It can remain<br />

in that state until the processor detects a reset or one of the following WFI wake-up events:<br />

an IRQ interrupt, regardless of the value of the CPSR.I bit<br />

an FIQ interrupt, regardless of the value of the CPSR.F bit<br />

an asynchronous abort, regardless of the value of the CPSR.A bit<br />

a debug event, when invasive debug is enabled <strong>and</strong> the debug event is permitted.<br />

When the hardware detects a WFI wake-up event, or earlier if the implementation chooses, the WFI<br />

instruction completes.<br />

WFI wake-up events cannot be masked by the mask bits in the CPSR.<br />

Note<br />

Because debug entry is one of the WFI wake-up events, <strong>ARM</strong> strongly recommends that Wait For<br />

Interrupt is used as part of an idle loop rather than waiting for a single specific interrupt event to occur<br />

<strong>and</strong> then moving forward. This ensures the intervention of debug while waiting does not significantly<br />

change the function of the program being debugged.<br />

In some previous implementations of Wait For Interrupt, the idle loop is followed by exit functions<br />

that must be executed before the interrupt is taken. The operation of Wait For Interrupt remains<br />

consistent with this model, <strong>and</strong> therefore differs from the operation of Wait For Event.<br />

Some implementations of Wait For Interrupt drain down any pending memory activity before<br />

suspending execution. This increases the power saving, by increasing the area over which clocks can<br />

be stopped. This operation is not required by the <strong>ARM</strong> architecture, <strong>and</strong> code must not rely on Wait<br />

For Interrupt operating in this way.<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. B1-47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!