Showing changes from revision #4 to #5:
Added | Removed | Changed
Entry | |
---|---|
- |
Exit | |
---|---|
- |
The purpose of this call is to put the CPU into a low-power idle state until an IRQ or FIQ interrupt is pending. It implements functionality equivalent to the ARMv7 ‘WFI’ instruction.
SWI Portable_ReadFeatures can be used to determine if this call is available.
It’s important to realise that Portable_Idle will function as intended even if IRQs/FIQs are disabled on entry. Therefore, to wait for a specific interrupt (or interrupt driven event), it’s recommended to use the following procedure:
Keeping IRQs disabled for steps 2 and 3 avoids a race condition where the event may fire after you’ve checked to see if it’s fired, but before the CPU is able to go to sleep. If IRQs were enabled and the race condition occurred then the CPU would go to sleep for no reason. At best this will reduce the responsiveness of your code, at worst it will deadlock the system (e.g. if there are no other regular IRQs)