mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 16:01:38 +03:00
[efi] Centralise definition of efi_cpu_nap()
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>
This commit is contained in:
18
src/include/ipxe/efi/efi_nap.h
Normal file
18
src/include/ipxe/efi/efi_nap.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _IPXE_EFI_NAP_H
|
||||
#define _IPXE_EFI_NAP_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* CPU sleeping
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#ifdef NAP_EFI
|
||||
#define NAP_PREFIX_efi
|
||||
#else
|
||||
#define NAP_PREFIX_efi __efi_
|
||||
#endif
|
||||
|
||||
#endif /* _IPXE_EFI_NAP_H */
|
||||
@@ -43,6 +43,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
/* Include all architecture-independent I/O API headers */
|
||||
#include <ipxe/null_nap.h>
|
||||
#include <ipxe/efi/efi_nap.h>
|
||||
#include <ipxe/linux/linux_nap.h>
|
||||
|
||||
/* Include all architecture-dependent I/O API headers */
|
||||
@@ -52,6 +53,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
* Sleep until next CPU interrupt
|
||||
*
|
||||
*/
|
||||
void cpu_halt ( void );
|
||||
|
||||
/**
|
||||
* Sleep with interrupts enabled until next CPU interrupt
|
||||
*
|
||||
*/
|
||||
void cpu_nap ( void );
|
||||
|
||||
#endif /* _IPXE_NAP_H */
|
||||
|
||||
Reference in New Issue
Block a user