summaryrefslogtreecommitdiff
path: root/kernel/drivers/mouse.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-05-05 16:51:59 +0200
committerAnton Kling <anton@kling.gg>2024-05-05 16:51:59 +0200
commit850596bd3374de20dd7b71bac27d351a975f772a (patch)
tree47ec2edf0fbce6a0f7c140a3358f908c053b35dc /kernel/drivers/mouse.c
parentc99d6608825c02783a58cddd930794cd0d35ab03 (diff)
Kernel: Clear more interrupts for mouse driver
I am not sure why the mouse requires interrupt line 2 to be cleared.
Diffstat (limited to 'kernel/drivers/mouse.c')
-rw-r--r--kernel/drivers/mouse.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/kernel/drivers/mouse.c b/kernel/drivers/mouse.c
index f9c3d0e..0eb6df6 100644
--- a/kernel/drivers/mouse.c
+++ b/kernel/drivers/mouse.c
@@ -41,19 +41,14 @@ void add_mouse(void) {
ringbuffer_init(mouse_inode->internal_object, 4096);
}
-void what(registers_t *r) {
- EOI(0xe);
-}
-
void int_mouse(reg_t *r) {
(void)r;
- EOI(12);
switch (mouse_cycle) {
case 0:
mouse_u8[0] = inb(0x60);
if (!(mouse_u8[0] & (1 << 3))) {
mouse_cycle = 0;
- return;
+ break;
}
mouse_cycle++;
break;
@@ -74,6 +69,7 @@ void int_mouse(reg_t *r) {
ringbuffer_write(rb, (u8 *)&e, sizeof(e));
break;
}
+ EOI(0xC);
}
void mouse_wait(u8 a_type) {
@@ -137,9 +133,6 @@ void install_mouse(void) {
mouse_read(); // Acknowledge
install_handler((interrupt_handler)int_mouse, INT_32_INTERRUPT_GATE(0x3),
- 12 + 0x20);
- install_handler((interrupt_handler)what, INT_32_INTERRUPT_GATE(0x3),
- 0xe + 0x20);
- install_handler((interrupt_handler)what, INT_32_INTERRUPT_GATE(0x3),
- 0xf + 0x20);
+ 0x2C);
+ irq_clear_mask(0x2);
}