diff options
author | bde <bde@FreeBSD.org> | 1998-06-03 12:30:10 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-06-03 12:30:10 +0000 |
commit | 0d80f93df9db14a735185153ebff93dbc76a5152 (patch) | |
tree | 4f9413672a5c7121a70dc69d0c0920822616a273 /sys | |
parent | cb304595fcff75035cd74d26b6c7b8c00c713786 (diff) | |
download | FreeBSD-src-0d80f93df9db14a735185153ebff93dbc76a5152.zip FreeBSD-src-0d80f93df9db14a735185153ebff93dbc76a5152.tar.gz |
Force success of the probe (after doing it as before except in one
miscconfigured case) if the port is the console. This fixes several
bugs:
- if all sioprobe()s failed, then the console driver followed null
pointers in cdevsw[].
- if the sioprobe() for the console failed but another sioprobe()
succeeded, then init hung early when the console couldn't be
opened.
- it was silly for the console to not be there after printing boot
messages on it.
Bugs introduced by this are hopefully no worse than old ones caused
by forcing the success of the `cn' level probe.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sio/sio.c | 9 | ||||
-rw-r--r-- | sys/i386/isa/sio.c | 9 | ||||
-rw-r--r-- | sys/isa/sio.c | 9 |
3 files changed, 15 insertions, 12 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 63c4248..898f080 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.203 1998/05/31 10:53:55 bde Exp $ + * $Id: sio.c,v 1.204 1998/06/03 09:43:38 bde Exp $ */ #include "opt_comconsole.h" @@ -616,7 +616,8 @@ sioprobe(dev) if (idev == NULL) { printf("sio%d: master device %d not configured\n", dev->id_unit, COM_MPMASTER(dev)); - return (0); + dev->id_irq = 0; + idev = dev; } if (!COM_NOTAST4(dev)) { outb(idev->id_iobase + com_scr, @@ -735,7 +736,7 @@ sioprobe(dev) } outb(iobase + com_cfcr, CFCR_8BITS); enable_intr(); - return( result ); + return (iobase == siocniobase ? IO_COMSIZE : result); } /* @@ -799,7 +800,7 @@ sioprobe(dev) } break; } - return (result); + return (iobase == siocniobase ? IO_COMSIZE : result); } #ifdef COM_ESP diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index 63c4248..898f080 100644 --- a/sys/i386/isa/sio.c +++ b/sys/i386/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.203 1998/05/31 10:53:55 bde Exp $ + * $Id: sio.c,v 1.204 1998/06/03 09:43:38 bde Exp $ */ #include "opt_comconsole.h" @@ -616,7 +616,8 @@ sioprobe(dev) if (idev == NULL) { printf("sio%d: master device %d not configured\n", dev->id_unit, COM_MPMASTER(dev)); - return (0); + dev->id_irq = 0; + idev = dev; } if (!COM_NOTAST4(dev)) { outb(idev->id_iobase + com_scr, @@ -735,7 +736,7 @@ sioprobe(dev) } outb(iobase + com_cfcr, CFCR_8BITS); enable_intr(); - return( result ); + return (iobase == siocniobase ? IO_COMSIZE : result); } /* @@ -799,7 +800,7 @@ sioprobe(dev) } break; } - return (result); + return (iobase == siocniobase ? IO_COMSIZE : result); } #ifdef COM_ESP diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 63c4248..898f080 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.203 1998/05/31 10:53:55 bde Exp $ + * $Id: sio.c,v 1.204 1998/06/03 09:43:38 bde Exp $ */ #include "opt_comconsole.h" @@ -616,7 +616,8 @@ sioprobe(dev) if (idev == NULL) { printf("sio%d: master device %d not configured\n", dev->id_unit, COM_MPMASTER(dev)); - return (0); + dev->id_irq = 0; + idev = dev; } if (!COM_NOTAST4(dev)) { outb(idev->id_iobase + com_scr, @@ -735,7 +736,7 @@ sioprobe(dev) } outb(iobase + com_cfcr, CFCR_8BITS); enable_intr(); - return( result ); + return (iobase == siocniobase ? IO_COMSIZE : result); } /* @@ -799,7 +800,7 @@ sioprobe(dev) } break; } - return (result); + return (iobase == siocniobase ? IO_COMSIZE : result); } #ifdef COM_ESP |