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  */
50  __asm__ __volatile__ ( "hlt" );
51 }
__asm__ __volatile__("\n1:\n\t" "movb -1(%2,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %3, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c) :"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")

References __asm__(), and __volatile__().

◆ PROVIDE_NAP()

PROVIDE_NAP ( efix86  ,
cpu_nap  ,
efix86_cpu_nap   
)