summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2005-12-30 18:03:33 +0000
committermiod <miod@openbsd.org>2005-12-30 18:03:33 +0000
commit9792cac2257ea33eb12d8b922c8597464d3e4d22 (patch)
treed67d3c22d12c6ea329d6f3883041e14a0febf1b7
parentIntroduce symbolic constants for the magic conscode values. (diff)
downloadwireguard-openbsd-9792cac2257ea33eb12d8b922c8597464d3e4d22.tar.xz
wireguard-openbsd-9792cac2257ea33eb12d8b922c8597464d3e4d22.zip
When a driver claims console, let it set conscode to itself, instead of
letting the bus walkers do this for it. This is necessary since apci does not use the bus walkers, now that we do not force console probes to stop when apci claims console.
-rw-r--r--sys/arch/hp300/dev/apci.c6
-rw-r--r--sys/arch/hp300/dev/dca.c3
-rw-r--r--sys/arch/hp300/dev/dcm.c3
-rw-r--r--sys/arch/hp300/dev/dvbox.c3
-rw-r--r--sys/arch/hp300/dev/gbox.c3
-rw-r--r--sys/arch/hp300/dev/hyper.c3
-rw-r--r--sys/arch/hp300/dev/rbox.c3
-rw-r--r--sys/arch/hp300/dev/sti_sgc.c3
-rw-r--r--sys/arch/hp300/dev/topcat.c3
-rw-r--r--sys/arch/hp300/hp300/autoconf.c9
10 files changed, 24 insertions, 15 deletions
diff --git a/sys/arch/hp300/dev/apci.c b/sys/arch/hp300/dev/apci.c
index 28089371914..323ca84ea96 100644
--- a/sys/arch/hp300/dev/apci.c
+++ b/sys/arch/hp300/dev/apci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apci.c,v 1.25 2005/12/28 21:37:34 miod Exp $ */
+/* $OpenBSD: apci.c,v 1.26 2005/12/30 18:03:33 miod Exp $ */
/* $NetBSD: apci.c,v 1.9 2000/11/02 00:35:05 eeh Exp $ */
/*-
@@ -919,8 +919,10 @@ apcicnprobe(cp)
* If our priority is higher than the currently-remembered
* console, install ourselves.
*/
- if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)))
+ if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) {
cn_tab = cp;
+ conscode = CONSCODE_INVALID;
+ }
}
/* ARGSUSED */
diff --git a/sys/arch/hp300/dev/dca.c b/sys/arch/hp300/dev/dca.c
index 81469a2b14d..c8e1364cea9 100644
--- a/sys/arch/hp300/dev/dca.c
+++ b/sys/arch/hp300/dev/dca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dca.c,v 1.27 2005/12/28 21:13:40 miod Exp $ */
+/* $OpenBSD: dca.c,v 1.28 2005/12/30 18:03:33 miod Exp $ */
/* $NetBSD: dca.c,v 1.35 1997/05/05 20:58:18 thorpej Exp $ */
/*
@@ -1028,6 +1028,7 @@ dca_console_scan(scode, va, arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c
index 96271a108fa..bbb8d857e3b 100644
--- a/sys/arch/hp300/dev/dcm.c
+++ b/sys/arch/hp300/dev/dcm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcm.c,v 1.24 2005/02/27 22:08:39 miod Exp $ */
+/* $OpenBSD: dcm.c,v 1.25 2005/12/30 18:03:33 miod Exp $ */
/* $NetBSD: dcm.c,v 1.41 1997/05/05 20:59:16 thorpej Exp $ */
/*
@@ -1539,6 +1539,7 @@ dcm_console_scan(scode, va, arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/dev/dvbox.c b/sys/arch/hp300/dev/dvbox.c
index 13d453db90c..69177198a21 100644
--- a/sys/arch/hp300/dev/dvbox.c
+++ b/sys/arch/hp300/dev/dvbox.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvbox.c,v 1.9 2005/12/30 18:00:20 miod Exp $ */
+/* $OpenBSD: dvbox.c,v 1.10 2005/12/30 18:03:33 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -455,6 +455,7 @@ dvbox_console_scan(int scode, caddr_t va, void *arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/dev/gbox.c b/sys/arch/hp300/dev/gbox.c
index 133acdeffa0..fcb0a634271 100644
--- a/sys/arch/hp300/dev/gbox.c
+++ b/sys/arch/hp300/dev/gbox.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gbox.c,v 1.10 2005/12/30 18:00:20 miod Exp $ */
+/* $OpenBSD: gbox.c,v 1.11 2005/12/30 18:03:33 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -475,6 +475,7 @@ gbox_console_scan(int scode, caddr_t va, void *arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/dev/hyper.c b/sys/arch/hp300/dev/hyper.c
index cd2b930c34a..91d6f579160 100644
--- a/sys/arch/hp300/dev/hyper.c
+++ b/sys/arch/hp300/dev/hyper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hyper.c,v 1.11 2005/12/28 21:19:27 miod Exp $ */
+/* $OpenBSD: hyper.c,v 1.12 2005/12/30 18:03:33 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat.
@@ -522,6 +522,7 @@ hyper_console_scan(int scode, caddr_t va, void *arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/dev/rbox.c b/sys/arch/hp300/dev/rbox.c
index aa8c411b37a..01068802715 100644
--- a/sys/arch/hp300/dev/rbox.c
+++ b/sys/arch/hp300/dev/rbox.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rbox.c,v 1.10 2005/12/30 18:00:21 miod Exp $ */
+/* $OpenBSD: rbox.c,v 1.11 2005/12/30 18:03:33 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -418,6 +418,7 @@ rbox_console_scan(int scode, caddr_t va, void *arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/dev/sti_sgc.c b/sys/arch/hp300/dev/sti_sgc.c
index 397f1a17d76..bf9d72d0f7e 100644
--- a/sys/arch/hp300/dev/sti_sgc.c
+++ b/sys/arch/hp300/dev/sti_sgc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti_sgc.c,v 1.3 2005/02/27 22:10:55 miod Exp $ */
+/* $OpenBSD: sti_sgc.c,v 1.4 2005/12/30 18:03:33 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -205,6 +205,7 @@ sti_console_scan(int slot, caddr_t va, void *arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = SGC_SLOT_TO_CONSCODE(slot);
return (1);
}
diff --git a/sys/arch/hp300/dev/topcat.c b/sys/arch/hp300/dev/topcat.c
index e5b289afcc7..795071da3b4 100644
--- a/sys/arch/hp300/dev/topcat.c
+++ b/sys/arch/hp300/dev/topcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: topcat.c,v 1.11 2005/12/30 18:00:21 miod Exp $ */
+/* $OpenBSD: topcat.c,v 1.12 2005/12/30 18:03:33 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat.
@@ -547,6 +547,7 @@ topcat_console_scan(int scode, caddr_t va, void *arg)
*/
if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) {
cn_tab = cp;
+ conscode = scode;
return (DIO_SIZE(scode, va));
}
return (0);
diff --git a/sys/arch/hp300/hp300/autoconf.c b/sys/arch/hp300/hp300/autoconf.c
index 0b26a834fd0..8039272a1fd 100644
--- a/sys/arch/hp300/hp300/autoconf.c
+++ b/sys/arch/hp300/hp300/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.34 2005/12/27 18:31:08 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.35 2005/12/30 18:03:36 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.45 1999/04/10 17:31:02 kleink Exp $ */
/*
@@ -1147,7 +1147,7 @@ console_scan(func, arg, bus)
*/
size = (*func)(scode, va, arg);
iounmap(va, PAGE_SIZE);
- if (size != 0) {
+ if (size != 0 && conscode == scode) {
/* Free last mapping. */
if (convasize)
iounmap(conaddr, convasize);
@@ -1159,7 +1159,6 @@ console_scan(func, arg, bus)
continue;
/* Save this state for next time. */
- conscode = scode;
conaddr = va;
convasize = size;
}
@@ -1197,13 +1196,13 @@ console_scan(func, arg, bus)
* non-zero if console probe successfull
* and worthwhile.
*/
- if ((*func)(scode, NULL, arg) != 0) {
+ if ((*func)(scode, NULL, arg) != 0 &&
+ conscode == SGC_SLOT_TO_CONSCODE(scode)) {
/* Free last mapping. */
if (convasize)
iounmap(conaddr, convasize);
/* Save this state for next time. */
- conscode = SGC_SLOT_TO_CONSCODE(scode);
conaddr = NULL;
convasize = 0;
}