aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/i386/i386/cons.c9
-rw-r--r--sys/i386/isa/sio.c12
-rw-r--r--sys/i386/isa/syscons.c11
3 files changed, 29 insertions, 3 deletions
diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c
index 8d991923c8e5..9834b8828159 100644
--- a/sys/i386/i386/cons.c
+++ b/sys/i386/i386/cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.28 1995/05/30 07:59:18 rgrimes Exp $
+ * $Id: cons.c,v 1.28.4.1 1995/08/23 05:17:52 davidg Exp $
*/
#include <sys/param.h>
@@ -82,6 +82,13 @@ cninit()
register struct consdev *cp;
struct cdevsw *cdp;
+ /* restore things in case we switch consoles */
+ if (cn_tab != NULL) {
+ cdp = &cdevsw[major(cn_tab->cn_dev)];
+ cdp->d_close = cn_phys_close;
+ cdp->d_open = cn_phys_open;
+ }
+
/*
* Collect information about all possible consoles
* and find the one with highest priority
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index ff6f5159451b..10b37be237e0 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.99.4.3 1996/04/13 15:01:25 bde Exp $
+ * $Id: sio.c,v 1.99.4.4 1996/11/07 17:53:06 bde Exp $
*/
#include "sio.h"
@@ -2197,12 +2197,22 @@ siocnprobe(cp)
{
int unit;
+ /*
+ * If this has already been done, don't do it again
+ * because cdevsw[maj] has been changed to cnopen and
+ * we won't find the right table entry.
+ */
+ if (cp->cn_dev > 0)
+ return;
+
/* locate the major number */
/* XXX - should be elsewhere since KGDB uses it */
for (commajor = 0; commajor < nchrdev; commajor++)
if (cdevsw[commajor].d_open == sioopen)
break;
+ /* XXX - we should panic() if we don't find it */
+
/* XXX: ick */
unit = DEV_TO_UNIT(CONUNIT);
siocniobase = CONADDR;
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c
index 4edafe0de1e1..420c158f8430 100644
--- a/sys/i386/isa/syscons.c
+++ b/sys/i386/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.117.4.13 1996/11/10 16:57:38 nate Exp $
+ * $Id: syscons.c,v 1.117.4.14 1996/11/10 19:12:48 jkh Exp $
*/
#include "sc.h"
@@ -1130,10 +1130,19 @@ pccnprobe(struct consdev *cp)
{
int maj;
+ /*
+ * If this has already been done, don't do it again
+ * because cdevsw[maj] has been changed to cnopen and
+ * we won't find the right table entry.
+ */
+ if (cp->cn_dev > 0)
+ return;
+
/* locate the major number */
for (maj = 0; maj < nchrdev; maj++)
if ((void*)cdevsw[maj].d_open == (void*)scopen)
break;
+ /* XXX - we should panic() if we don't find it */
/* initialize required fields */
cp->cn_dev = makedev(maj, MAXCONS);