From 5fee1be7378b44e66f3c3abf36ba646589767c2d Mon Sep 17 00:00:00 2001 From: Kenji Aoyama Date: Fri, 7 May 2004 15:08:26 +0000 Subject: Add new file and clean up console code and structures. From miod@ --- sys/arch/luna88k/conf/files.luna88k | 4 +-- sys/arch/luna88k/include/conf.h | 36 +++++++++++++++++++++++++ sys/arch/luna88k/luna88k/conf.c | 53 ++----------------------------------- sys/arch/luna88k/luna88k/machdep.c | 20 ++++---------- sys/arch/luna88k/luna88k/mem.c | 8 ++---- 5 files changed, 46 insertions(+), 75 deletions(-) create mode 100644 sys/arch/luna88k/include/conf.h (limited to 'sys/arch') diff --git a/sys/arch/luna88k/conf/files.luna88k b/sys/arch/luna88k/conf/files.luna88k index 3b2c8d3547b..565f9a16be6 100644 --- a/sys/arch/luna88k/conf/files.luna88k +++ b/sys/arch/luna88k/conf/files.luna88k @@ -1,4 +1,4 @@ -# $OpenBSD: files.luna88k,v 1.2 2004/04/29 14:33:24 miod Exp $ +# $OpenBSD: files.luna88k,v 1.3 2004/05/07 15:08:25 aoyama Exp $ # maxpartitions 16 @@ -66,7 +66,6 @@ file arch/luna88k/dev/mb89352.c spc # list of standard files file dev/cons.c -file dev/cninit.c file dev/clock_subr.c file netinet/in_cksum.c @@ -78,7 +77,6 @@ file arch/luna88k/luna88k/autoconf.c file arch/luna88k/luna88k/conf.c file arch/luna88k/luna88k/m8820x.c file arch/luna88k/luna88k/disksubr.c -#file arch/luna88k/luna88k/dkbad.c file arch/luna88k/luna88k/eh.S file arch/luna88k/luna88k/isr.c file arch/luna88k/luna88k/locore_c_routines.c diff --git a/sys/arch/luna88k/include/conf.h b/sys/arch/luna88k/include/conf.h new file mode 100644 index 00000000000..df90e73a09f --- /dev/null +++ b/sys/arch/luna88k/include/conf.h @@ -0,0 +1,36 @@ +/* $OpenBSD: conf.h,v 1.1 2004/05/07 15:08:25 aoyama Exp $ */ +/* + * Copyright (c) 2004, Miodrag Vallat. + * All rights reserved. + * + * Permission to redistribute, use, copy, and modify this software + * is hereby granted without fee, provided that the following + * conditions are met: + * + * 1. This entire notice is included in all source code copies of any + * software which is or includes a copy or modification of this + * software. + * 2. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#define mmread mmrw +#define mmwrite mmrw +cdev_decl(mm); + +cdev_decl(sio); diff --git a/sys/arch/luna88k/luna88k/conf.c b/sys/arch/luna88k/luna88k/conf.c index 4d998d97f18..22be67388f3 100644 --- a/sys/arch/luna88k/luna88k/conf.c +++ b/sys/arch/luna88k/luna88k/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.1 2004/04/21 15:23:58 aoyama Exp $ */ +/* $OpenBSD: conf.c,v 1.2 2004/05/07 15:08:25 aoyama Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -37,11 +37,8 @@ #include #include #include -#include -#define mmread mmrw -#define mmwrite mmrw -cdev_decl(mm); +#include #include "pty.h" #include "bpfilter.h" @@ -62,42 +59,14 @@ cdev_decl(xfs_dev); #endif #include "ksyms.h" -#ifdef notyet -#include "xd.h" -bdev_decl(xd); -cdev_decl(xd); -#endif /* notyet */ - #include "siotty.h" -cdev_decl(sio); #include "wsdisplay.h" #include "wskbd.h" #include "wsmouse.h" #include "wsmux.h" -/* open, close, write, ioctl */ -#define cdev_lp_init(c,n) { \ - dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ - dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \ - 0, seltrue, (dev_type_mmap((*))) enodev } - -/* open, close, ioctl, mmap, ioctl */ -#define cdev_mdev_init(c,n) { \ - dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ - dev_init(c,n,write), dev_init(c,n,ioctl), \ - (dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \ - dev_init(c,n,mmap) } - -#if notyet -#include "lp.h" -cdev_decl(lp); -#include "lptwo.h" -cdev_decl(lptwo); -#endif /* notyet */ - #include "pf.h" - #include "systrace.h" struct bdevsw bdevsw[] = @@ -254,21 +223,3 @@ int chrtoblktbl[] = { /* 19 */ 8, /* vnode disk */ }; int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]); - -/* - * This entire table could be autoconfig()ed but that would mean that - * the kernel's idea of the console would be out of sync with that of - * the standalone boot. I think it best that they both use the same - * known algorithm unless we see a pressing need otherwise. - */ -#include - -#define romttycnpollc nullcnpollc -cons_decl(romtty); - -struct consdev constab[] = { -#if 0 - cons_init(romtty), -#endif - { 0 }, -}; diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index cc8b27db383..6ab6a22c237 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.2 2004/05/04 15:27:15 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.3 2004/05/07 15:08:25 aoyama Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -238,10 +238,7 @@ extern struct user *proc0paddr; * configure a kernel without romtty since we do not necessarily need a * full-blown console driver. */ -void romttycnprobe(struct consdev *); -void romttycninit(struct consdev *); -void romttycnputc(dev_t, int); -int romttycngetc(dev_t); +cons_decl(romtty); extern void nullcnpollc(dev_t, int); struct consdev romttycons = { @@ -261,24 +258,15 @@ struct consdev romttycons = { void consinit() { -#ifdef ROM_CONSOLE - extern struct consdev *cn_tab; -#endif /* * Initialize the console before we print anything out. */ -#ifdef ROM_CONSOLE - cn_tab = &romttycons; - /* cninit(); */ -#else /* from NetBSD/luna68k */ if (sysconsole == 0) { syscnattach(0); } else { omfb_cnattach(); ws_cnattach(); } - /* cninit(); */ /* XXX: this should be later? */ -#endif #if defined(DDB) db_machine_init(); @@ -454,7 +442,6 @@ cpu_startup() int depth; depth = *((volatile int *)0x00001114); - printf("frame buffer depth = %d\n", depth); switch (depth) { case 1: hwplanemask = 0x01; @@ -466,6 +453,9 @@ cpu_startup() hwplanemask = 0xff; break; default: + printf("unexpected frame buffer depth = %d\n", depth); + /* FALLTHROUGH */ + case 0: hwplanemask = 0; /* No frame buffer */ break; } diff --git a/sys/arch/luna88k/luna88k/mem.c b/sys/arch/luna88k/luna88k/mem.c index a0553547a0c..4eaaaa1c3a8 100644 --- a/sys/arch/luna88k/luna88k/mem.c +++ b/sys/arch/luna88k/luna88k/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.1 2004/04/21 15:24:10 aoyama Exp $ */ +/* $OpenBSD: mem.c,v 1.2 2004/05/07 15:08:25 aoyama Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -41,22 +41,18 @@ */ #include -#include #include #include #include #include #include +#include #include caddr_t zeropage; -#define mmread mmrw -#define mmwrite mmrw -cdev_decl(mm); - /*ARGSUSED*/ int mmopen(dev, flag, mode, p) -- cgit v1.2.3