]> xenbits.xensource.com Git - seabios.git/commitdiff
Minor - call16 should not assume %cs==SEG_BIOS.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 20 Jan 2009 00:56:07 +0000 (19:56 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 20 Jan 2009 00:56:07 +0000 (19:56 -0500)
Should be slightly more compatible with protected mode accesses.

src/romlayout.S
src/util.c

index c31d9ccc341b8154a363ef2f9fef43056b4faccd..efae759ac511b90e18be18a3c3bb28d5508402f2 100644 (file)
@@ -285,7 +285,7 @@ __call16:
         pushl %eax
 
         // Setup for iretw call
-        pushw $SEG_BIOS
+        pushw %cs
         pushw $1f               // return point
         pushw BREGS_flags(%eax) // flags
         pushl BREGS_ip(%eax)    // CS:IP
index 66b3343c9462ee79a44acb7c0449d3a466cc0aad..ad918d738bd7d55607838e171e3e442407ca40a9 100644 (file)
@@ -4,9 +4,8 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "util.h" // usleep
+#include "util.h" // call16
 #include "bregs.h" // struct bregs
-#include "config.h" // SEG_BIOS
 #include "farptr.h" // GET_FLATPTR
 #include "biosvar.h" // get_ebda_seg
 
@@ -43,7 +42,10 @@ call16big(struct bregs *callregs)
 inline void
 __call16_int(struct bregs *callregs, u16 offset)
 {
-    callregs->cs = SEG_BIOS;
+    if (MODE16)
+        callregs->cs = GET_SEG(CS);
+    else
+        callregs->cs = SEG_BIOS;
     callregs->ip = offset;
     call16(callregs);
 }