diff options
author | marcel <marcel@FreeBSD.org> | 2003-09-17 01:41:21 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-09-17 01:41:21 +0000 |
commit | 96dbeb7199a05e6fb1bc00cdfcd8727467423d09 (patch) | |
tree | 976d5fcb92d42c5763ac054fcd83a3a3ba593d98 /sys/dev/uart/uart_if.m | |
parent | 25d51778fc93c3659f92b88183b9b4f4814bc3f4 (diff) | |
download | FreeBSD-src-96dbeb7199a05e6fb1bc00cdfcd8727467423d09.zip FreeBSD-src-96dbeb7199a05e6fb1bc00cdfcd8727467423d09.tar.gz |
Add locking to the hardware drivers. I intended to figure out more
precisely where locking would be needed before adding it, but it
seems uart(4) draws slightly too much attention to have it without
locking for too long.
The lock added is a spinlock that protects access to the underlying
hardware. As a first and obvious stab at this, each method of the
hardware interface grabs the lock. Roughly speaking this serializes
the methods. Exceptions are the probe, attach and detach methods.
Diffstat (limited to 'sys/dev/uart/uart_if.m')
-rw-r--r-- | sys/dev/uart/uart_if.m | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_if.m b/sys/dev/uart/uart_if.m index 772883d..762c16e 100644 --- a/sys/dev/uart/uart_if.m +++ b/sys/dev/uart/uart_if.m @@ -24,6 +24,9 @@ # # $FreeBSD$ +#include <sys/param.h> +#include <sys/lock.h> +#include <sys/mutex.h> #include <sys/bus.h> #include <machine/bus.h> #include <dev/uart/uart.h> |