summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2023-02-25 06:14:28 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-25 12:28:42 +0100
commit5842b6b72ae0242b792f0e28193309ea12909f34 (patch)
tree3929e3f6023d67e6b8108a711b70ea02873cddbb
parent54d7ab4fa3b1cab1e5c9cd8732b26e476bd2bc0d (diff)
kd_mouse: Fix IBM mouse irq getting stuck and blocking console
TESTED: With and without apic/smp Message-Id: <20230225061420.16985-1-damien@zamaudio.com>
-rw-r--r--i386/i386at/kd_mouse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index c870cf5a..9bd001cb 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -106,6 +106,7 @@ boolean_t mouse_char_cmd = FALSE; /* mouse response is to cmd */
boolean_t mouse_char_wanted = FALSE; /* want mouse response */
int mouse_char_index; /* mouse response */
+#define IBM_MOUSE_IRQ 12
/*
* init_mouse_hw - initialize the serial port.
@@ -183,7 +184,7 @@ mouseopen(dev_t dev, int flags, io_req_t ior)
break;
case IBM_MOUSE:
mousebufsize = 3;
- kd_mouse_open(dev, 12);
+ kd_mouse_open(dev, IBM_MOUSE_IRQ);
ibm_ps2_mouse_open(dev);
break;
case NO_MOUSE:
@@ -222,6 +223,7 @@ kd_mouse_open(
oldvect = ivect[mouse_pic];
ivect[mouse_pic] = kdintr;
+ unmask_irq(mouse_pic);
splx(s);
}
@@ -243,7 +245,7 @@ mouseclose(
break;
case IBM_MOUSE:
ibm_ps2_mouse_close(dev);
- kd_mouse_close(dev, 12);
+ kd_mouse_close(dev, IBM_MOUSE_IRQ);
{int i = 20000; for (;i--;); }
kd_mouse_drain();
break;
@@ -282,6 +284,7 @@ kd_mouse_close(
{
spl_t s = splhi();
+ mask_irq(mouse_pic);
ivect[mouse_pic] = oldvect;
splx(s);
}