Saner idle call semantics
authorhpa <hpa>
Fri, 19 Aug 2005 03:08:45 +0000 (03:08 +0000)
committerhpa <hpa>
Fri, 19 Aug 2005 03:08:45 +0000 (03:08 +0000)
NEWS
com32/lib/sys/idle.c
comboot.doc
comboot.inc
pxelinux.asm

diff --git a/NEWS b/NEWS
index ba4ebbf..ddc61e9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,9 @@ Changes in 3.10:
        * Comments are now recognized even without a space following #.
        * Fix incorrect handling of mixes of entries with and without
          MENU PASSWD.
+       * The idle API call now harmlessly returns failure if it is a
+         no-op.  That way the caller can decide whether or not to
+         bother invoking it again.
 
 Changes in 3.09:
        * gcc4 compilation fix.
index df8cc4a..85e857f 100644 (file)
@@ -51,8 +51,7 @@ void syslinux_idle(void)
   if ( do_idle ) {
     __intcall(0x22, &sys_idle, &idle_result);
 
-    if ( idle_result.eflags.l & EFLAGS_CF )
-      do_idle = 0;
+    do_idle = ~idle_result.eflags.l & EFLAGS_CF;
   }
 
   cpu_relax();
index 8680b71..ec521ad 100644 (file)
@@ -586,10 +586,13 @@ AX=0013h [3.08] Idle loop call
        the moment, this is a no-op on all derivatives except
        PXELINUX, where it executes PXE calls to answer ARP queries.
 
-       Note: it's safe to call this API call on previous SYSLINUX
-       versions (2.00 or later); it will just harmlessly fail.  If
-       API call INT 22h, AX=0015h, bit 1 is set, there is no reason
-       (but safe) to call this routine.
+       Starting with version 3.10, this API call harmlessly returns
+       failure (CF=1) if invoked on a platform which does not need
+       idle calls.  Additionally, it's safe to call this API call on
+       previous SYSLINUX versions (2.00 or later); it will just
+       harmlessly fail.  Thus, if this call returns failure (CF=1),
+       it means that there is no technical reason to call this
+       function again, although doing so is of course safe.
 
 
 AX=0014h [3.10] Local boot [PXELINUX, ISOLINUX]
index a065192..90d9e4b 100644 (file)
@@ -647,11 +647,19 @@ comapi_shuffle:
 ;
 ; INT 22h AX=0013h     Idle call
 ;
+%ifdef HAVE_IDLE
+
 comapi_idle:
                DO_IDLE
                clc
                ret
 
+%else
+
+comapi_idle    equ comapi_err
+
+%endif
+
 ;
 ; INT 22h AX=0014h     Local boot
 ;
index 13bb79b..a83afd0 100644 (file)
@@ -60,6 +60,8 @@ SECTOR_SIZE   equ TFTP_BLOCKSIZE
 ;
 ; This is what we need to do when idle
 ;
+%define HAVE_IDLE 1                    ; idle is not a noop
+
 %macro RESET_IDLE 0
        call reset_idle
 %endmacro