diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-04-21 22:21:55 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-04-21 22:21:55 +0000 |
commit | 13ea5ad44cf1481b3e98c3bc986f5cb649f7c477 (patch) | |
tree | f7d426d783945959e51025c2daa2700ddb88c311 /sys | |
parent | a439473339626e15c695fb38e77aed946064fe91 (diff) |
Since bugtty (and BUG routines in general) can only work if we keep the BUG
mapped, and we don't, do not bother carrying this code around - it can not
be used anyway.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme68k/conf/GENERIC | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/MVME147 | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/MVME162 | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/MVME167 | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/MVME177 | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/RAMDISK | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/files.mvme68k | 6 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/bug.c | 240 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/bugtty.c | 480 | ||||
-rw-r--r-- | sys/arch/mvme68k/include/bugio.h | 44 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/conf.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/locore.s | 28 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/machdep.c | 114 |
13 files changed, 35 insertions, 935 deletions
diff --git a/sys/arch/mvme68k/conf/GENERIC b/sys/arch/mvme68k/conf/GENERIC index 6fc48fcf75f..1b5573cba6c 100644 --- a/sys/arch/mvme68k/conf/GENERIC +++ b/sys/arch/mvme68k/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.27 2005/11/27 14:19:06 miod Exp $ +# $OpenBSD: GENERIC,v 1.28 2006/04/21 22:21:53 miod Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -75,8 +75,6 @@ memc0 at pcctwo0 offset 0x43000 memc1 at pcctwo0 offset 0x43100 sram0 at mainbus0 addr 0xffe00000 -bugtty0 at mainbus0 - vmes0 at vme0 vs* at vmes0 addr 0xffff9000 ipl 2 vec 0x80 @@ -104,7 +102,3 @@ ss* at scsibus? safte* at scsibus? ses* at scsibus? uk* at scsibus? - -#si0 at vmes0 addr 0xff200000 ipl 2 vec 0x40 -#nxdc0 at vmes0 addr 0xff00ee80 ipl 2 vec 0x44 -#xd* at xdc? diff --git a/sys/arch/mvme68k/conf/MVME147 b/sys/arch/mvme68k/conf/MVME147 index 1e5f6899b19..190d60ed23a 100644 --- a/sys/arch/mvme68k/conf/MVME147 +++ b/sys/arch/mvme68k/conf/MVME147 @@ -1,4 +1,4 @@ -# $OpenBSD: MVME147,v 1.19 2005/11/27 14:19:06 miod Exp $ +# $OpenBSD: MVME147,v 1.20 2006/04/21 22:21:53 miod Exp $ machine mvme68k m68k @@ -29,8 +29,6 @@ wdsc0 at pcc0 offset 0x4000 ipl 2 lp0 at pcc0 ipl 1 vme0 at pcc0 offset 0x2000 -bugtty0 at mainbus0 - vmes0 at vme0 #vs* at vmes0 addr 0xffff9000 ipl 2 vec 0x80 @@ -55,7 +53,3 @@ cd* at scsibus? ch* at scsibus? ss* at scsibus? uk* at scsibus? - -#si0 at vmes0 addr 0xff200000 ipl 2 vec 0x40 -#nxdc0 at vmes0 addr 0xff00ee80 ipl 2 vec 0x44 -#xd* at xdc? diff --git a/sys/arch/mvme68k/conf/MVME162 b/sys/arch/mvme68k/conf/MVME162 index 0139271bc5d..77bb359e879 100644 --- a/sys/arch/mvme68k/conf/MVME162 +++ b/sys/arch/mvme68k/conf/MVME162 @@ -1,4 +1,4 @@ -# $OpenBSD: MVME162,v 1.22 2005/11/27 14:19:07 miod Exp $ +# $OpenBSD: MVME162,v 1.23 2006/04/21 22:21:53 miod Exp $ machine mvme68k m68k @@ -36,8 +36,6 @@ sram0 at mainbus0 addr 0xffe00000 fooip* at ipic? manu 0x11 prod 0x22 ipl 1 -bugtty0 at mainbus0 - vmes0 at vme0 vs* at vmes0 addr 0xffff9000 ipl 2 vec 0x80 @@ -62,7 +60,3 @@ cd* at scsibus? ch* at scsibus? ss* at scsibus? uk* at scsibus? - -#si0 at vmes0 addr 0xff200000 ipl 2 vec 0x40 -#nxdc0 at vmes0 addr 0xff00ee80 ipl 2 vec 0x44 -#xd* at xdc? diff --git a/sys/arch/mvme68k/conf/MVME167 b/sys/arch/mvme68k/conf/MVME167 index 65c4bf115e6..a35106a2b38 100644 --- a/sys/arch/mvme68k/conf/MVME167 +++ b/sys/arch/mvme68k/conf/MVME167 @@ -1,4 +1,4 @@ -# $OpenBSD: MVME167,v 1.22 2005/11/27 14:19:07 miod Exp $ +# $OpenBSD: MVME167,v 1.23 2006/04/21 22:21:53 miod Exp $ machine mvme68k m68k @@ -32,8 +32,6 @@ memc0 at pcctwo0 offset 0x43000 memc1 at pcctwo0 offset 0x43100 sram0 at mainbus0 addr 0xffe00000 -bugtty0 at mainbus0 - vmes0 at vme0 vs* at vmes0 addr 0xffff9000 ipl 2 vec 0x80 @@ -58,7 +56,3 @@ cd* at scsibus? ch* at scsibus? ss* at scsibus? uk* at scsibus? - -#si0 at vmes0 addr 0xff200000 ipl 2 vec 0x40 -#nxdc0 at vmes0 addr 0xff00ee80 ipl 2 vec 0x44 -#xd* at xdc? diff --git a/sys/arch/mvme68k/conf/MVME177 b/sys/arch/mvme68k/conf/MVME177 index f1661195a3e..da871847443 100644 --- a/sys/arch/mvme68k/conf/MVME177 +++ b/sys/arch/mvme68k/conf/MVME177 @@ -1,4 +1,4 @@ -# $OpenBSD: MVME177,v 1.11 2005/11/27 14:19:07 miod Exp $ +# $OpenBSD: MVME177,v 1.12 2006/04/21 22:21:53 miod Exp $ machine mvme68k m68k @@ -32,8 +32,6 @@ memc0 at pcctwo0 offset 0x43000 memc1 at pcctwo0 offset 0x43100 sram0 at mainbus0 addr 0xffe00000 -bugtty0 at mainbus0 - vmes0 at vme0 vs* at vmes0 addr 0xffff9000 ipl 2 vec 0x80 @@ -58,7 +56,3 @@ cd* at scsibus? ch* at scsibus? ss* at scsibus? uk* at scsibus? - -#si0 at vmes0 addr 0xff200000 ipl 2 vec 0x40 -#nxdc0 at vmes0 addr 0xff00ee80 ipl 2 vec 0x44 -#xd* at xdc? diff --git a/sys/arch/mvme68k/conf/RAMDISK b/sys/arch/mvme68k/conf/RAMDISK index 3c1e4e73058..04ffba489da 100644 --- a/sys/arch/mvme68k/conf/RAMDISK +++ b/sys/arch/mvme68k/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.7 2005/11/27 14:19:07 miod Exp $ +# $OpenBSD: RAMDISK,v 1.8 2006/04/21 22:21:53 miod Exp $ machine mvme68k m68k @@ -79,8 +79,6 @@ memc0 at pcctwo0 offset 0x43000 memc1 at pcctwo0 offset 0x43100 sram0 at mainbus0 addr 0xffe00000 -bugtty0 at mainbus0 - vmes0 at vme0 vs* at vmes0 addr 0xffff9000 ipl 2 vec 0x80 @@ -104,10 +102,6 @@ sd* at scsibus? st* at scsibus? cd* at scsibus? -#si0 at vmes0 addr 0xff200000 ipl 2 vec 0x40 -#nxdc0 at vmes0 addr 0xff00ee80 ipl 2 vec 0x44 -#xd* at xdc? - pseudo-device loop 1 # network loopback pseudo-device bpfilter 1 # packet filter pseudo-device rd 1 # ramdisk diff --git a/sys/arch/mvme68k/conf/files.mvme68k b/sys/arch/mvme68k/conf/files.mvme68k index daebb15d8ef..f1a2db99140 100644 --- a/sys/arch/mvme68k/conf/files.mvme68k +++ b/sys/arch/mvme68k/conf/files.mvme68k @@ -1,4 +1,4 @@ -# $OpenBSD: files.mvme68k,v 1.28 2005/11/27 14:19:07 miod Exp $ +# $OpenBSD: files.mvme68k,v 1.29 2006/04/21 22:21:53 miod Exp $ # config file for mvme68k @@ -34,10 +34,6 @@ device cl: tty attach cl at pcctwo file arch/mvme68k/dev/cl.c cl needs-count -device bugtty: tty -attach bugtty at mainbus -file arch/mvme68k/dev/bugtty.c bugtty needs-count -file arch/mvme68k/dev/bug.c bugtty device vme {} attach vme at pcc, mc, pcctwo diff --git a/sys/arch/mvme68k/dev/bug.c b/sys/arch/mvme68k/dev/bug.c deleted file mode 100644 index ba28b90a15c..00000000000 --- a/sys/arch/mvme68k/dev/bug.c +++ /dev/null @@ -1,240 +0,0 @@ -/* $OpenBSD: bug.c,v 1.6 2003/06/03 01:35:30 drahn Exp $ */ - -/* - * Copyright (c) 1995 Dale Rahn. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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. - */ - -/* - * bug routines -- assumes that the necessary sections of memory - * are preserved. - */ -#include <sys/param.h> - -#include <machine/bugio.h> -#include <machine/prom.h> - -/* flag to traphandler to signify prom call. presumes splhigh() */ -extern volatile int promcall; - -void bug_outln(char *, char *); -void bug_delay(int); -void bug_stat(void); -void asm_bug_stat(void); - -/* tty routines */ -char -bug_inchr() -{ - int s = splhigh(); - volatile char a; - - promcall = 1; - asm volatile ("subql #2,sp"); - MVMEPROM_CALL(MVMEPROM_INCHR); - asm volatile ("nop"); - asm volatile ("movb sp@+,%0" : "=d" (a)); - promcall = 0; - splx(s); - return (a); -} - -/* returns 0 if no characters ready to read */ -int -bug_instat() -{ - int s = splhigh(); - volatile short ret; - - promcall = 1; - MVMEPROM_CALL(MVMEPROM_INSTAT); - asm volatile ("nop"); - asm volatile ("movw ccr,%0" : "=d" (ret)); - promcall = 0; - splx(s); - return (!(ret & 0x4)); -} - -void -bug_outchr(a) - char a; -{ - int s = splhigh(); - - promcall = 1; - asm volatile ("movb %0,sp@-" :: "d" (a)); - MVMEPROM_CALL(MVMEPROM_OUTCHR); - asm volatile ("nop"); - promcall = 0; - splx(s); -} - -void -bug_outstr(pstrb, pstre) - char *pstrb; - char *pstre; -{ - int s = splhigh(); - - promcall = 1; - asm volatile ("movl %0,sp@-" :: "d" (pstre)); - asm volatile ("movl %0,sp@-" :: "d" (pstrb)); - MVMEPROM_CALL(MVMEPROM_OUTSTR); - promcall = 0; - splx(s); -} - -void -bug_outln(pstrb, pstre) - char *pstrb; - char *pstre; -{ - int s = splhigh(); - - promcall = 1; - asm volatile ("movl %0,sp@-" :: "d" (pstre)); - asm volatile ("movl %0,sp@-" :: "d" (pstrb)); - MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF); - promcall = 0; - splx(s); -} - -/* BUG - disk routines */ - -#if 0 -/* returns 0: success, nonzero: error */ -u_int bug_drdcnt = 0; -int -bug_diskrd(arg) - bug_dskio *arg; -{ - volatile int ret; - - promcall = 1; - bug_drdcnt++; - asm volatile ("movl %0, sp@-" :: "d" (arg)); - MVMEPROM_CALL(MVMEPROM_DSKRD); - asm volatile ("nop"); - asm volatile ("movw ccr,%0" : "=d" (ret)); - promcall = 0; - return (!(ret & 0x4)); -} - -/* returns 0: success, nonzero: error */ -u_int bug_dwrcnt = 0; -int -bug_diskwr(arg) - bug_dskio *arg; -{ - volatile int ret; - - promcall = 1; - bug_dwrcnt ++; - asm volatile ("movl %0, sp@-" :: "d" (arg)); - MVMEPROM_CALL(MVMEPROM_DSKWR); - asm volatile ("nop"); - asm volatile ("movw ccr,%0" : "=d" (ret)); - promcall = 0; - return (!(ret & 0x4)); -} - -bug_diskcfig() -{ -} - -bug_diskfmt() -{ -} - -bug_diskctrl() -{ -} -#endif - -/* BUG - timing routine */ -void -bug_delay(delay_msec) - int delay_msec; -{ - int s = splhigh(); - - promcall = 1; - asm volatile ("movl %0,sp@-" :: "d" (delay_msec)); - MVMEPROM_CALL(MVMEPROM_DELAY); - asm volatile ("nop"); - promcall = 0; - splx(s); -} - -/* BUG - return to bug routine */ -void -bug_return() -{ - promcall = 1; - MVMEPROM_CALL(MVMEPROM_EXIT); - promcall = 0; - /*NOTREACHED*/ -} - -/* BUG - query board routines */ -struct bug_brdid * -bug_brdid() -{ - struct bug_brdid *pbrd_id; - - promcall = 1; - asm volatile ("clrl sp@-"); - MVMEPROM_CALL(MVMEPROM_GETBRDID); - asm volatile ("movl sp@+,%0" : "=d" (pbrd_id):); - promcall = 0; - return (pbrd_id); -} - -int asm_callbuf[4]; - -void -bug_stat() -{ - char val[] = "|/-\\"; - static int cnt = 0; - - bug_outchr('\b'); - bug_outchr(val[cnt]); - cnt = (cnt + 1) % (sizeof(val) -1); -} - -void -asm_bug_stat() -{ - asm volatile ("movl a0,_asm_callbuf+0"); - asm volatile ("movl a1,_asm_callbuf+4"); - asm volatile ("movl d0,_asm_callbuf+8"); - asm volatile ("movl d1,_asm_callbuf+12"); - - bug_stat(); - - asm volatile ("movl _asm_callbuf+0,a0"); - asm volatile ("movl _asm_callbuf+4,a1"); - asm volatile ("movl _asm_callbuf+8,d0"); - asm volatile ("movl _asm_callbuf+12,d1"); -} diff --git a/sys/arch/mvme68k/dev/bugtty.c b/sys/arch/mvme68k/dev/bugtty.c deleted file mode 100644 index 9ad515c9e5b..00000000000 --- a/sys/arch/mvme68k/dev/bugtty.c +++ /dev/null @@ -1,480 +0,0 @@ -/* $OpenBSD: bugtty.c,v 1.14 2006/01/01 11:59:39 miod Exp $ */ - -/* - * Copyright (c) 1995 Dale Rahn. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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 <sys/param.h> -#include <sys/systm.h> -#include <sys/ioctl.h> -#include <sys/device.h> -#include <sys/tty.h> -#include <sys/proc.h> -#include <sys/uio.h> -#include <sys/queue.h> -#include <dev/cons.h> - -#include <machine/autoconf.h> -#include <machine/bugio.h> -#include <machine/conf.h> -#include <machine/cpu.h> -#include <machine/prom.h> - -#include "bugtty.h" - -int bugttymatch(struct device *parent, void *self, void *aux); -void bugttyattach(struct device *parent, struct device *self, void *aux); - -struct cfattach bugtty_ca = { - sizeof(struct device), bugttymatch, bugttyattach -}; - -struct cfdriver bugtty_cd = { - NULL, "bugtty", DV_TTY -}; - -/* prototypes */ -cons_decl(bugtty); - -struct tty *bugttytty(dev_t); -int bugttymctl(dev_t, int, int); -int bugttyparam(struct tty*, struct termios *); -void bugtty_chkinput(void); - -#define DIALOUT(x) ((x) & 0x80) -#define SWFLAGS(dev) (bugttyswflags | (DIALOUT(dev) ? TIOCFLAG_SOFTCAR : 0)) -#define BUGTTYUNIT(x) ((x) & 0x7f) - -#define BUGBUF 80 -char bugtty_ibuffer[BUGBUF+1]; -volatile char *pinchar = bugtty_ibuffer; -char bug_obuffer[BUGBUF+1]; - -#define BUGTTYS 4 -struct tty *bugtty_tty[BUGTTYS]; - -struct tty * -bugttytty(dev) - dev_t dev; -{ - int unit; - - unit = BUGTTYUNIT(dev); - if (unit >= BUGTTYS) - return (NULL); - return (bugtty_tty[unit]); -} - -int -bugttymatch(parent, self, aux) - struct device *parent; - void *self; - void *aux; -{ - extern int needprom; - - if (needprom == 0) - return (0); - return (1); -} - -void -bugttyattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - printf(": fallback console\n"); -} - -void bugttyoutput(struct tty *tp); - -int bugttydefaultrate = TTYDEF_SPEED; -int bugttyswflags; - -int -bugttymctl(dev, bits, how) - dev_t dev; - int bits, how; -{ - /*static int settings = TIOCM_DTR | TIOCM_RTS | - TIOCM_CTS | TIOCM_CD | TIOCM_DSR;*/ - int s; - - /*printf("mctl: dev %x, bits %x, how %x,",dev, bits, how);*/ - - /* settings are currently ignored */ - s = spltty(); - switch (how) { - case DMSET: - break; - case DMBIC: - break; - case DMBIS: - break; - case DMGET: - break; - } - splx(s); - - bits = 0; - /* proper defaults? */ - bits |= TIOCM_DTR; - bits |= TIOCM_RTS; - bits |= TIOCM_CTS; - bits |= TIOCM_CD; - /* bits |= TIOCM_RI; */ - bits |= TIOCM_DSR; - - /* printf("retbits %x\n", bits); */ - return (bits); -} - -int -bugttyopen(dev, flag, mode, p) - dev_t dev; - int flag, mode; - struct proc *p; -{ - int s, unit = BUGTTYUNIT(dev); - struct tty *tp; - extern int needprom; - - if (needprom == 0) - return (ENODEV); - - s = spltty(); - if (bugtty_tty[unit]) { - tp = bugtty_tty[unit]; - } else { - tp = bugtty_tty[unit] = ttymalloc(); - } - tp->t_oproc = bugttyoutput; - tp->t_param = NULL; - tp->t_dev = dev; - - if ((tp->t_state & TS_ISOPEN) == 0) { - tp->t_state |= TS_WOPEN; - ttychars(tp); - if (tp->t_ispeed == 0) { - /* - * only when cleared do we reset to defaults. - */ - tp->t_iflag = TTYDEF_IFLAG; - tp->t_oflag = TTYDEF_OFLAG; - tp->t_cflag = TTYDEF_CFLAG; - tp->t_lflag = TTYDEF_LFLAG; - tp->t_ispeed = tp->t_ospeed = bugttydefaultrate; - } - /* bugtty does not have carrier */ - tp->t_cflag |= CLOCAL; - /* - * do these all the time - */ - if (bugttyswflags & TIOCFLAG_CLOCAL) - tp->t_cflag |= CLOCAL; - if (bugttyswflags & TIOCFLAG_CRTSCTS) - tp->t_cflag |= CRTSCTS; - if (bugttyswflags & TIOCFLAG_MDMBUF) - tp->t_cflag |= MDMBUF; - bugttyparam(tp, &tp->t_termios); - ttsetwater(tp); - - (void)bugttymctl(dev, TIOCM_DTR | TIOCM_RTS, DMSET); - /* - if ((SWFLAGS(dev) & TIOCFLAG_SOFTCAR) || - (bugttymctl(dev, 0, DMGET) & TIOCM_CD)) - tp->t_state |= TS_CARR_ON; - else - tp->t_state &= ~TS_CARR_ON; - */ - tp->t_state |= TS_CARR_ON; - } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { - splx(s); - return (EBUSY); - } - - /* - * if NONBLOCK requested, ignore carrier - */ -/* - if (flag & O_NONBLOCK) - goto done; -*/ - - splx(s); - /* - * Reset the tty pointer, as there could have been a dialout - * use of the tty with a dialin open waiting. - */ - tp->t_dev = dev; - return ((*linesw[tp->t_line].l_open)(dev, tp)); -} - -int -bugttyparam(tp, tm) - struct tty*tp; - struct termios *tm; -{ - return (0); -} - -void -bugttyoutput(tp) - struct tty *tp; -{ - int cc, s, cnt; - - /* only supports one unit */ - - if ((tp->t_state & TS_ISOPEN) == 0) - return; - - s = spltty(); - cc = tp->t_outq.c_cc; - while (cc > 0) { - cnt = min(BUGBUF, cc); - cnt = q_to_b(&tp->t_outq, bug_obuffer, cnt); - bug_outstr(bug_obuffer, &bug_obuffer[cnt]); - cc -= cnt; - } - splx(s); -} - -int -bugttyclose(dev, flag, mode, p) - dev_t dev; - int flag, mode; - struct proc *p; -{ - int unit = BUGTTYUNIT(dev); - struct tty *tp = bugtty_tty[unit]; - - (*linesw[tp->t_line].l_close)(tp, flag); - - ttyclose(tp); -#if 0 - bugtty_tty[unit] = NULL; -#endif - return (0); -} - -int -bugttyread(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; -{ - struct tty *tp; - - if ((tp = bugtty_tty[BUGTTYUNIT(dev)]) == NULL) - return (ENXIO); - return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); -} - -#if 1 -/* only to be called at splclk() */ -void -bugtty_chkinput() -{ - struct tty *tp; - - tp = bugtty_tty[0]; /* Kinda ugly hack */ - if (tp == NULL ) - return; - - if (bug_instat()) { - while (bug_instat()) { - u_char c = bug_inchr() & 0xff; - (*linesw[tp->t_line].l_rint)(c, tp); - } - /* - wakeup(tp); - */ - } -} -#endif - -int -bugttywrite(dev, uio, flag) - dev_t dev; - struct uio *uio; - int flag; -{ -#if 0 - /* bypass tty output routines. */ - int i, cnt, s; - int oldoff; - - s = spltty(); - oldoff = uio->uio_offset; - do { - uiomove(bug_obuffer, BUGBUF, uio); - bug_outstr(bug_obuffer, &bug_obuffer[uio->uio_offset - oldoff]); - oldoff = uio->uio_offset; - } while (uio->uio_resid != 0); - splx(s); - - return (0); -#else - struct tty *tp; - if((tp = bugtty_tty[BUGTTYUNIT(dev)]) == NULL) - return (ENXIO); - return ((*linesw[tp->t_line].l_write)(tp, uio, flag)); -#endif -} - -int -bugttyioctl(dev, cmd, data, flag, p) - dev_t dev; - u_long cmd; - caddr_t data; - int flag; - struct proc *p; -{ - int unit = BUGTTYUNIT(dev); - struct tty *tp = bugtty_tty[unit]; - int error; - - if (!tp) - return (ENXIO); - - error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); - if (error >= 0) - return (error); - - error = ttioctl(tp, cmd, data, flag, p); - if (error >= 0) - return (error); - - switch (cmd) { - case TIOCSBRK: - /* */ - break; - - case TIOCCBRK: - /* */ - break; - - case TIOCSDTR: - (void) bugttymctl(dev, TIOCM_DTR | TIOCM_RTS, DMBIS); - break; - - case TIOCCDTR: - (void) bugttymctl(dev, TIOCM_DTR | TIOCM_RTS, DMBIC); - break; - - case TIOCMSET: - (void) bugttymctl(dev, *(int *) data, DMSET); - break; - - case TIOCMBIS: - (void) bugttymctl(dev, *(int *) data, DMBIS); - break; - - case TIOCMBIC: - (void) bugttymctl(dev, *(int *) data, DMBIC); - break; - - case TIOCMGET: - *(int *)data = bugttymctl(dev, 0, DMGET); - break; - case TIOCGFLAGS: - *(int *)data = SWFLAGS(dev); - break; - case TIOCSFLAGS: - error = suser(p, 0); - if (error != 0) - return (EPERM); - - bugttyswflags = *(int *)data; - bugttyswflags &= /* only allow valid flags */ - (TIOCFLAG_SOFTCAR | TIOCFLAG_CLOCAL | TIOCFLAG_CRTSCTS); - break; - default: - return (ENOTTY); - } - - return (0); -} - -int -bugttystop(tp, flag) - struct tty *tp; - int flag; -{ - int s; - - s = spltty(); - if (tp->t_state & TS_BUSY) { - if ((tp->t_state & TS_TTSTOP) == 0) - tp->t_state |= TS_FLUSH; - } - splx(s); - return (0); -} - -/* - * bugtty is the last possible choice for a console device. - */ -void -bugttycnprobe(cp) - struct consdev *cp; -{ - int maj; - extern int needprom; - - if (needprom == 0) - return; - - /* locate the major number */ - for (maj = 0; maj < nchrdev; maj++) - if (cdevsw[maj].d_open == bugttyopen) - break; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_NORMAL; -} - -void -bugttycninit(cp) - struct consdev *cp; -{ - /* Nothing to do */ -} - -int -bugttycngetc(dev) - dev_t dev; -{ - return (bug_inchr()); -} - -void -bugttycnputc(dev, c) - dev_t dev; - char c; -{ - bug_outchr(c); -} diff --git a/sys/arch/mvme68k/include/bugio.h b/sys/arch/mvme68k/include/bugio.h deleted file mode 100644 index 8bd7e4dbcc5..00000000000 --- a/sys/arch/mvme68k/include/bugio.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: bugio.h,v 1.2 2003/04/16 17:34:48 miod Exp $ */ -/* - * Copyright (c) 2002, 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. - */ - -#ifndef _MACHINE_BUGIO_H_ -#define _MACHINE_BUGIO_H_ - -#include <sys/cdefs.h> - -#include <machine/prom.h> - -int bug_instat(void); -char bug_inchr(void); -void bug_outchr(char); -void bug_outstr(char *, char *); -void bug_return(void); -struct bug_brdid *bug_brdid(void); - -#endif /* _MACHINE_BUGIO_H_ */ diff --git a/sys/arch/mvme68k/mvme68k/conf.c b/sys/arch/mvme68k/mvme68k/conf.c index 7df6bdfd3e2..1e22125c7ea 100644 --- a/sys/arch/mvme68k/mvme68k/conf.c +++ b/sys/arch/mvme68k/mvme68k/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.37 2004/02/10 01:31:21 millert Exp $ */ +/* $OpenBSD: conf.c,v 1.38 2006/04/21 22:21:54 miod Exp $ */ /*- * Copyright (c) 1995 Theo de Raadt @@ -117,7 +117,6 @@ cdev_decl(fd); #include "zs.h" #include "cl.h" #include "wl.h" -#include "bugtty.h" /* open, close, write, ioctl */ #define cdev_lp_init(c,n) { \ @@ -168,7 +167,7 @@ struct cdevsw cdevsw[] = cdev_mdev_init(NFLASH,flash), /* 11: /dev/flashX */ cdev_tty_init(NZS,zs), /* 12: SCC serial (tty[a-d]) */ cdev_tty_init(NCL,cl), /* 13: CL-CD2400 serial (tty0[0-3]) */ - cdev_tty_init(NBUGTTY,bugtty), /* 14: BUGtty (ttyB) */ + cdev_notdef(), /* 14 */ cdev_notdef(), /* 15 */ cdev_notdef(), /* 16 */ cdev_disk_init(NCCD,ccd), /* 17: concatenated disk */ @@ -304,8 +303,6 @@ int nchrtoblktbl = sizeof(chrtoblktbl) / sizeof(chrtoblktbl[0]); cons_decl(zs); #define clcnpollc nullcnpollc cons_decl(cl); -#define bugttycnpollc nullcnpollc -cons_decl(bugtty); struct consdev constab[] = { #if NZS > 0 @@ -314,8 +311,5 @@ struct consdev constab[] = { #if NCL > 0 cons_init(cl), #endif -#if NBUGTTY > 0 - cons_init(bugtty), -#endif { 0 }, }; diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s index 10bf222e1e5..ad6474e916a 100644 --- a/sys/arch/mvme68k/mvme68k/locore.s +++ b/sys/arch/mvme68k/mvme68k/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.49 2006/01/21 12:27:58 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.50 2006/04/21 22:21:54 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -105,7 +105,6 @@ BSS(lowram, 4) BSS(esym, 4) BSS(emini, 4) BSS(smini, 4) -BSS(needprom, 4) BSS(promvbr, 4) BSS(promcall, 4) @@ -273,9 +272,6 @@ is162: #ifdef MVME167 is167: -| RELOC(needprom,a0) | this machine needs the prom mapped! -| movl #1,a0@ - RELOC(memsize1x7, a1) | how much memory? jbsr a1@ @@ -325,10 +321,6 @@ is172: #ifdef MVME177 is177: - -| RELOC(needprom,a0) | this machine needs the prom mapped! -| movl #1,a0@ - RELOC(memsize1x7, a1) | how much memory? jbsr a1@ @@ -490,29 +482,11 @@ Lstploaddone: cmpl #MMU_68040,a0@ | 68040 or 68060? jgt Lmotommu2 | no, skip - RELOC(needprom,a0) - cmpl #0,a0@ - beq 1f - /* - * this machine needs the prom mapped. we use the translation - * registers to map it in.. and the ram it needs. - */ - movel #0xff00a044,d0 | map top 16meg 1/1 for bug eprom exe - .long 0x4e7b0004 | movc d0,itt0 - moveq #0,d0 | ensure itt1 is disabled - .long 0x4e7b0005 | movc d0,itt1 - movel #0xff00a040,d0 | map top 16meg 1/1 for bug io access - .long 0x4e7b0006 | movc d0,dtt0 - moveq #0,d0 | ensure dtt1 is disabled - .long 0x4e7b0007 | movc d0,dtt1 - bra 2f -1: moveq #0,d0 | ensure TT regs are disabled .long 0x4e7b0004 | movc d0,itt0 .long 0x4e7b0005 | movc d0,itt1 .long 0x4e7b0006 | movc d0,dtt0 .long 0x4e7b0007 | movc d0,dtt1 -2: .word 0xf4d8 | cinva bc .word 0xf518 | pflusha diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 239c559fe88..7c5e1bd8174 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.94 2005/12/17 07:31:26 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.95 2006/04/21 22:21:54 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -91,7 +91,6 @@ #include <sys/evcount.h> #include <machine/autoconf.h> -#include <machine/bugio.h> #include <machine/cpu.h> #include <machine/kcore.h> #include <machine/prom.h> @@ -99,7 +98,9 @@ #include <machine/pte.h> #include <machine/reg.h> +#ifdef MVME147 #include <mvme68k/dev/pccreg.h> +#endif #include <dev/cons.h> @@ -157,27 +158,6 @@ extern struct emul emul_hpux; extern struct emul emul_sunos; #endif -/* - * XXX this is to fake out the console routines, while - * booting. New and improved! :-) smurph - */ -void bootcnprobe(struct consdev *); -void bootcninit(struct consdev *); -void bootcnputc(dev_t, int); -int bootcngetc(dev_t); -extern void nullcnpollc(dev_t, int); - -#define bootcnpollc nullcnpollc - -static struct consdev bootcons = { - NULL, - NULL, - bootcngetc, - bootcnputc, - bootcnpollc, - NULL, - makedev(14,0), - 1}; void dumpsys(void); void initvectors(void); @@ -207,37 +187,31 @@ mvme68k_init() uvmexp.pagesize = NBPG; uvm_setpagesize(); uvm_page_physload(atop(avail_start), atop(avail_end), - atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); + atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); /* * Put machine specific exception vectors in place. */ initvectors(); - - /* startup fake console driver. It will be replaced by consinit() */ - cn_tab = &bootcons; } /* * Console initialization: called early on from main, - * before vm init or startup. Do enough configuration - * to choose and initialize a console. + * before vm init or startup, but already running virtual. + * Do enough configuration to choose and initialize a console. */ void consinit() { - extern void db_machine_init(void); - /* * Initialize the console before we print anything out. */ - cn_tab = NULL; /* Get rid of fake console driver */ cninit(); #ifdef DDB - db_machine_init(); ddb_init(); + if (boothowto & RB_KDB) Debugger(); #endif @@ -1066,62 +1040,24 @@ memsize162() struct mcreg *mc = (struct mcreg *)0xfff42000; switch (mc->mc_memoptions & MC_MEMOPTIONS_DRAMMASK) { - case MC_MEMOPTIONS_DRAM1M: - return (1*1024*1024); - case MC_MEMOPTIONS_DRAM2M: - return (2*1024*1024); - case MC_MEMOPTIONS_DRAM4M: - return (4*1024*1024); - case MC_MEMOPTIONS_DRAM4M2: - return (4*1024*1024); - case MC_MEMOPTIONS_DRAM8M: - return (8*1024*1024); - case MC_MEMOPTIONS_DRAM16M: - return (16*1024*1024); - default: - /* - * XXX if the machine has no MC-controlled memory, - * perhaps it has a MCECC or MEMC040 controller? - */ - return (memsize1x7()); + case MC_MEMOPTIONS_DRAM1M: + return (1*1024*1024); + case MC_MEMOPTIONS_DRAM2M: + return (2*1024*1024); + case MC_MEMOPTIONS_DRAM4M: + return (4*1024*1024); + case MC_MEMOPTIONS_DRAM4M2: + return (4*1024*1024); + case MC_MEMOPTIONS_DRAM8M: + return (8*1024*1024); + case MC_MEMOPTIONS_DRAM16M: + return (16*1024*1024); + default: + /* + * XXX if the machine has no MC-controlled memory, + * perhaps it has a MCECC or MEMC040 controller? + */ + return (memsize1x7()); } } #endif - -/* - * Boot console routines: - * Enables printing of boot messages before consinit(). - */ - -void -bootcnprobe(cp) - struct consdev *cp; -{ - cp->cn_dev = makedev(14, 0); - cp->cn_pri = CN_NORMAL; -} - -void -bootcninit(cp) - struct consdev *cp; -{ - /* Nothing to do */ -} - -int -bootcngetc(dev) - dev_t dev; -{ - return (bug_inchr()); -} - -void -bootcnputc(dev, c) - dev_t dev; - int c; -{ - char cc = (char)c; - if (cc == '\n') - bug_outchr('\r'); - bug_outchr(cc); -} |