iPXE
Functions
efix86_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)
 
static void efix86_cpu_nap (void)
 Sleep until next interrupt. More...
 
 PROVIDE_NAP (efix86, cpu_nap, efix86_cpu_nap)
 

Detailed Description

iPXE CPU sleeping API for EFI

Definition in file efix86_nap.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ efix86_cpu_nap()

static void efix86_cpu_nap ( void  )
static

Sleep until next interrupt.

Definition at line 39 of file efix86_nap.c.

39  {
40  /*
41  * I can't find any EFI API that allows us to put the CPU to
42  * sleep. The CpuSleep() function is defined in CpuLib.h, but
43  * isn't part of any exposed protocol so we have no way to
44  * call it.
45  *
46  * The EFI shell doesn't seem to bother sleeping the CPU; it
47  * just sits there idly burning power.
48  *
49  * If a shutdown is in progess, there may be nothing to
50  * generate an interrupt since the timer is disabled in the
51  * first step of ExitBootServices().
52  */
54  __asm__ __volatile__ ( "hlt" );
55 }
__asm__ __volatile__("\n1:\n\t" "movb -1(%3,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c), "+m"(*value) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
int efi_shutdown_in_progress
EFI shutdown is in progress.
Definition: efi_init.c:58

References __asm__(), __volatile__(), and efi_shutdown_in_progress.

◆ PROVIDE_NAP()

PROVIDE_NAP ( efix86  ,
cpu_nap  ,
efix86_cpu_nap   
)