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.
This commit is contained in:
Bruce Evans 1998-06-03 12:30:10 +00:00
parent 158a00b20e
commit 12e1ed28e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36613
3 changed files with 15 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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