diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-09-27 17:00:25 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-09-27 17:00:25 +0000 |
commit | 9bbfbca6eef0284501a092fc334aada3a7725c8c (patch) | |
tree | 2e53c0df967253efb5747daf415cfd55296a2082 | |
parent | 0886aa51b6f6dcaa4d12a180a1a6a61bb37caeec (diff) | |
download | FreeBSD-src-9bbfbca6eef0284501a092fc334aada3a7725c8c.zip FreeBSD-src-9bbfbca6eef0284501a092fc334aada3a7725c8c.tar.gz |
Gate low level console output on mtx_lock_spin(&sio_lock), if the
sio_lock has been initialized. This prevents the low level console
output (kernel printf) from clobbering the sio settings if the system
happens to be in the middle of comstart().
-rw-r--r-- | sys/dev/sio/sio.c | 4 | ||||
-rw-r--r-- | sys/isa/sio.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 0234b80..a1c8495 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -3335,10 +3335,14 @@ siocnputc(dev, c) else iobase = siocniobase; s = spltty(); + if (sio_inited) + mtx_lock_spin(&sio_lock); siocnopen(&sp, iobase, comdefaultrate); siocntxwait(iobase); outb(iobase + com_data, c); siocnclose(&sp, iobase); + if (sio_inited) + mtx_unlock_spin(&sio_lock); splx(s); } diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 0234b80..a1c8495 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -3335,10 +3335,14 @@ siocnputc(dev, c) else iobase = siocniobase; s = spltty(); + if (sio_inited) + mtx_lock_spin(&sio_lock); siocnopen(&sp, iobase, comdefaultrate); siocntxwait(iobase); outb(iobase + com_data, c); siocnclose(&sp, iobase); + if (sio_inited) + mtx_unlock_spin(&sio_lock); splx(s); } |