summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface
diff options
context:
space:
mode:
authorMichael Brown2008-10-13 00:34:45 +0200
committerMichael Brown2008-10-13 00:36:53 +0200
commitc0835339d06716b133aa653847023742a967f188 (patch)
tree25f22e63175c7919c8de678f5a5f1513bed516c8 /src/arch/i386/interface
parent[monojob] Allow for extremely slow system timers (diff)
downloadipxe-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.c14
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 );