From: hpa Date: Fri, 19 Aug 2005 03:05:33 +0000 (+0000) Subject: Improve the idle behaviour slightly. X-Git-Tag: syslinux-3.11~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05bd717cda9192f2cac135ff3463a772a7a1c82d;p=platform%2Fupstream%2Fsyslinux.git Improve the idle behaviour slightly. --- diff --git a/com32/lib/sys/idle.c b/com32/lib/sys/idle.c index f2794b0..df8cc4a 100644 --- a/com32/lib/sys/idle.c +++ b/com32/lib/sys/idle.c @@ -35,15 +35,25 @@ #include #include #include +#include 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(); }