c85ad12468
Define a cpu_halt() function which is architecture-specific but platform-independent, and merge the multiple architecture-specific implementations of the EFI cpu_nap() function into a single central efi_cpu_nap() that uses cpu_halt() if applicable. Signed-off-by: Michael Brown <mcb30@ipxe.org>
21 lines
331 B
C
21 lines
331 B
C
#ifndef _BITS_NAP_H
|
|
#define _BITS_NAP_H
|
|
|
|
/** @file
|
|
*
|
|
* ARM-specific CPU sleeping API implementations
|
|
*
|
|
*/
|
|
|
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|
|
|
/**
|
|
* Sleep until next CPU interrupt
|
|
*
|
|
*/
|
|
static inline __attribute__ (( always_inline )) void cpu_halt ( void ) {
|
|
__asm__ __volatile__ ( "wfi" );
|
|
}
|
|
|
|
#endif /* _BITS_NAP_H */
|