Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/pmax Massive change of console initialization to ma...
details: https://anonhg.NetBSD.org/src/rev/6f36f5fc3fa5
branches: trunk
changeset: 481642:6f36f5fc3fa5
user: nisimura <nisimura%NetBSD.org@localhost>
date: Thu Feb 03 04:19:59 2000 +0000
description:
Massive change of console initialization to make WSCONS transition easier.
diffstat:
sys/arch/pmax/conf/files.pmax | 6 +-
sys/arch/pmax/dev/cfbvar.h | 4 +-
sys/arch/pmax/dev/dc_ds.c | 4 +-
sys/arch/pmax/dev/dtopvar.h | 4 +-
sys/arch/pmax/dev/fb.c | 134 +++--------
sys/arch/pmax/dev/fb_usrreq.c | 12 +-
sys/arch/pmax/dev/findcons.c | 478 ------------------------------------------
sys/arch/pmax/dev/pm_ds.c | 182 ---------------
8 files changed, 58 insertions(+), 766 deletions(-)
diffs (truncated from 988 to 300 lines):
diff -r 3badc75c5519 -r 6f36f5fc3fa5 sys/arch/pmax/conf/files.pmax
--- a/sys/arch/pmax/conf/files.pmax Thu Feb 03 04:09:01 2000 +0000
+++ b/sys/arch/pmax/conf/files.pmax Thu Feb 03 04:19:59 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.pmax,v 1.78 2000/01/09 15:08:42 ad Exp $
+# $NetBSD: files.pmax,v 1.79 2000/02/03 04:20:05 nisimura Exp $
# DECstation-specific configuration info
# maxpartitions must be first item in files.${ARCH}.
@@ -163,10 +163,9 @@
# 3100 (pmax) onboard framebuffer
device pm: rasops1, rasops8
+attach pm at ibus with pm_ds
file arch/pmax/dev/pm.c pm needs-flag
file arch/pmax/dev/bt478.c pm
-attach pm at ibus with pm_ds
-file arch/pmax/dev/pm_ds.c pm_ds
#########################################################################
@@ -220,7 +219,6 @@
file arch/pmax/pmax/sysconf.c
file arch/pmax/stand/common/callvec.c
file dev/cons.c
-file arch/pmax/dev/findcons.c # find and set up console.
#file arch/pmax/pmax/kadb.c # obsolute kadb
# pmax configuration glue for rconsole. Requires fb pseudo-device.
diff -r 3badc75c5519 -r 6f36f5fc3fa5 sys/arch/pmax/dev/cfbvar.h
--- a/sys/arch/pmax/dev/cfbvar.h Thu Feb 03 04:09:01 2000 +0000
+++ b/sys/arch/pmax/dev/cfbvar.h Thu Feb 03 04:19:59 2000 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: cfbvar.h,v 1.4 2000/01/08 01:02:35 simonb Exp $ */
+/* $NetBSD: cfbvar.h,v 1.5 2000/02/03 04:19:59 nisimura Exp $ */
/*
* Initialize a Turbochannel CFB dumb 2-d framebuffer,
* so it can be used as a bitmapped glass-tty console device.
*/
-int cfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
+int cfb_cnattach __P((paddr_t));
diff -r 3badc75c5519 -r 6f36f5fc3fa5 sys/arch/pmax/dev/dc_ds.c
--- a/sys/arch/pmax/dev/dc_ds.c Thu Feb 03 04:09:01 2000 +0000
+++ b/sys/arch/pmax/dev/dc_ds.c Thu Feb 03 04:19:59 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dc_ds.c,v 1.15 2000/01/10 03:24:31 simonb Exp $ */
+/* $NetBSD: dc_ds.c,v 1.16 2000/02/03 04:19:59 nisimura Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -40,6 +40,7 @@
};
+#if 0
/*
* Initialize a line for (polled) console I/O
*/
@@ -69,6 +70,7 @@
dc_consinit(dev, (void *)MIPS_PHYS_TO_KSEG1(dcaddr));
return (1);
}
+#endif
/*
diff -r 3badc75c5519 -r 6f36f5fc3fa5 sys/arch/pmax/dev/dtopvar.h
--- a/sys/arch/pmax/dev/dtopvar.h Thu Feb 03 04:09:01 2000 +0000
+++ b/sys/arch/pmax/dev/dtopvar.h Thu Feb 03 04:19:59 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtopvar.h,v 1.3 2000/01/09 03:55:35 simonb Exp $ */
+/* $NetBSD: dtopvar.h,v 1.4 2000/02/03 04:20:00 nisimura Exp $ */
/*
* Copyright (c) 1997 Jonathan Stone. All rights reserved.
@@ -43,6 +43,8 @@
extern void (*dtopMouseEvent) __P((void *));
extern void (*dtopMouseButtons) __P((void *));
+void dtikbd_cnattach __P((void));
+
/*
* Device numbers.
*/
diff -r 3badc75c5519 -r 6f36f5fc3fa5 sys/arch/pmax/dev/fb.c
--- a/sys/arch/pmax/dev/fb.c Thu Feb 03 04:09:01 2000 +0000
+++ b/sys/arch/pmax/dev/fb.c Thu Feb 03 04:19:59 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fb.c,v 1.34 2000/01/10 03:24:32 simonb Exp $ */
+/* $NetBSD: fb.c,v 1.35 2000/02/03 04:20:00 nisimura Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -81,8 +81,6 @@
#include <pmax/pmax/cons.h>
#include <pmax/pmax/pmaxtype.h>
-#include "rasterconsole.h"
-
#include "dc.h"
#include "scc.h"
#include "dtop.h"
@@ -119,6 +117,13 @@
*/
#include <pmax/dev/lk201var.h>
+#include "fb.h"
+
+static int fbndevs;
+struct fbinfo fi_console;
+struct fbinfo *fbdevs[NFB];
+static u_int8_t cmap_bits[768]; /* colormap for console */
+
/*
* The "blessed" framebuffer; the fb that gets
* the qvss-style ring buffer of mouse/kbd events, and is used
@@ -127,21 +132,6 @@
struct fbinfo *firstfi = NULL;
/*
- * Pro-tem framebuffer pseudo-device driver
- */
-
-#include <sys/device.h>
-#include "fb.h"
-
-struct fbdev {
- struct fbinfo fd_info;
- caddr_t fd_base;
-} static fbdevs[NFB];
-
-static u_int fbndevs; /* number of devices */
-static u_char cmap_bits[768]; /* colormap for console */
-
-/*
* attach routine: required for pseudo-device
*/
void
@@ -151,92 +141,52 @@
}
-/*
- * Connect a framebuffer, described by a struct fbinfo, to the
- * raster-console pseudo-device subsystem. (This would be done
- * with BStreams, if only we had them.)
- */
void
-fbconnect (name, info, console)
- char *name;
- struct fbinfo *info;
- int console;
+fbcnalloc(fip)
+ struct fbinfo **fip;
{
- char *cstr;
-
- /*
- * If this is the first frame buffer we've seen, pass it to rcons.
- */
- if (console) {
- /* Only the first fb gets 4.4bsd/pmax style event ringbuffer */
- firstfi = info;
-#if NRASTERCONSOLE > 0
- /*XXX*/ cn_in_dev = cn_tab->cn_dev; /*XXX*/ /* FIXME */
- rcons_connect (info);
- } else {
- cstr = (info == &fbdevs[0].fd_info ? " (console)" : "");
-#else
- } else {
- cstr = "";
-#endif /* NRASTERCONSOLE */
- printf(": %dx%dx%d%s", info->fi_type.fb_width,
- info->fi_type.fb_height, info->fi_type.fb_depth, cstr);
- }
+ struct fbinfo *fi = &fi_console;
+
+ firstfi = fi; /* XXX */
+ fi->fi_cmap_bits = cmap_bits;
+ fbdevs[fbndevs++] = fi;
+ *fip = fi;
}
-
-/*
- * Allocate a 'struct fbinfo' for a new fb device. Return zero on success
- * (i.e. if the device has not been configured before). Always return ptr
- * to struct fbinfo in 'fip' for that device, unless there are more fb's
- * probed than configured.
- */
int
-fballoc(base, fip)
- caddr_t base;
+fballoc(fip)
struct fbinfo **fip;
{
- int i;
-
- if (base == NULL)
- printf("fballoc: base == NULL");
+ struct fbinfo *fi;
- for (i = 0; i < NFB; i++) {
- /* Free entry? */
- if (fbdevs[i].fd_base == NULL)
- break;
-
- /* Already configured? */
- if (fbdevs[i].fd_base == base) {
- *fip = &fbdevs[i].fd_info;
- return (-1);
- }
+ if (fbndevs >= NFB)
+ return (-1);
+ fi = malloc(sizeof(struct fbinfo), M_DEVBUF, M_NOWAIT);
+ if (fi == NULL)
+ goto nomemory;
+ fi->fi_cmap_bits = malloc(768, M_DEVBUF, M_NOWAIT);
+ if (fi->fi_cmap_bits == NULL) {
+ free(fi, M_DEVBUF);
+ goto nomemory;
}
-
- if (i == NFB) {
- printf("fballoc: more framebuffers probed than configured!\n");
- *fip = NULL;
- return (-1);
- }
-
- fbndevs = i + 1;
- fbdevs[i].fd_base = base;
- *fip = &fbdevs[i].fd_info;
-
- /* Console? */
- if (i == 0)
- (*fip)->fi_cmap_bits = cmap_bits;
- else {
- (*fip)->fi_cmap_bits = malloc(768, M_DEVBUF, M_NOWAIT);
- if ((*fip)->fi_cmap_bits == NULL) {
- printf("fballoc: no memory for cmap\n");
- return (-1);
- }
- }
-
+ if (fbndevs == 0) /* XXX */
+ firstfi = fi; /* XXX */
+ *fip = fbdevs[fbndevs++] = fi;
return (0);
+
+ nomemory:
+ return (-1);
}
+void
+fbconnect(fi)
+ struct fbinfo *fi;
+{
+ if (&fi_console == fi)
+ rcons_connect(fi);
+}
+
+cdev_decl(fb); /* generic framebuffer pseudo-device */
#include "fb_usrreq.c" /* old pm-compatible driver that supports X11R5/R6 */
diff -r 3badc75c5519 -r 6f36f5fc3fa5 sys/arch/pmax/dev/fb_usrreq.c
--- a/sys/arch/pmax/dev/fb_usrreq.c Thu Feb 03 04:09:01 2000 +0000
+++ b/sys/arch/pmax/dev/fb_usrreq.c Thu Feb 03 04:19:59 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fb_usrreq.c,v 1.19 1999/12/30 00:29:53 simonb Exp $ */
+/* $NetBSD: fb_usrreq.c,v 1.20 2000/02/03 04:20:01 nisimura Exp $ */
/*ARGSUSED*/
int
@@ -12,7 +12,7 @@
if (minor(dev) >= fbndevs)
return(ENXIO);
- fi = &fbdevs[minor(dev)].fd_info;
+ fi = fbdevs[minor(dev)];
if (fi->fi_open)
return (EBUSY);
@@ -53,7 +53,7 @@
if (minor(dev) >= fbndevs)
return(EBADF);
- fi = &fbdevs[minor(dev)].fd_info;
+ fi = fbdevs[minor(dev)];
if (!fi->fi_open)
return (EBADF);
@@ -97,7 +97,7 @@
if (minor(dev) >= fbndevs)
return(EBADF);
- fi = &fbdevs[minor(dev)].fd_info;
+ fi = fbdevs[minor(dev)];
fbtty = fi->fi_glasstty;
Home |
Main Index |
Thread Index |
Old Index