summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-05-10 21:29:29 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-05-10 21:29:29 +0000
commit368d4e11cd0b0c65197e86d4dea8df5d8b17a9b0 (patch)
treedb722d4ad63153791a07738aae9c15f25b509c8a /sys
parent1f42d0111a0c89a7e02909f839f5d0a0468de4d6 (diff)
Be more strict in the `are we the console device' logic at device attachment
time; not only do we need to match the graphics console address, but cn_tab needs to point to wsdisplay, too.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sgi/gio/grtwo.c8
-rw-r--r--sys/arch/sgi/gio/impact_gio.c9
-rw-r--r--sys/arch/sgi/gio/light.c8
-rw-r--r--sys/arch/sgi/gio/newport.c8
4 files changed, 25 insertions, 8 deletions
diff --git a/sys/arch/sgi/gio/grtwo.c b/sys/arch/sgi/gio/grtwo.c
index 35e10692eec..6951262436e 100644
--- a/sys/arch/sgi/gio/grtwo.c
+++ b/sys/arch/sgi/gio/grtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grtwo.c,v 1.4 2012/04/30 21:29:33 miod Exp $ */
+/* $OpenBSD: grtwo.c,v 1.5 2012/05/10 21:29:28 miod Exp $ */
/* $NetBSD: grtwo.c,v 1.11 2009/11/22 19:09:15 mbalmer Exp $ */
/*
@@ -76,6 +76,8 @@
#include <sgi/localbus/intreg.h>
#include <sgi/localbus/intvar.h>
+#include <dev/cons.h>
+
#define GRTWO_WIDTH 1280
#define GRTWO_HEIGHT 1024
@@ -355,13 +357,15 @@ grtwo_attach(struct device *parent, struct device *self, void *aux)
struct grtwo_devconfig *dc;
struct wsemuldisplaydev_attach_args waa;
const char *descr;
+ extern struct consdev wsdisplay_cons;
descr = ga->ga_descr;
if (descr == NULL || *descr == '\0')
descr = "GR2";
printf(": %s", descr);
- if (ga->ga_addr == grtwo_console_dc.dc_addr) {
+ if (cn_tab == &wsdisplay_cons &&
+ ga->ga_addr == grtwo_console_dc.dc_addr) {
waa.console = 1;
dc = &grtwo_console_dc;
sc->sc_nscreens = 1;
diff --git a/sys/arch/sgi/gio/impact_gio.c b/sys/arch/sgi/gio/impact_gio.c
index f745843c0d6..c0048c5d4fe 100644
--- a/sys/arch/sgi/gio/impact_gio.c
+++ b/sys/arch/sgi/gio/impact_gio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: impact_gio.c,v 1.2 2012/04/24 20:11:26 miod Exp $ */
+/* $OpenBSD: impact_gio.c,v 1.3 2012/05/10 21:29:28 miod Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
@@ -38,6 +38,8 @@
#include <sgi/gio/giovar.h>
#include <sgi/sgi/ip22.h>
+#include <dev/cons.h>
+
#define IMPACT_REG_OFFSET 0x00000000
#define IMPACT_REG_SIZE 0x00080000
@@ -67,13 +69,16 @@ impact_gio_attach(struct device *parent, struct device *self, void *aux)
bus_space_tag_t iot;
bus_space_handle_t ioh;
int console;
+ extern struct consdev wsdisplay_cons;
if (strncmp(bios_graphics, "alive", 5) != 0) {
printf(" device has not been setup by firmware!\n");
return;
}
- console = giofb_consaddr == ga->ga_addr;
+ printf("\n");
+
+ console = cn_tab == &wsdisplay_cons && giofb_consaddr == ga->ga_addr;
if (console != 0) {
iot = NULL;
diff --git a/sys/arch/sgi/gio/light.c b/sys/arch/sgi/gio/light.c
index 036171567ea..23c7fac501e 100644
--- a/sys/arch/sgi/gio/light.c
+++ b/sys/arch/sgi/gio/light.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: light.c,v 1.2 2012/04/24 20:11:26 miod Exp $ */
+/* $OpenBSD: light.c,v 1.3 2012/05/10 21:29:28 miod Exp $ */
/* $NetBSD: light.c,v 1.5 2007/03/04 06:00:39 christos Exp $ */
/*
@@ -75,6 +75,8 @@
#include <sgi/gio/lightvar.h>
#include <sgi/gio/lightreg.h>
+#include <dev/cons.h>
+
struct light_softc {
struct device sc_dev;
@@ -290,8 +292,10 @@ light_attach(struct device *parent, struct device *self, void *aux)
struct gio_attach_args *ga = aux;
struct light_devconfig *dc;
struct wsemuldisplaydev_attach_args waa;
+ extern struct consdev wsdisplay_cons;
- if (ga->ga_addr == light_console_dc.dc_addr) {
+ if (cn_tab == &wsdisplay_cons &&
+ ga->ga_addr == light_console_dc.dc_addr) {
waa.console = 1;
dc = &light_console_dc;
sc->sc_nscreens = 1;
diff --git a/sys/arch/sgi/gio/newport.c b/sys/arch/sgi/gio/newport.c
index e6d425ec950..b4f2b7e5503 100644
--- a/sys/arch/sgi/gio/newport.c
+++ b/sys/arch/sgi/gio/newport.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newport.c,v 1.3 2012/04/24 20:18:17 miod Exp $ */
+/* $OpenBSD: newport.c,v 1.4 2012/05/10 21:29:28 miod Exp $ */
/* $NetBSD: newport.c,v 1.15 2009/05/12 23:51:25 macallan Exp $ */
/*
@@ -63,6 +63,8 @@
#include <sgi/gio/newportreg.h>
#include <sgi/gio/newportvar.h>
+#include <dev/cons.h>
+
struct newport_softc {
struct device sc_dev;
@@ -503,8 +505,10 @@ newport_attach(struct device *parent, struct device *self, void *aux)
struct newport_devconfig *dc;
struct wsemuldisplaydev_attach_args waa;
const char *descr;
+ extern struct consdev wsdisplay_cons;
- if (ga->ga_addr == newport_console_dc.dc_addr) {
+ if (cn_tab == &wsdisplay_cons &&
+ ga->ga_addr == newport_console_dc.dc_addr) {
waa.console = 1;
dc = &newport_console_dc;
sc->sc_nscreens = 1;