iPXE
efi_nap.c File Reference

iPXE CPU sleeping API for EFI More...

#include <ipxe/nap.h>
#include <ipxe/efi/efi.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static void efi_cpu_nap (void)
 Sleep until next interrupt.
 PROVIDE_NAP (efi, cpu_nap, efi_cpu_nap)

Detailed Description

iPXE CPU sleeping API for EFI

Definition in file efi_nap.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ efi_cpu_nap()

void efi_cpu_nap ( void )
static

Sleep until next interrupt.

Definition at line 40 of file efi_nap.c.

40 {
41 /*
42 * I can't find any EFI API that allows us to put the CPU to
43 * sleep. The CpuSleep() function is defined in CpuLib.h, but
44 * isn't part of any exposed protocol so we have no way to
45 * call it.
46 *
47 * The EFI shell doesn't seem to bother sleeping the CPU; it
48 * just sits there idly burning power.
49 *
50 * If a shutdown is in progess, there may be nothing to
51 * generate an interrupt since the timer is disabled in the
52 * first step of ExitBootServices().
53 */
55 cpu_halt();
56}
int efi_shutdown_in_progress
EFI shutdown is in progress.
Definition efi_init.c:60
void cpu_halt(void)
Sleep until next CPU interrupt.

References cpu_halt(), and efi_shutdown_in_progress.

Referenced by PROVIDE_NAP().

◆ PROVIDE_NAP()

PROVIDE_NAP ( efi ,
cpu_nap ,
efi_cpu_nap  )

References cpu_nap(), and efi_cpu_nap().