diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-01-28 20:35:21 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-01-28 20:35:21 -0500 |
commit | 6f702dd6987b22e9bce472fe61910392af17416a (patch) | |
tree | 14004f76f72bb1a6983f2ee5ebea8a1a1c870f40 /src/mouse.c | |
parent | 2d3f0f5e4040a5b2dabc278bc5aa5bc3d9e71e1b (diff) | |
download | seabios-6f702dd6987b22e9bce472fe61910392af17416a.tar.gz |
Rework disabling of ps2 port irqs.
Disable the ps2 port irqs in software instead of hardware. This
prevents a race where an irq could get queued and later called when
not desired.
Diffstat (limited to 'src/mouse.c')
-rw-r--r-- | src/mouse.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mouse.c b/src/mouse.c index 52e225c3..888d32de 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -29,13 +29,8 @@ mouse_setup(void) #define RET_ENOHANDLER 0x05 static int -disable_mouse(u16 ebda_seg) +disable_mouse(void) { - 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); } @@ -43,8 +38,7 @@ disable_mouse(u16 ebda_seg) static void mouse_15c20000(struct bregs *regs) { - u16 ebda_seg = get_ebda_seg(); - int ret = disable_mouse(ebda_seg); + int ret = disable_mouse(); if (ret) set_code_invalid(regs, RET_ENEEDRESEND); else @@ -55,18 +49,12 @@ mouse_15c20000(struct bregs *regs) static void mouse_15c20001(struct bregs *regs) { - u16 ebda_seg = get_ebda_seg(); - u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2); + u8 mouse_flags_2 = GET_EBDA(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); @@ -241,7 +229,7 @@ mouse_15c207(struct bregs *regs) /* remove handler */ if ((mouse_flags_2 & 0x80) != 0) { mouse_flags_2 &= ~0x80; - disable_mouse(ebda_seg); + disable_mouse(); } } else { /* install handler */ |