aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/evdev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/evdev')
-rw-r--r--sys/dev/evdev/evdev_private.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/evdev/evdev_private.h b/sys/dev/evdev/evdev_private.h
index 05206a9d09bda..e1a5d1822cd8b 100644
--- a/sys/dev/evdev/evdev_private.h
+++ b/sys/dev/evdev/evdev_private.h
@@ -132,9 +132,14 @@ struct evdev_dev
LIST_HEAD(, evdev_client) ev_clients;
};
+#define SYSTEM_CONSOLE_LOCK &Giant
+
#define EVDEV_LOCK(evdev) mtx_lock((evdev)->ev_lock)
#define EVDEV_UNLOCK(evdev) mtx_unlock((evdev)->ev_lock)
-#define EVDEV_LOCK_ASSERT(evdev) mtx_assert((evdev)->ev_lock, MA_OWNED)
+#define EVDEV_LOCK_ASSERT(evdev) do { \
+ if ((evdev)->ev_lock != SYSTEM_CONSOLE_LOCK) \
+ mtx_assert((evdev)->ev_lock, MA_OWNED); \
+} while (0)
#define EVDEV_ENTER(evdev) do { \
if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \
EVDEV_LOCK(evdev); \