diff options
author | hpa <hpa> | 2005-08-19 03:05:33 +0000 |
---|---|---|
committer | hpa <hpa> | 2005-08-19 03:05:33 +0000 |
commit | 05bd717cda9192f2cac135ff3463a772a7a1c82d (patch) | |
tree | 9e3444b2a6e4fb4d2203d7c1d8601b2c08dcc37b | |
parent | 77dc7e191aec9776049eba17100cbb555ba3d318 (diff) | |
download | syslinux-05bd717cda9192f2cac135ff3463a772a7a1c82d.tar.gz |
Improve the idle behaviour slightly.
-rw-r--r-- | com32/lib/sys/idle.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/com32/lib/sys/idle.c b/com32/lib/sys/idle.c index f2794b04..df8cc4af 100644 --- a/com32/lib/sys/idle.c +++ b/com32/lib/sys/idle.c @@ -35,15 +35,25 @@ #include <syslinux.h> #include <stddef.h> #include <com32.h> +#include <sys/cpu.h> void syslinux_idle(void) { - static com32sys_t sys_idle = { + static int do_idle = 1; + static const com32sys_t sys_idle = { .eax.l = 0x0013, }; + com32sys_t idle_result; /* This call isn't supported on SYSLINUX < 3.08, but all it does is return an error, so we don't care. */ + + if ( do_idle ) { + __intcall(0x22, &sys_idle, &idle_result); - __intcall(0x22, &sys_idle, NULL); + if ( idle_result.eflags.l & EFLAGS_CF ) + do_idle = 0; + } + + cpu_relax(); } |