[syslinux:elflink] core: we only need one reset_idle()

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Jul 2 07:00:05 PDT 2013


Commit-ID:  6bdbba2ff6d6e6235ba59e083eebaa6baa42350f
Gitweb:     http://www.syslinux.org/commit/6bdbba2ff6d6e6235ba59e083eebaa6baa42350f
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 2 Jul 2013 12:50:54 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 2 Jul 2013 13:03:14 +0100

core: we only need one reset_idle()

We don't need both an assembly version of reset_idle and an
implementation in C. Having these two functions has led to a bug where
we may idle with interrupts disabled because an 'sti' is only performed
in the assembly version. This lead to a hang waiting for user input.

Cc: H. Peter Anvin <hpa at zytor.com>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 core/idle.c       | 1 +
 core/idle.inc     | 8 --------
 core/pxelinux.asm | 3 ++-
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/core/idle.c b/core/idle.c
index a089b08..7f76a14 100644
--- a/core/idle.c
+++ b/core/idle.c
@@ -32,6 +32,7 @@ int (*idle_hook_func)(void);
 void reset_idle(void)
 {
     _IdleTimer = jiffies();
+    sti();	/* Guard against BIOS/PXE brokenness... */
 }
 
 __export void __idle(void)
diff --git a/core/idle.inc b/core/idle.inc
index 65d6c5c..c5ac7ef 100644
--- a/core/idle.inc
+++ b/core/idle.inc
@@ -14,14 +14,6 @@
 		section .text16
 TICKS_TO_IDLE	equ 4		; Also in idle.c
 
-reset_idle:
-		push eax
-		mov eax,[cs:__jiffies]
-		mov [cs:_IdleTimer],eax
-		pop eax
-		sti		; Guard against BIOS/PXE brokenness...
-		ret
-
 		global do_idle:function hidden
 do_idle:
 		push eax
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index 5c93d98..414078a 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -171,7 +171,8 @@ ROOT_FS_OPS:
 ;
 ; Initialize the idle mechanism
 ;
-		call reset_idle
+		extern reset_idle
+		pm_call reset_idle
 
 ;
 ; Now we're all set to start with our *real* business.


More information about the Syslinux-commits mailing list