Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 Start putting in hooks for non-zs console d...
details: https://anonhg.NetBSD.org/src/rev/1d23ab2deb25
branches: trunk
changeset: 473163:1d23ab2deb25
user: eeh <eeh%NetBSD.org@localhost>
date: Sun May 23 02:45:19 1999 +0000
description:
Start putting in hooks for non-zs console devices.
diffstat:
sys/arch/sparc64/conf/NONPLUS | 12 +-
sys/arch/sparc64/conf/files.sparc64 | 3 +-
sys/arch/sparc64/dev/bwtwo.c | 4 +-
sys/arch/sparc64/dev/cgfourteen.c | 4 +-
sys/arch/sparc64/dev/cgsix_sbus.c | 4 +-
sys/arch/sparc64/dev/cgthree.c | 4 +-
sys/arch/sparc64/dev/fb.c | 23 +--
sys/arch/sparc64/dev/kd.c | 118 +++++++---------
sys/arch/sparc64/dev/tcx.c | 4 +-
sys/arch/sparc64/dev/zs.c | 257 +++++++----------------------------
sys/arch/sparc64/sparc64/autoconf.c | 5 +-
11 files changed, 124 insertions(+), 314 deletions(-)
diffs (truncated from 668 to 300 lines):
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/conf/NONPLUS
--- a/sys/arch/sparc64/conf/NONPLUS Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/conf/NONPLUS Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NONPLUS,v 1.12 1999/04/26 04:25:38 ad Exp $
+# $NetBSD: NONPLUS,v 1.13 1999/05/23 02:45:19 eeh Exp $
include "arch/sparc64/conf/std.sparc64"
@@ -222,13 +222,13 @@
## called `se' and `su'
## Part of a PC87332VLJ?
-#se0 at ebus? #
-#kbd0 at su1 channel 0 # keyboard
-#ms0 at su1 channel 1 # mouse
-
-## These are two SAB82532 controllers
#su0 at ebus? # ttya
#su1 at ebus? # ttyb
+#kbd0 at su0 # keyboard
+#ms0 at su1 # mouse
+
+## This is the SAB82532 DUART
+#se0 at ebus? #
#### Disk controllers and disks
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/conf/files.sparc64
--- a/sys/arch/sparc64/conf/files.sparc64 Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/conf/files.sparc64 Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.sparc64,v 1.18 1999/05/14 06:49:55 mrg Exp $
+# $NetBSD: files.sparc64,v 1.19 1999/05/23 02:45:19 eeh Exp $
# @(#)files.sparc64 8.1 (Berkeley) 7/19/93
# sparc64-specific configuration info
@@ -136,6 +136,7 @@
file dev/cons.c
file arch/sparc64/dev/fb.c
+file arch/sparc64/dev/consinit.c
file arch/sparc64/fpu/fpu.c
file arch/sparc64/fpu/fpu_add.c
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/dev/bwtwo.c
--- a/sys/arch/sparc64/dev/bwtwo.c Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/dev/bwtwo.c Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bwtwo.c,v 1.5 1998/09/05 23:57:24 eeh Exp $ */
+/* $NetBSD: bwtwo.c,v 1.6 1999/05/23 02:45:19 eeh Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@@ -301,7 +301,7 @@
#endif
if (CPU_ISSUN4COR4M)
- isconsole = node == fbnode && fbconstty != NULL;
+ isconsole = (node == fbnode);
/*
* When the ROM has mapped in a bwtwo display, the address
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/dev/cgfourteen.c
--- a/sys/arch/sparc64/dev/cgfourteen.c Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/dev/cgfourteen.c Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgfourteen.c,v 1.3 1998/11/19 15:38:24 mrg Exp $ */
+/* $NetBSD: cgfourteen.c,v 1.4 1999/05/23 02:45:19 eeh Exp $ */
/*
* Copyright (c) 1996
@@ -272,7 +272,7 @@
sc->sc_cmap.cm_chip[i] = lut[i];
/* See if we're the console */
- isconsole = node == fbnode && fbconstty != NULL;
+ isconsole = (node == fbnode);
/*
* We don't use the raster console since the cg14 is fast enough
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/dev/cgsix_sbus.c
--- a/sys/arch/sparc64/dev/cgsix_sbus.c Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/dev/cgsix_sbus.c Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgsix_sbus.c,v 1.3 1998/09/05 16:50:37 pk Exp $ */
+/* $NetBSD: cgsix_sbus.c,v 1.4 1999/05/23 02:45:19 eeh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -177,7 +177,7 @@
sbus_establish(&sc->sc_sd, &sc->sc_dev);
name = getpropstring(node, "model");
- isconsole = node == fbnode && fbconstty != NULL;
+ isconsole = (node == fbnode);
if (isconsole && cgsix_use_rasterconsole) {
int ramsize = fb->fb_type.fb_height * fb->fb_linebytes;
if (sbus_bus_map(sa->sa_bustag, sa->sa_slot,
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/dev/cgthree.c
--- a/sys/arch/sparc64/dev/cgthree.c Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/dev/cgthree.c Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgthree.c,v 1.4 1998/11/19 15:38:24 mrg Exp $ */
+/* $NetBSD: cgthree.c,v 1.5 1999/05/23 02:45:19 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -217,7 +217,7 @@
* registers ourselves. We only need the video RAM if we are
* going to print characters via rconsole.
*/
- isconsole = node == fbnode && fbconstty != NULL;
+ isconsole = (node == fbnode) && fbconstty != NULL;
if ((sc->sc_fb.fb_pixels = ca->ca_ra.ra_vaddr) == NULL && isconsole) {
/* this probably cannot happen, but what the heck */
sc->sc_fb.fb_pixels = mapiodev(ca->ca_ra.ra_reg, CG3REG_MEM,
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/dev/fb.c
--- a/sys/arch/sparc64/dev/fb.c Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/dev/fb.c Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fb.c,v 1.13 1999/05/19 21:06:00 ad Exp $ */
+/* $NetBSD: fb.c,v 1.14 1999/05/23 02:45:19 eeh Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -262,25 +262,8 @@
maxcol = 0;
#if !defined(RASTERCONS_FULLSCREEN)
-#if defined(SUN4)
- if (CPU_ISSUN4) {
- struct eeprom *eep = (struct eeprom *)eeprom_va;
-
- if (eep == NULL) {
- maxcol = 80;
- maxrow = 34;
- } else {
- maxcol = eep->eeTtyCols;
- maxrow = eep->eeTtyRows;
- }
- }
-#endif /* SUN4 */
- if (!CPU_ISSUN4) {
- maxcol =
- a2int(getpropstring(optionsnode, "screen-#columns"), 80);
- maxrow =
- a2int(getpropstring(optionsnode, "screen-#rows"), 34);
- }
+ maxcol = a2int(getpropstring(optionsnode, "screen-#columns"), 80);
+ maxrow = a2int(getpropstring(optionsnode, "screen-#rows"), 34);
#endif /* !RASTERCONS_FULLSCREEN */
/*
* XXX until somebody actually sets the colormap after a call to
diff -r dff8d2cefff0 -r 1d23ab2deb25 sys/arch/sparc64/dev/kd.c
--- a/sys/arch/sparc64/dev/kd.c Sun May 23 00:48:46 1999 +0000
+++ b/sys/arch/sparc64/dev/kd.c Sun May 23 02:45:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kd.c,v 1.3 1999/05/22 20:34:56 eeh Exp $ */
+/* $NetBSD: kd.c,v 1.4 1999/05/23 02:45:19 eeh Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -119,6 +119,9 @@
{
struct kd_softc *kd;
struct tty *tp;
+ int i;
+ char *prop;
+
if (unit != 0)
return;
@@ -150,36 +153,20 @@
#endif
}
- if (CPU_ISSUN4COR4M) {
- int i;
- char *prop;
-
- if (kd->rows == 0 &&
- (prop = getpropstring(optionsnode, "screen-#rows"))) {
- i = 0;
- while (*prop != '\0')
- i = i * 10 + *prop++ - '0';
- kd->rows = (unsigned short)i;
- }
- if (kd->cols == 0 &&
- (prop = getpropstring(optionsnode, "screen-#columns"))) {
- i = 0;
- while (*prop != '\0')
- i = i * 10 + *prop++ - '0';
- kd->cols = (unsigned short)i;
- }
+ if (kd->rows == 0 &&
+ (prop = getpropstring(optionsnode, "screen-#rows"))) {
+ i = 0;
+ while (*prop != '\0')
+ i = i * 10 + *prop++ - '0';
+ kd->rows = (unsigned short)i;
}
- if (CPU_ISSUN4) {
- struct eeprom *ep = (struct eeprom *)eeprom_va;
-
- if (ep) {
- if (kd->rows == 0)
- kd->rows = (u_short)ep->eeTtyRows;
- if (kd->cols == 0)
- kd->cols = (u_short)ep->eeTtyCols;
- }
+ if (kd->cols == 0 &&
+ (prop = getpropstring(optionsnode, "screen-#columns"))) {
+ i = 0;
+ while (*prop != '\0')
+ i = i * 10 + *prop++ - '0';
+ kd->cols = (unsigned short)i;
}
-
return;
}
@@ -478,6 +465,9 @@
static void kdcnputc __P((dev_t, int));
static void kdcnpollc __P((dev_t, int));
+/* The keyboard driver uses cn_hw to access the real console driver */
+extern struct consdev consdev_prom;
+struct consdev *cn_hw = &consdev_prom;
struct consdev consdev_kd = {
kdcnprobe,
kdcninit,
@@ -517,45 +507,35 @@
struct kbd_state *ks = &kdcn_state;
int code, class, data, keysym;
- if (!zs_conschan) {
- char c0;
-
- while ((code = OF_read(OF_stdin(), &c0, sizeof(c0))) != sizeof(c0)) {
- if (code != -2 && code != 0)
- return -1;
- }
- return (c0);
- } else {
- for (;;) {
- code = zs_getc(zs_conschan);
- keysym = kbd_code_to_keysym(ks, code);
- class = KEYSYM_CLASS(keysym);
+ for (;;) {
+ code = (*cn_hw->cn_getc)(dev);
+ keysym = kbd_code_to_keysym(ks, code);
+ class = KEYSYM_CLASS(keysym);
+
+ switch (class) {
+ case KEYSYM_ASCII:
+ goto out;
- switch (class) {
- case KEYSYM_ASCII:
- goto out;
-
- case KEYSYM_CLRMOD:
- case KEYSYM_SETMOD:
- data = (keysym & 0x1F);
- /* Only allow ctrl or shift. */
- if (data > KBMOD_SHIFT_R)
- break;
- data = 1 << data;
- if (class == KEYSYM_SETMOD)
- ks->kbd_modbits |= data;
- else
- ks->kbd_modbits &= ~data;
+ case KEYSYM_CLRMOD:
+ case KEYSYM_SETMOD:
+ data = (keysym & 0x1F);
+ /* Only allow ctrl or shift. */
+ if (data > KBMOD_SHIFT_R)
break;
-
- case KEYSYM_ALL_UP:
- /* No toggle keys here. */
- ks->kbd_modbits = 0;
- break;
-
- default: /* ignore all other keysyms */
- break;
- }
+ data = 1 << data;
+ if (class == KEYSYM_SETMOD)
+ ks->kbd_modbits |= data;
+ else
+ ks->kbd_modbits &= ~data;
+ break;
+
+ case KEYSYM_ALL_UP:
+ /* No toggle keys here. */
+ ks->kbd_modbits = 0;
+ break;
+
Home |
Main Index |
Thread Index |
Old Index