aboutsummaryrefslogtreecommitdiff
path: root/src/mouse.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-03-13 22:29:55 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-03-13 22:29:55 -0500
commit4ed378a3c000dd3c4226e60a468cc1ea2210254e (patch)
tree3aba5ee2fadd93d9bb63cc996670a4527623011d /src/mouse.c
parent68c51390e3c78ed4a5b012d9097007f7cb0b8bbe (diff)
downloadseabios-hppa-4ed378a3c000dd3c4226e60a468cc1ea2210254e.zip
seabios-hppa-4ed378a3c000dd3c4226e60a468cc1ea2210254e.tar.gz
seabios-hppa-4ed378a3c000dd3c4226e60a468cc1ea2210254e.tar.bz2
Backup and restore registers when calling out to user funcs.
Make sure to fully backup and restore register state when calling out to other interrupts and functions. Some old DOS programs don't fully restore state. Also, make sure to enable irqs in call16_simpint().
Diffstat (limited to 'src/mouse.c')
-rw-r--r--src/mouse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mouse.c b/src/mouse.c
index 8389d2a..aba12ad 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -305,15 +305,17 @@ process_mouse(u8 data)
return;
}
- //BX_DEBUG_INT74("int74_function: make_farcall=1\n");
u16 status = GET_EBDA2(ebda_seg, mouse_data[0]);
u16 X = GET_EBDA2(ebda_seg, mouse_data[1]);
u16 Y = GET_EBDA2(ebda_seg, mouse_data[2]);
SET_EBDA2(ebda_seg, mouse_flag1, 0);
struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer);
+ dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n"
+ , status, X, Y, func.seg, func.offset);
asm volatile(
+ "pushl %%ebp\n"
"sti\n"
"pushl %0\n"
@@ -326,8 +328,8 @@ process_mouse(u8 data)
"cli\n"
"cld\n"
+ "popl %%ebp"
+ : "+a"(func.segoff), "+c"(status), "+d"(X), "+b"(Y)
:
- : "r"(func.segoff), "r"(status), "r"(X), "r"(Y)
- : "cc"
- );
+ : "edi", "esi", "cc", "memory");
}