diff options
author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2017-11-01 22:15:19 +0000 |
---|---|---|
committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2017-11-01 22:15:19 +0000 |
commit | f7ee4f902906722add89629da9000c01856c8c91 (patch) | |
tree | a802cc5e5ef197d3f086c02a620ab69ad08501f7 | |
parent | 233e10741a791bfa570a69804ae40f9fffcdcd43 (diff) | |
download | src-test2-f7ee4f902906722add89629da9000c01856c8c91.tar.gz src-test2-f7ee4f902906722add89629da9000c01856c8c91.zip |
Notes
-rw-r--r-- | sys/dev/evdev/evdev_utils.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/evdev/evdev_utils.c b/sys/dev/evdev/evdev_utils.c index 5a93802e9b6a..f4f028b1f87b 100644 --- a/sys/dev/evdev/evdev_utils.c +++ b/sys/dev/evdev/evdev_utils.c @@ -32,7 +32,9 @@ #include <sys/conf.h> #include <sys/kbio.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <sys/malloc.h> +#include <sys/mutex.h> #include <sys/systm.h> #include <dev/evdev/evdev.h> @@ -314,19 +316,26 @@ evdev_ev_kbd_event(struct evdev_dev *evdev, void *softc, uint16_t type, leds |= 1 << i; else leds &= ~(1 << i); - if (leds != oleds) + if (leds != oleds) { + mtx_lock(&Giant); kbdd_ioctl(kbd, KDSETLED, (caddr_t)&leds); + mtx_unlock(&Giant); + } break; } } } else if (type == EV_REP && code == REP_DELAY) { delay[0] = value; delay[1] = kbd->kb_delay2; + mtx_lock(&Giant); kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); + mtx_unlock(&Giant); } else if (type == EV_REP && code == REP_PERIOD) { delay[0] = kbd->kb_delay1; delay[1] = value; + mtx_lock(&Giant); kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); + mtx_unlock(&Giant); } } |