iPXE
Functions
bios_nap.c File Reference
#include <ipxe/nap.h>
#include <realmode.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static void bios_cpu_nap (void)
 Save power by halting the CPU until the next interrupt. More...
 
 PROVIDE_NAP (pcbios, cpu_nap, bios_cpu_nap)
 

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ bios_cpu_nap()

static void bios_cpu_nap ( void  )
static

Save power by halting the CPU until the next interrupt.

Definition at line 10 of file bios_nap.c.

10  {
11  __asm__ __volatile__ ( "sti\n\t"
12  "hlt\n\t"
13  "cli\n\t" );
14 }
__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 ( pcbios  ,
cpu_nap  ,
bios_cpu_nap   
)