diff options
| author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2022-11-17 21:48:42 +0000 |
|---|---|---|
| committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2022-11-17 21:48:42 +0000 |
| commit | 4a0db5e2920c0e0df52d6888bdd732df95706dfc (patch) | |
| tree | a416b629ef3318f6589f39e05936868f4f60b7a6 /sys/dev/evdev | |
| parent | f556a05c49261af3d373c599d05fa250f3563b59 (diff) | |
Diffstat (limited to 'sys/dev/evdev')
| -rw-r--r-- | sys/dev/evdev/evdev.c | 11 | ||||
| -rw-r--r-- | sys/dev/evdev/evdev.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c index 2fd7c2e201ea..a0a039f0b691 100644 --- a/sys/dev/evdev/evdev.c +++ b/sys/dev/evdev/evdev.c @@ -1094,6 +1094,17 @@ evdev_release_client(struct evdev_dev *evdev, struct evdev_client *client) return (0); } +bool +evdev_is_grabbed(struct evdev_dev *evdev) +{ + /* + * The function is intended to be called from evdev-unrelated parts of + * code like syscons-compatible parts of mouse and keyboard drivers. + * That makes unlocked read-only access acceptable. + */ + return (evdev->ev_grabber != NULL); +} + static void evdev_repeat_callout(void *arg) { diff --git a/sys/dev/evdev/evdev.h b/sys/dev/evdev/evdev.h index 90bea09b70c9..892e6b1bc071 100644 --- a/sys/dev/evdev/evdev.h +++ b/sys/dev/evdev/evdev.h @@ -154,6 +154,7 @@ void evdev_set_repeat_params(struct evdev_dev *, uint16_t, int); int evdev_set_report_size(struct evdev_dev *, size_t); void evdev_set_flag(struct evdev_dev *, uint16_t); void *evdev_get_softc(struct evdev_dev *); +bool evdev_is_grabbed(struct evdev_dev *); /* Multitouch related functions: */ int evdev_mt_id_to_slot(struct evdev_dev *, int32_t); |
