[syslinux:lwip] idle_thread: safer interrupt handling

syslinux-bot for H. Peter Anvin hpa at zytor.com
Fri Mar 30 14:54:05 PDT 2012


Commit-ID:  6b6d07cc4afdb8f1bf56f44f3fee6f02a590bb84
Gitweb:     http://www.syslinux.org/commit/6b6d07cc4afdb8f1bf56f44f3fee6f02a590bb84
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Tue, 27 Mar 2012 23:02:38 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Tue, 27 Mar 2012 23:02:38 -0700

idle_thread: safer interrupt handling

Make sure we use "sti ; hlt" to make sure we don't go to sleep when we
suddenly have an interrupt coming in.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>

---
 core/thread/idle_thread.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/thread/idle_thread.c b/core/thread/idle_thread.c
index a3a5be2..4555333 100644
--- a/core/thread/idle_thread.c
+++ b/core/thread/idle_thread.c
@@ -5,11 +5,11 @@
 static void idle_thread_func(void *dummy)
 {
     (void)dummy;
-    sti();
 
     for (;;) {
-	thread_yield();
-	asm volatile("hlt");
+	cli();
+	__schedule();
+	asm volatile("sti ; hlt" : : : "memory");
     }
 }
 


More information about the Syslinux-commits mailing list