diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-12-09 21:00:41 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-12-09 21:00:41 -0500 |
commit | 578774824896c2af1b38d6fc313e805a4f3493d1 (patch) | |
tree | 1daa092baad2c29019b2449b764e82be8639956b /src/mouse.c | |
parent | 980328091d8c9670f1fc0fd6a3c5330414192c2a (diff) | |
download | qemu-seabios-578774824896c2af1b38d6fc313e805a4f3493d1.tar.gz |
Move ps2 specific keyboard and mouse code to ps2port.c.
Diffstat (limited to 'src/mouse.c')
-rw-r--r-- | src/mouse.c | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/mouse.c b/src/mouse.c index 5a1b81f..ca581a8 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -14,12 +14,11 @@ void mouse_setup() { - if (! CONFIG_PS2_MOUSE) + if (! CONFIG_MOUSE) return; dprintf(3, "init mouse\n"); // pointing device installed SETBITS_BDA(equipment_list_flags, 0x04); - enable_hwirq(12, entry_74); } #define RET_SUCCESS 0x00 @@ -264,7 +263,7 @@ handle_15c2(struct bregs *regs) { //debug_stub(regs); - if (! CONFIG_PS2_MOUSE) { + if (! CONFIG_MOUSE) { set_code_fail(regs, RET_EUNSUPPORTED); return; } @@ -282,9 +281,12 @@ handle_15c2(struct bregs *regs) } } -static void +void process_mouse(u8 data) { + if (!CONFIG_MOUSE) + return; + u16 ebda_seg = get_ebda_seg(); u8 mouse_flags_1 = GET_EBDA2(ebda_seg, mouse_flag1); u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2); @@ -329,25 +331,3 @@ process_mouse(u8 data) : "cc" ); } - -// INT74h : PS/2 mouse hardware interrupt -void VISIBLE16 -handle_74() -{ - debug_isr(DEBUG_ISR_74); - if (! CONFIG_PS2_MOUSE) - goto done; - - u8 v = inb(PORT_PS2_STATUS); - if ((v & (I8042_STR_OBF|I8042_STR_AUXDATA)) - != (I8042_STR_OBF|I8042_STR_AUXDATA)) { - dprintf(1, "mouse irq but no mouse data.\n"); - goto done; - } - v = inb(PORT_PS2_DATA); - - process_mouse(v); - -done: - eoi_pic2(); -} |