Module Name: src
Committed By: martin
Date: Fri Sep 20 11:24:59 UTC 2024
Modified Files:
src/sys/dev/wscons [netbsd-10]: wsmouse.c
Log Message:
Pull up following revision(s) (requested by rin in ticket #892):
sys/dev/wscons/wsmouse.c: revision 1.73
wsmouse(4): Make wsmouse_input safe to call from MP-safe interrupts.
To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.72.4.1 src/sys/dev/wscons/wsmouse.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/wscons/wsmouse.c
diff -u src/sys/dev/wscons/wsmouse.c:1.72 src/sys/dev/wscons/wsmouse.c:1.72.4.1
--- src/sys/dev/wscons/wsmouse.c:1.72 Sun Jul 17 11:44:30 2022
+++ src/sys/dev/wscons/wsmouse.c Fri Sep 20 11:24:59 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $ */
+/* $NetBSD: wsmouse.c,v 1.72.4.1 2024/09/20 11:24:59 martin Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -104,7 +104,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.72 2022/07/17 11:44:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.72.4.1 2024/09/20 11:24:59 martin Exp $");
#include "wsmouse.h"
#include "wsdisplay.h"
@@ -372,17 +372,19 @@ wsmouse_input(device_t wsmousedev, u_int
/* one for each dimension (4) + a bit for each button */
struct wscons_event events[4 + sizeof(d) * 8];
+ KERNEL_LOCK(1, NULL);
+
/*
* Discard input if not open.
*/
evar = sc->sc_base.me_evp;
if (evar == NULL)
- return;
+ goto out;
#ifdef DIAGNOSTIC
if (evar->q == NULL) {
printf("wsmouse_input: evar->q=NULL\n");
- return;
+ goto out;
}
#endif
@@ -528,6 +530,8 @@ wsmouse_input(device_t wsmousedev, u_int
device_xname(sc->sc_base.me_dv), evar));
#endif
}
+
+out: KERNEL_UNLOCK_ONE(NULL);
}
void