aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-01-19 19:56:07 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-01-19 19:56:07 -0500
commit273e8ae57159d69db504fabe70b0724de5297161 (patch)
treedd23a30d0584cebc9438426b6e9ba411b2623251 /src
parent8b267cb8a739576cd08c82d0ee75d6b14407c09c (diff)
downloadseabios-hppa-273e8ae57159d69db504fabe70b0724de5297161.zip
seabios-hppa-273e8ae57159d69db504fabe70b0724de5297161.tar.gz
seabios-hppa-273e8ae57159d69db504fabe70b0724de5297161.tar.bz2
Minor - call16 should not assume %cs==SEG_BIOS.
Should be slightly more compatible with protected mode accesses.
Diffstat (limited to 'src')
-rw-r--r--src/romlayout.S2
-rw-r--r--src/util.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/romlayout.S b/src/romlayout.S
index c31d9cc..efae759 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -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
diff --git a/src/util.c b/src/util.c
index 66b3343..ad918d7 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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);
}