[SeaBIOS] [PATCH 2/2] Call cpu_relax() if yielding prior to interrupts being enabled

Kevin O'Connor kevin at koconnor.net
Thu Aug 13 14:16:31 CET 2015


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/stacks.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/stacks.c b/src/stacks.c
index 1cd0fde..192fb2a 100644
--- a/src/stacks.c
+++ b/src/stacks.c
@@ -661,9 +661,11 @@ fail:
 void VISIBLE16
 check_irqs(void)
 {
-    if (!MODESEGMENT && !CanInterrupt)
+    if (!MODESEGMENT && !CanInterrupt) {
         // Can't enable interrupts (PIC and/or IVT not yet setup)
+        cpu_relax();
         return;
+    }
     if (need_hop_back()) {
         extern void _cfunc16_check_irqs(void);
         stack_hop_back(0, 0, _cfunc16_check_irqs);
@@ -692,9 +694,11 @@ yield(void)
 void VISIBLE16
 wait_irq(void)
 {
-    if (!MODESEGMENT && !CanInterrupt)
+    if (!MODESEGMENT && !CanInterrupt) {
         // Can't enable interrupts (PIC and/or IVT not yet setup)
+        cpu_relax();
         return;
+    }
     if (need_hop_back()) {
         extern void _cfunc16_wait_irq(void);
         stack_hop_back(0, 0, _cfunc16_wait_irq);
-- 
1.9.3




More information about the SeaBIOS mailing list