summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_bus.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-09-17 01:41:21 +0000
committermarcel <marcel@FreeBSD.org>2003-09-17 01:41:21 +0000
commit96dbeb7199a05e6fb1bc00cdfcd8727467423d09 (patch)
tree976d5fcb92d42c5763ac054fcd83a3a3ba593d98 /sys/dev/uart/uart_bus.h
parent25d51778fc93c3659f92b88183b9b4f4814bc3f4 (diff)
downloadFreeBSD-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_bus.h')
-rw-r--r--sys/dev/uart/uart_bus.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h
index bd0bab7..dde9ff8 100644
--- a/sys/dev/uart/uart_bus.h
+++ b/sys/dev/uart/uart_bus.h
@@ -113,6 +113,8 @@ struct uart_softc {
struct uart_bas sc_bas;
device_t sc_dev;
+ struct mtx sc_hwmtx; /* Spinlock protecting hardware. */
+
struct resource *sc_rres; /* Register resource. */
int sc_rrid;
int sc_rtype; /* SYS_RES_{IOPORT|MEMORY}. */
OpenPOWER on IntegriCloud