diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-03-27 23:02:38 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-03-27 23:02:38 -0700 |
commit | 6b6d07cc4afdb8f1bf56f44f3fee6f02a590bb84 (patch) | |
tree | 570d1232f04408486a9662fee65910d32aa89142 | |
parent | c35c76ea485bf0c12812de252733e7b1c3deab1e (diff) | |
download | syslinux-6b6d07cc4afdb8f1bf56f44f3fee6f02a590bb84.tar.gz syslinux-6b6d07cc4afdb8f1bf56f44f3fee6f02a590bb84.tar.xz syslinux-6b6d07cc4afdb8f1bf56f44f3fee6f02a590bb84.zip |
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@zytor.com>
-rw-r--r-- | 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 a3a5be2a..4555333a 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"); } } |