aboutsummaryrefslogtreecommitdiff
path: root/src/mouse.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-03-13 18:51:46 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-03-13 18:51:46 -0500
commit6704cf9aa1f7e6bd7405044f222c23459d4b4d93 (patch)
tree49cc2d4267efdea92e112c2cd5eca1328900eeed /src/mouse.c
parent808939c17f603f3c7ad5abfb882cee55f636867b (diff)
downloadseabios-hppa-6704cf9aa1f7e6bd7405044f222c23459d4b4d93.zip
seabios-hppa-6704cf9aa1f7e6bd7405044f222c23459d4b4d93.tar.gz
seabios-hppa-6704cf9aa1f7e6bd7405044f222c23459d4b4d93.tar.bz2
Revert "Rework disabling of ps2 port irqs."
This reverts commit 6f702dd6987b22e9bce472fe61910392af17416a. That patch introduced a regression by enabling mouse interrupts by default. It also appears that disabling interrupts by software alone will not work well with some old DOS programs that hook the keyboard irq.
Diffstat (limited to 'src/mouse.c')
-rw-r--r--src/mouse.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/mouse.c b/src/mouse.c
index 3004d78..8389d2a 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -29,8 +29,13 @@ mouse_setup(void)
#define RET_ENOHANDLER 0x05
static int
-disable_mouse(void)
+disable_mouse(u16 ebda_seg)
{
+ u8 ps2ctr = GET_EBDA2(ebda_seg, ps2ctr);
+ ps2ctr |= I8042_CTR_AUXDIS;
+ ps2ctr &= ~I8042_CTR_AUXINT;
+ SET_EBDA2(ebda_seg, ps2ctr, ps2ctr);
+
return aux_command(PSMOUSE_CMD_DISABLE, NULL);
}
@@ -38,7 +43,8 @@ disable_mouse(void)
static void
mouse_15c20000(struct bregs *regs)
{
- int ret = disable_mouse();
+ u16 ebda_seg = get_ebda_seg();
+ int ret = disable_mouse(ebda_seg);
if (ret)
set_code_invalid(regs, RET_ENEEDRESEND);
else
@@ -49,12 +55,18 @@ mouse_15c20000(struct bregs *regs)
static void
mouse_15c20001(struct bregs *regs)
{
- u8 mouse_flags_2 = GET_EBDA(mouse_flag2);
+ u16 ebda_seg = get_ebda_seg();
+ u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2);
if ((mouse_flags_2 & 0x80) == 0) {
set_code_invalid(regs, RET_ENOHANDLER);
return;
}
+ u8 ps2ctr = GET_EBDA2(ebda_seg, ps2ctr);
+ ps2ctr &= ~I8042_CTR_AUXDIS;
+ ps2ctr |= I8042_CTR_AUXINT;
+ SET_EBDA2(ebda_seg, ps2ctr, ps2ctr);
+
int ret = aux_command(PSMOUSE_CMD_ENABLE, NULL);
if (ret)
set_code_invalid(regs, RET_ENEEDRESEND);
@@ -229,7 +241,7 @@ mouse_15c207(struct bregs *regs)
/* remove handler */
if ((mouse_flags_2 & 0x80) != 0) {
mouse_flags_2 &= ~0x80;
- disable_mouse();
+ disable_mouse(ebda_seg);
}
} else {
/* install handler */