From 3a163803b7d99d70c97af12e783815f287b7f8df Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Thu, 27 Sep 2001 17:00:25 +0000 Subject: [PATCH] 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(). --- sys/dev/sio/sio.c | 4 ++++ sys/isa/sio.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 0234b80ba2af..a1c8495794a2 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 0234b80ba2af..a1c8495794a2 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); }