summaryrefslogtreecommitdiff
path: root/gpxe/src/arch/i386/core/nap.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/arch/i386/core/nap.c')
-rw-r--r--gpxe/src/arch/i386/core/nap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gpxe/src/arch/i386/core/nap.c b/gpxe/src/arch/i386/core/nap.c
new file mode 100644
index 00000000..12bb5699
--- /dev/null
+++ b/gpxe/src/arch/i386/core/nap.c
@@ -0,0 +1,12 @@
+
+#include <realmode.h>
+#include <bios.h>
+
+/**************************************************************************
+ * Save power by halting the CPU until the next interrupt
+ **************************************************************************/
+void cpu_nap ( void ) {
+ __asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
+ "hlt\n\t"
+ "cli\n\t" ) : : );
+}