aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-03-09 23:37:04 -0400
committerKevin O'Connor <kevin@koconnor.net>2008-03-09 23:37:04 -0400
commit2cdd8b6fb1aced4ec08c5e98705922c27285ddfb (patch)
tree3d9a613afe57457f3a945db23ad8913d45ff0c1d
parentf205f9fdb63f87eafd2328955385eb94e9824c26 (diff)
downloadseabios-2cdd8b6fb1aced4ec08c5e98705922c27285ddfb.tar.gz
Call to int 1587 shouldn't alter regs->cx.
The asm was setting regs->cx to zero - use a temp variable to avoid that.
-rw-r--r--src/system.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/system.c b/src/system.c
index 8c595fc1..7c871008 100644
--- a/src/system.c
+++ b/src/system.c
@@ -152,6 +152,7 @@ handle_1587(struct bregs *regs)
SET_VAR(ES, *(u8 *)(si+0x28+5), 0x93); // access
SET_VAR(ES, *(u16*)(si+0x28+6), 0x0000); // base 31:24/reserved/limit 19:16
+ u16 count = regs->cx;
asm volatile(
// Load new descriptor tables
"lgdtw %%es:0x8(%%si)\n"
@@ -192,7 +193,7 @@ handle_1587(struct bregs *regs)
// Restore %ds (from %ss)
"movw %%ss, %%ax\n"
"movw %%ax, %%ds\n"
- : "+c"(regs->cx), "+S"(si)
+ : "+c"(count), "+S"(si)
: : "eax", "di"); // XXX - also clobbers %es
set_a20(prev_a20_enable);