summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-09 21:34:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-09 21:34:48 +0000
commit1848f3689607781a442c3f9b95448510997e5fb3 (patch)
tree6818afd25264ca9160582f988cf6c492a1c04744 /sys
parent605f25f01edaf6c5fa838f1ba154e4b2b4856ed0 (diff)
correct sun4 calls to fb_attach()
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/bwtwo.c7
-rw-r--r--sys/arch/sparc/dev/cgeight.c3
-rw-r--r--sys/arch/sparc/dev/cgfour.c3
-rw-r--r--sys/arch/sparc/dev/cgsix.c8
-rw-r--r--sys/arch/sparc/dev/cgtwo.c3
5 files changed, 13 insertions, 11 deletions
diff --git a/sys/arch/sparc/dev/bwtwo.c b/sys/arch/sparc/dev/bwtwo.c
index 76d14e39401..71c1b8fae70 100644
--- a/sys/arch/sparc/dev/bwtwo.c
+++ b/sys/arch/sparc/dev/bwtwo.c
@@ -236,11 +236,8 @@ bwtwoattach(parent, self, args)
if (ca->ca_bustype == BUS_SBUS)
sbus_establish(&sc->sc_sd, &sc->sc_dev);
#endif
- /*
- * XXX: this could cause a panic in fb_attach() if more
- * than one frame buffer device is found on a Sun 4.
- */
- if (node == fbnode || cputyp == CPU_SUN4)
+ if ((node == fbnode && cputyp != CPU_SUN4) ||
+ (isconsole && cputyp == CPU_SUN4))
fb_attach(&sc->sc_fb);
}
diff --git a/sys/arch/sparc/dev/cgeight.c b/sys/arch/sparc/dev/cgeight.c
index 890e4ac50db..e558e907d81 100644
--- a/sys/arch/sparc/dev/cgeight.c
+++ b/sys/arch/sparc/dev/cgeight.c
@@ -224,7 +224,8 @@ cgeightattach(parent, self, args)
#endif
} else
printf("\n");
- if (node == fbnode)
+ if ((node == fbnode && cputyp != CPU_SUN4) ||
+ (isconsole && cputyp == CPU_SUN4))
fb_attach(&sc->sc_fb);
}
diff --git a/sys/arch/sparc/dev/cgfour.c b/sys/arch/sparc/dev/cgfour.c
index 172706c3120..74f5b470733 100644
--- a/sys/arch/sparc/dev/cgfour.c
+++ b/sys/arch/sparc/dev/cgfour.c
@@ -201,7 +201,8 @@ cgfourattach(parent, self, args)
printf(" (console)\n");
} else
printf("\n");
- if (node == fbnode)
+ if ((node == fbnode && cputyp != CPU_SUN4) ||
+ (isconsole && cputyp == CPU_SUN4))
fb_attach(&sc->sc_fb);
}
diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c
index a66b2cb6bd0..46870946ad5 100644
--- a/sys/arch/sparc/dev/cgsix.c
+++ b/sys/arch/sparc/dev/cgsix.c
@@ -180,7 +180,7 @@ cgsixattach(parent, self, args)
{
register struct cgsix_softc *sc = (struct cgsix_softc *)self;
register struct confargs *ca = args;
- register int node, ramsize, i;
+ register int node, ramsize, i, isconsole;
register volatile struct bt_regs *bt;
register volatile struct cg6_layout *p;
char *nam;
@@ -234,6 +234,7 @@ cgsixattach(parent, self, args)
* the video RAM mapped. Just map what we care about for ourselves
* (the FHC, THC, and Brooktree registers).
*/
+ isconsole = node == fbnode && fbconstty != NULL;
sc->sc_physadr = p = (struct cg6_layout *)ca->ca_ra.ra_paddr;
sc->sc_bt = bt = (volatile struct bt_regs *)
mapiodev((caddr_t)&p->cg6_bt_un.un_btregs, sizeof *sc->sc_bt,
@@ -263,7 +264,7 @@ cgsixattach(parent, self, args)
/* enable video */
sc->sc_thc->thc_misc |= THC_MISC_VIDEN;
- if (node == fbnode && fbconstty != NULL) {
+ if (isconsole) {
printf(" (console)\n");
} else
printf("\n");
@@ -271,7 +272,8 @@ cgsixattach(parent, self, args)
if (ca->ca_bustype == BUS_SBUS)
sbus_establish(&sc->sc_sd, &sc->sc_dev);
#endif /* SUN4C || SUN4M */
- if (node == fbnode)
+ if ((node == fbnode && cputyp != CPU_SUN4) ||
+ (isconsole && cputyp == CPU_SUN4))
fb_attach(&sc->sc_fb);
}
diff --git a/sys/arch/sparc/dev/cgtwo.c b/sys/arch/sparc/dev/cgtwo.c
index 735bb97a4c5..742b407b63c 100644
--- a/sys/arch/sparc/dev/cgtwo.c
+++ b/sys/arch/sparc/dev/cgtwo.c
@@ -212,7 +212,8 @@ cgtwoattach(parent, self, args)
#endif
} else
printf("\n");
- if (node == fbnode)
+ if ((node == fbnode && cputyp != CPU_SUN4) ||
+ (isconsole && cputyp == CPU_SUN4))
fb_attach(&sc->sc_fb);
}