diff options
| author | Michael Brown | 2008-10-13 00:34:45 +0200 |
|---|---|---|
| committer | Michael Brown | 2008-10-13 00:36:53 +0200 |
| commit | c0835339d06716b133aa653847023742a967f188 (patch) | |
| tree | 25f22e63175c7919c8de678f5a5f1513bed516c8 /src/arch/i386/interface | |
| parent | [monojob] Allow for extremely slow system timers (diff) | |
| download | ipxe-c0835339d06716b133aa653847023742a967f188.tar.gz ipxe-c0835339d06716b133aa653847023742a967f188.tar.xz ipxe-c0835339d06716b133aa653847023742a967f188.zip | |
[nap] Formalise the CPU sleeping API
Diffstat (limited to 'src/arch/i386/interface')
| -rw-r--r-- | src/arch/i386/interface/pcbios/bios_nap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/arch/i386/interface/pcbios/bios_nap.c b/src/arch/i386/interface/pcbios/bios_nap.c new file mode 100644 index 000000000..2f4a05131 --- /dev/null +++ b/src/arch/i386/interface/pcbios/bios_nap.c @@ -0,0 +1,14 @@ +#include <gpxe/nap.h> +#include <realmode.h> + +/** + * Save power by halting the CPU until the next interrupt + * + */ +static void bios_cpu_nap ( void ) { + __asm__ __volatile__ ( REAL_CODE ( "sti\n\t" + "hlt\n\t" + "cli\n\t" ) : : ); +} + +PROVIDE_NAP ( pcbios, cpu_nap, bios_cpu_nap ); |
