summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme88k/ddb/db_interface.c18
-rw-r--r--sys/arch/mvme88k/ddb/db_sstep.c4
-rw-r--r--sys/arch/mvme88k/ddb/db_trace.c16
-rw-r--r--sys/arch/mvme88k/dev/bugio.c32
-rw-r--r--sys/arch/mvme88k/dev/bugtty.c60
-rw-r--r--sys/arch/mvme88k/dev/busswitch.c8
-rw-r--r--sys/arch/mvme88k/dev/cl.c42
-rw-r--r--sys/arch/mvme88k/dev/clock.c12
-rw-r--r--sys/arch/mvme88k/dev/dart.c96
-rw-r--r--sys/arch/mvme88k/dev/if_ie.c12
-rw-r--r--sys/arch/mvme88k/dev/if_ve.c34
-rw-r--r--sys/arch/mvme88k/dev/nvram.c41
-rw-r--r--sys/arch/mvme88k/dev/pcc2.c2
-rw-r--r--sys/arch/mvme88k/dev/sclock.c17
-rw-r--r--sys/arch/mvme88k/dev/ssh.c46
-rw-r--r--sys/arch/mvme88k/dev/sshdma.c5
-rw-r--r--sys/arch/mvme88k/dev/syscon.c22
-rw-r--r--sys/arch/mvme88k/dev/vme.c27
-rw-r--r--sys/arch/mvme88k/dev/vme.h3
-rw-r--r--sys/arch/mvme88k/dev/vmel.c4
-rw-r--r--sys/arch/mvme88k/dev/vmes.c4
-rw-r--r--sys/arch/mvme88k/dev/vs.c76
-rw-r--r--sys/arch/mvme88k/dev/vsdma.c16
-rw-r--r--sys/arch/mvme88k/dev/vx.c2428
-rw-r--r--sys/arch/mvme88k/include/assert.h5
-rw-r--r--sys/arch/mvme88k/include/bugio.h31
-rw-r--r--sys/arch/mvme88k/include/cmmu.h20
-rw-r--r--sys/arch/mvme88k/include/cpu.h7
-rw-r--r--sys/arch/mvme88k/include/db_machdep.h4
-rw-r--r--sys/arch/mvme88k/include/intr.h130
-rw-r--r--sys/arch/mvme88k/include/locore.h13
-rw-r--r--sys/arch/mvme88k/include/m88110.h8
-rw-r--r--sys/arch/mvme88k/include/m882xx.h14
-rw-r--r--sys/arch/mvme88k/include/mmu.h4
-rw-r--r--sys/arch/mvme88k/include/param.h11
-rw-r--r--sys/arch/mvme88k/include/psl.h94
-rw-r--r--sys/arch/mvme88k/include/trap.h33
-rw-r--r--sys/arch/mvme88k/mvme88k/autoconf.c44
-rw-r--r--sys/arch/mvme88k/mvme88k/cmmu.c4
-rw-r--r--sys/arch/mvme88k/mvme88k/disksubr.c5
-rw-r--r--sys/arch/mvme88k/mvme88k/eh.S7
-rw-r--r--sys/arch/mvme88k/mvme88k/locore.S6
-rw-r--r--sys/arch/mvme88k/mvme88k/locore_asm_routines.S6
-rw-r--r--sys/arch/mvme88k/mvme88k/locore_c_routines.c19
-rw-r--r--sys/arch/mvme88k/mvme88k/m18x_cmmu.c262
-rw-r--r--sys/arch/mvme88k/mvme88k/m88100_fp.S5
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110_fp.S6
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110_mmu.S4
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c112
-rw-r--r--sys/arch/mvme88k/mvme88k/pmap.c5
-rw-r--r--sys/arch/mvme88k/mvme88k/pmap_table.c4
-rw-r--r--sys/arch/mvme88k/mvme88k/process.S7
-rw-r--r--sys/arch/mvme88k/mvme88k/process_machdep.c27
-rw-r--r--sys/arch/mvme88k/mvme88k/trap.c26
-rw-r--r--sys/arch/mvme88k/mvme88k/vm_machdep.c10
55 files changed, 2116 insertions, 1842 deletions
diff --git a/sys/arch/mvme88k/ddb/db_interface.c b/sys/arch/mvme88k/ddb/db_interface.c
index c0a1f512475..7450beb9b7a 100644
--- a/sys/arch/mvme88k/ddb/db_interface.c
+++ b/sys/arch/mvme88k/ddb/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.6 2001/03/08 00:02:18 miod Exp $ */
+/* $OpenBSD: db_interface.c,v 1.7 2001/03/09 05:44:37 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -31,9 +31,9 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/reboot.h>
-#include <sys/systm.h> /* just for boothowto --eichin */
#include <vm/vm.h>
@@ -41,14 +41,25 @@
#include <machine/trap.h> /* current_thread() */
#include <machine/db_machdep.h> /* local ddb stuff */
#include <machine/bug.h> /* bug routines */
+#include <machine/locore.h>
#include <machine/mmu.h>
#include <machine/cpu_number.h>
#include <ddb/db_command.h>
+#include <ddb/db_extern.h>
+#include <ddb/db_output.h>
#include <ddb/db_sym.h>
extern label_t *db_recover;
extern unsigned int db_maxoff;
+extern int db_are_interrupts_disabled();
+extern unsigned db_trace_get_val(vm_offset_t addr, unsigned *ptr);
+extern int frame_is_sane();
+extern int badwordaddr();
+extern void cnpollc __P((int));
+void kdbprinttrap __P((int type, int code));
+void kdb_init __P((void));
+
int db_active = 0;
int db_noisy = 0;
@@ -383,7 +394,7 @@ m88k_db_trap(
#if 0
(void) spl7();
#endif
- return(1);
+ return;
}
extern char *trap_type[];
@@ -392,6 +403,7 @@ extern int trap_types;
/*
* Print trap reason.
*/
+void
kdbprinttrap(type, code)
int type, code;
{
diff --git a/sys/arch/mvme88k/ddb/db_sstep.c b/sys/arch/mvme88k/ddb/db_sstep.c
index 717f3c07332..8027004189d 100644
--- a/sys/arch/mvme88k/ddb/db_sstep.c
+++ b/sys/arch/mvme88k/ddb/db_sstep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_sstep.c,v 1.5 2001/03/07 23:58:36 miod Exp $ */
+/* $OpenBSD: db_sstep.c,v 1.6 2001/03/09 05:44:38 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -26,6 +26,8 @@
* rights to redistribute these changes.
*/
+#include <sys/param.h>
+#include <sys/systm.h>
#include <machine/db_machdep.h>
#include <ddb/db_access.h> /* db_get_value() */
diff --git a/sys/arch/mvme88k/ddb/db_trace.c b/sys/arch/mvme88k/ddb/db_trace.c
index 91c9d1fedcc..b6852ba0bd3 100644
--- a/sys/arch/mvme88k/ddb/db_trace.c
+++ b/sys/arch/mvme88k/ddb/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.6 2001/03/08 00:02:18 miod Exp $ */
+/* $OpenBSD: db_trace.c,v 1.7 2001/03/09 05:44:38 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -84,12 +84,17 @@ static inline unsigned br_dest(unsigned addr, union instruction inst)
#define TRACE_DEBUG /* undefine to disable debugging */
+#include <sys/param.h>
+#include <sys/systm.h>
#include <machine/db_machdep.h> /* lots of stuff */
#include <ddb/db_variables.h> /* db_variable, DB_VAR_GET, etc. */
#include <ddb/db_output.h> /* db_printf */
#include <ddb/db_sym.h> /* DB_STGY_PROC, etc. */
#include <ddb/db_command.h> /* db_recover */
+extern int badwordaddr();
+extern int m88k_print_instruction __P((unsigned iadr, long inst));
+extern void db_read_bytes();
/*
* Some macros to tell if the given text is the instruction.
*/
@@ -355,7 +360,7 @@ db_trace_get_val(vm_offset_t addr, unsigned *ptr)
quiet_db_read_bytes = 1;
- if (setjmp(*(db_recover = &db_jmpbuf)) != 0) {
+ if (setjmp((db_recover = &db_jmpbuf)) != 0) {
db_recover = prev;
quiet_db_read_bytes = old_quiet_db_read_bytes;
return 0;
@@ -1067,7 +1072,10 @@ db_stack_trace_cmd(
case Frame:
regs = arg.frame;
break;
-
+
+ case Proc:
+ break;
+
case Stack:
{
unsigned val1, val2, sxip;
@@ -1139,7 +1147,7 @@ db_stack_trace_cmd(
frame.sxip = sxip | 2;
frame.snip = frame.sxip + 4;
frame.sfip = frame.snip + 4;
-db_printf("[r31=%x, sxip=%x]\n", frame.r[31], frame.sxip);
+ db_printf("[r31=%x, sxip=%x]\n", frame.r[31], frame.sxip);
regs = &frame;
}
}
diff --git a/sys/arch/mvme88k/dev/bugio.c b/sys/arch/mvme88k/dev/bugio.c
index 19cfef7804e..eafea1b7a1c 100644
--- a/sys/arch/mvme88k/dev/bugio.c
+++ b/sys/arch/mvme88k/dev/bugio.c
@@ -1,5 +1,7 @@
-/* $OpenBSD: bugio.c,v 1.6 2001/02/12 08:16:21 smurph Exp $ */
+/* $OpenBSD: bugio.c,v 1.7 2001/03/09 05:44:38 smurph Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr. */
+#include <sys/param.h>
+#include <sys/systm.h>
#include <machine/bugio.h>
#define INCHR "0x0000"
@@ -16,7 +18,7 @@
#define OUTSTR "0x0021"
#define PCRLF "0x0026"
#define TMDISP "0x0042"
-#define DELAY "0x0043"
+#define BUGDELAY "0x0043"
#define RTC_DSP "0x0052"
#define RTC_RD "0x0053"
#define RETURN "0x0063"
@@ -76,6 +78,7 @@ buginchr(void)
return ((char)ret & 0xFF);
}
+void
bugoutchr(unsigned char c)
{
unsigned char cc;
@@ -86,16 +89,14 @@ bugoutchr(unsigned char c)
}
BUGCTXT();
-
asm("or r2,r0,%0" : : "r" (cc));
asm("or r9,r0," OUTCHR);
asm("tb0 0,r0,0x1F0");
-
OSCTXT();
}
/* return 1 if not empty else 0 */
-
+int
buginstat(void)
{
register int ret;
@@ -108,6 +109,7 @@ buginstat(void)
return (ret & 0x4 ? 0 : 1);
}
+void
bugoutstr(char *s, char *se)
{
BUGCTXT();
@@ -116,6 +118,7 @@ bugoutstr(char *s, char *se)
OSCTXT();
}
+void
bugpcrlf(void)
{
BUGCTXT();
@@ -125,7 +128,7 @@ bugpcrlf(void)
}
/* return 0 on success */
-
+int
bugdskrd(struct bugdisk_io *arg)
{
int ret;
@@ -140,7 +143,7 @@ bugdskrd(struct bugdisk_io *arg)
}
/* return 0 on success */
-
+int
bugdskwr(struct bugdisk_io *arg)
{
int ret;
@@ -152,6 +155,7 @@ bugdskwr(struct bugdisk_io *arg)
return ((ret&0x4) == 0x4 ? 1 : 0);
}
+void
bugrtcrd(struct bugrtc *rtc)
{
BUGCTXT();
@@ -160,23 +164,29 @@ bugrtcrd(struct bugrtc *rtc)
OSCTXT();
}
+void
bugdelay(int delay)
{
BUGCTXT();
asm("or r2,r0,%0" : : "r" (delay));
- asm("or r9,r0, " DELAY);
+ asm("or r9,r0, " BUGDELAY);
asm("tb0 0,r0,0x1F0");
OSCTXT();
}
+int
bugfork(int cpu, unsigned address)
{
+ register int ret;
BUGCTXT();
asm("or r9,r0, " FORKMPU);
asm("tb0 0,r0,0x1F0");
+ asm volatile ("or %0,r0,r2" : "=r" (ret) : );
OSCTXT();
+ return(ret);
}
+void
bugreturn(void)
{
BUGCTXT();
@@ -185,6 +195,7 @@ bugreturn(void)
OSCTXT();
}
+void
bugbrdid(struct bugbrdid *id)
{
struct bugbrdid *ptr;
@@ -196,6 +207,7 @@ bugbrdid(struct bugbrdid *id)
bcopy(ptr, id, sizeof(struct bugbrdid));
}
+void
bugnetctrl(struct bugniocall *niocall)
{
/* BUGCTXT();*/
@@ -240,11 +252,15 @@ struct bugniotcall {
unsigned long cntrlflag;
};
+int
bugnetcfg(struct bugniotcall *niotcall)
{
+ register int ret;
/* BUGCTXT();*/
asm("or r2,r0,%0" : : "r" (niotcall));
asm("or r9,r0, " NETCTRL);
asm("tb0 0,r0,0x1F0");
+ asm volatile ("or %0,r0,r2" : "=r" (ret) : );
/* OSCTXT();*/
+ return(ret);
}
diff --git a/sys/arch/mvme88k/dev/bugtty.c b/sys/arch/mvme88k/dev/bugtty.c
index e198e426e6c..99750a59e81 100644
--- a/sys/arch/mvme88k/dev/bugtty.c
+++ b/sys/arch/mvme88k/dev/bugtty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugtty.c,v 1.6 2001/03/08 00:03:12 miod Exp $ */
+/* $OpenBSD: bugtty.c,v 1.7 2001/03/09 05:44:38 smurph Exp $ */
/* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
* All rights reserved.
@@ -133,7 +133,7 @@ int bugttyswflags;
struct tty *
bugttytty(dev)
-dev_t dev;
+ dev_t dev;
{
int unit;
unit = BUGTTYUNIT(dev);
@@ -144,9 +144,9 @@ dev_t dev;
}
int
-bugttymctl(dev, bits, how)
-dev_t dev;
-int bits, how;
+ bugttymctl(dev, bits, how)
+ dev_t dev;
+ int bits, how;
{
int s;
@@ -181,9 +181,9 @@ int bits, how;
int
bugttyopen(dev, flag, mode, p)
-dev_t dev;
-int flag, mode;
-struct proc *p;
+ dev_t dev;
+ int flag, mode;
+ struct proc *p;
{
int s, unit = BUGTTYUNIT(dev);
struct tty *tp;
@@ -270,7 +270,7 @@ bugttyparam(tp, tm)
void
bugttyoutput(tp)
-struct tty *tp;
+ struct tty *tp;
{
int cc, s, cnt ;
@@ -292,9 +292,9 @@ struct tty *tp;
int
bugttyclose(dev, flag, mode, p)
-dev_t dev;
-int flag, mode;
-struct proc *p;
+ dev_t dev;
+ int flag, mode;
+ struct proc *p;
{
int unit = BUGTTYUNIT(dev);
struct tty *tp = bugtty_tty[unit];
@@ -310,9 +310,9 @@ struct proc *p;
int
bugttyread(dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
struct tty *tp;
@@ -344,9 +344,9 @@ bugtty_chkinput()
int
bugttywrite(dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
#if 0
/* bypass tty output routines. */
@@ -373,11 +373,11 @@ int flag;
int
bugttyioctl(dev, cmd, data, flag, p)
-dev_t dev;
-int cmd;
-caddr_t data;
-int flag;
-struct proc *p;
+ dev_t dev;
+ int cmd;
+ caddr_t data;
+ int flag;
+ struct proc *p;
{
int unit = BUGTTYUNIT(dev);
struct tty *tp = bugtty_tty[unit];
@@ -447,8 +447,8 @@ struct proc *p;
int
bugttystop(tp, flag)
-struct tty *tp;
-int flag;
+ struct tty *tp;
+ int flag;
{
int s;
@@ -466,7 +466,7 @@ int flag;
*/
int
bugttycnprobe(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
int maj;
int needprom = 1;
@@ -503,7 +503,7 @@ struct consdev *cp;
int
bugttycninit(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
/* Nothing to do */
return 0;
@@ -511,15 +511,15 @@ struct consdev *cp;
int
bugttycngetc(dev)
-dev_t dev;
+ dev_t dev;
{
return (buginchr());
}
void
bugttycnputc(dev, c)
-dev_t dev;
-char c;
+ dev_t dev;
+ char c;
{
if (c == '\n')
bugoutchr('\r');
diff --git a/sys/arch/mvme88k/dev/busswitch.c b/sys/arch/mvme88k/dev/busswitch.c
index e62261cd43f..8be2af870e3 100644
--- a/sys/arch/mvme88k/dev/busswitch.c
+++ b/sys/arch/mvme88k/dev/busswitch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: busswitch.c,v 1.3 2001/03/08 00:03:13 miod Exp $ */
+/* $OpenBSD: busswitch.c,v 1.4 2001/03/09 05:44:38 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -128,9 +128,9 @@ busswitch_scan(parent, child, args)
struct confargs oca;
if (parent->dv_cfdata->cf_driver->cd_indirect) {
- printf(" indirect devices not supported\n");
- return 0;
- }
+ printf(" indirect devices not supported\n");
+ return 0;
+ }
bzero(&oca, sizeof oca);
oca.ca_offset = cf->cf_loc[0];
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c
index ab0119b0643..a7d3725527d 100644
--- a/sys/arch/mvme88k/dev/cl.c
+++ b/sys/arch/mvme88k/dev/cl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.c,v 1.9 2001/03/07 23:45:50 miod Exp $ */
+/* $OpenBSD: cl.c,v 1.10 2001/03/09 05:44:38 smurph Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -756,9 +756,9 @@ int clclose (dev, flag, mode, p)
return 0;
}
int clread (dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
int unit, channel;
struct tty *tp;
@@ -778,9 +778,9 @@ int flag;
}
int clwrite (dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
int unit, channel;
struct tty *tp;
@@ -800,11 +800,11 @@ int flag;
}
int clioctl (dev, cmd, data, flag, p)
-dev_t dev;
-int cmd;
-caddr_t data;
-int flag;
-struct proc *p;
+ dev_t dev;
+ int cmd;
+ caddr_t data;
+ int flag;
+ struct proc *p;
{
int error;
int unit, channel;
@@ -905,7 +905,7 @@ clstop(tp, flag)
int
clcnprobe(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
/* always there ? */
/* serial major */
@@ -928,7 +928,7 @@ struct consdev *cp;
int
clcninit(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
volatile struct clreg *cl_reg;
@@ -1329,7 +1329,9 @@ clccparam(sc, par, channel)
return imask;
}
+
static int clknum = 0;
+
u_char
cl_clkdiv(speed)
int speed;
@@ -1699,8 +1701,8 @@ log(LOG_WARNING, "cl_txintr: DMAMODE channel %x dmabsts %x risrl %x risrh %x\n",
status = sc->cl_reg->cl_brbsts;
}
#ifdef DMA_DEBUG
-log(LOG_WARNING, "cl_rxintr: 1channel %x buf %x cnt %x status %x\n",
-channel, nbuf, cnt, status);
+ log(LOG_WARNING, "cl_rxintr: 1channel %x buf %x cnt %x status %x\n",
+ channel, nbuf, cnt, status);
#endif
#if USE_BUFFER
cl_appendbufn(sc, channel, sc->rx[nbuf], cnt);
@@ -1804,10 +1806,10 @@ channel, nbuf, cnt, status);
void
cl_overflow (sc, channel, ptime, msg)
-struct clsoftc *sc;
-int channel;
-long *ptime;
-u_char *msg;
+ struct clsoftc *sc;
+ int channel;
+ long *ptime;
+ u_char *msg;
{
/*
if (*ptime != time.tv_sec) {
diff --git a/sys/arch/mvme88k/dev/clock.c b/sys/arch/mvme88k/dev/clock.c
index e5673a1cce9..300a55353f4 100644
--- a/sys/arch/mvme88k/dev/clock.c
+++ b/sys/arch/mvme88k/dev/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.9 2001/03/07 23:45:50 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.10 2001/03/09 05:44:38 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
@@ -150,8 +150,8 @@ u_char prof_reset;
*/
int
clockmatch(parent, vcf, args)
-struct device *parent;
-void *vcf, *args;
+ struct device *parent;
+ void *vcf, *args;
{
register struct confargs *ca = args;
register struct cfdata *cf = vcf;
@@ -173,8 +173,8 @@ void *vcf, *args;
void
clockattach(parent, self, args)
-struct device *parent, *self;
-void *args;
+ struct device *parent, *self;
+ void *args;
{
struct confargs *ca = args;
struct clocksoftc *sc = (struct clocksoftc *)self;
@@ -254,7 +254,7 @@ sbc_clockintr(eframe)
#endif /* NPCCTWO */
int
delay(us)
-register int us;
+ register int us;
{
volatile register int c;
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c
index c54e57717af..3cdfa6ef919 100644
--- a/sys/arch/mvme88k/dev/dart.c
+++ b/sys/arch/mvme88k/dev/dart.c
@@ -144,7 +144,7 @@ struct dart_s {
int
dart_speed(speed)
-int speed;
+ int speed;
{
struct dart_s *ds = dart_speeds;
while (ds->kspeed != 0xFFFF) {
@@ -157,7 +157,7 @@ int speed;
struct tty*
darttty(dev)
-dev_t dev;
+ dev_t dev;
{
int port;
struct dartsoftc *sc;
@@ -168,8 +168,8 @@ dev_t dev;
int
dartmatch(parent, vcf, args)
-struct device *parent;
-void *vcf, *args;
+ struct device *parent;
+ void *vcf, *args;
{
struct confargs *ca = args;
union dartreg *addr;
@@ -187,9 +187,9 @@ void *vcf, *args;
void
dartattach(parent, self, aux)
-struct device *parent;
-struct device *self;
-void *aux;
+ struct device *parent;
+ struct device *self;
+ void *aux;
{
struct dartsoftc *sc = (struct dartsoftc *)self;
struct confargs *ca = aux;
@@ -298,7 +298,7 @@ void *aux;
*/
void
dartstart(tp)
-struct tty *tp;
+ struct tty *tp;
{
dev_t dev;
struct dartsoftc *sc;
@@ -386,8 +386,8 @@ bail:
*/
int
dartstop(tp, flag)
-struct tty *tp;
-int flag;
+ struct tty *tp;
+ int flag;
{
int s;
s = spltty();
@@ -421,9 +421,9 @@ int flag;
int
dartmctl (dev, flags, how)
-dev_t dev;
-int flags;
-int how;
+ dev_t dev;
+ int flags;
+ int how;
{
union dartreg *addr;
int port;
@@ -497,8 +497,8 @@ int how;
*/
void
dartbreak(dev, state)
-dev_t dev;
-int state;
+ dev_t dev;
+ int state;
{
union dartreg *addr;
union dart_pt_io *ptaddr;
@@ -529,11 +529,11 @@ int state;
int
dartioctl (dev, cmd, data, flag, p)
-dev_t dev;
-int cmd;
-caddr_t data;
-int flag;
-struct proc *p;
+ dev_t dev;
+ int cmd;
+ caddr_t data;
+ int flag;
+ struct proc *p;
{
int error;
int port;
@@ -615,8 +615,8 @@ struct proc *p;
*/
int
dartparam(tp, t)
-struct tty *tp;
-struct termios *t;
+ struct tty *tp;
+ struct termios *t;
{
union dartreg *addr;
union dart_pt_io *ptaddr;
@@ -759,9 +759,9 @@ struct termios *t;
void
dartmodemtrans(sc, ip, ipcr)
-struct dartsoftc *sc;
-unsigned int ip;
-unsigned int ipcr;
+ struct dartsoftc *sc;
+ unsigned int ip;
+ unsigned int ipcr;
{
unsigned int dcdstate;
struct tty *tp;
@@ -794,10 +794,10 @@ unsigned int ipcr;
int
dartopen (dev, flag, mode, p)
-dev_t dev;
-int flag;
-int mode;
-struct proc *p;
+ dev_t dev;
+ int flag;
+ int mode;
+ struct proc *p;
{
int s, port;
struct dart_info *dart;
@@ -856,10 +856,10 @@ struct proc *p;
int
dartclose (dev, flag, mode, p)
-dev_t dev;
-int flag;
-int mode;
-struct proc *p;
+ dev_t dev;
+ int flag;
+ int mode;
+ struct proc *p;
{
struct tty *tp;
struct dart_info *dart;
@@ -881,9 +881,9 @@ struct proc *p;
int
dartread (dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
int port;
struct tty *tp;
@@ -904,9 +904,9 @@ int flag;
int
dartwrite(dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
int port;
struct tty *tp;
@@ -927,8 +927,8 @@ int flag;
void
dartrint(sc, port)
-struct dartsoftc *sc;
-int port;
+ struct dartsoftc *sc;
+ int port;
{
union dartreg *addr;
union dart_pt_io *ptaddr;
@@ -1017,8 +1017,8 @@ int port;
void
dartxint(sc, port)
-struct dartsoftc *sc;
-int port;
+ struct dartsoftc *sc;
+ int port;
{
struct tty *tp;
struct dart_info *dart;
@@ -1130,7 +1130,7 @@ dartintr(arg)
int
dartcnprobe(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
int maj;
@@ -1150,7 +1150,7 @@ struct consdev *cp;
int
dartcninit(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
dart_cons = A_PORT;
return 0;
@@ -1158,8 +1158,8 @@ struct consdev *cp;
void
dartcnputc(dev, c)
-dev_t dev;
-char c;
+ dev_t dev;
+ char c;
{
union dartreg *addr;
union dart_pt_io *ptaddr;
@@ -1223,7 +1223,7 @@ char c;
int
dartcngetc(dev)
-dev_t dev;
+ dev_t dev;
{
union dartreg *addr; /* pointer to DUART regs */
union dart_pt_io *ptaddr; /* pointer to port regs */
diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c
index aa51cdaa6fd..f42566b9d4d 100644
--- a/sys/arch/mvme88k/dev/if_ie.c
+++ b/sys/arch/mvme88k/dev/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.9 2001/03/07 23:45:51 miod Exp $ */
+/* $OpenBSD: if_ie.c,v 1.10 2001/03/09 05:44:38 smurph Exp $ */
/*-
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -181,7 +181,7 @@ struct ie_softc {
void (*run_596)(); /* card depenent "go on-line" function */
void (*memcopy) __P((const void *, void *, u_int));
/* card dependent memory copy function */
- void (*memzero) __P((void *, u_int));
+ void (*memzero) __P((void *, u_int));
/* card dependent memory zero function */
int want_mcsetup; /* mcsetup flag */
int promisc; /* are we in promisc mode? */
@@ -209,7 +209,7 @@ struct ie_softc {
volatile struct ie_recv_frame_desc *rframes[MXFRAMES];
volatile struct ie_recv_buf_desc *rbuffs[MXRXBUF];
volatile char *cbuffs[MXRXBUF];
- int rfhead, rftail, rbhead, rbtail;
+ int rfhead, rftail, rbhead, rbtail;
volatile struct ie_xmit_cmd *xmit_cmds[NTXBUF];
volatile struct ie_xmit_buf *xmit_buffs[NTXBUF];
@@ -238,6 +238,7 @@ struct ie_softc {
static void ie_obreset __P((struct ie_softc *));
static void ie_obattend __P((struct ie_softc *));
static void ie_obrun __P((struct ie_softc *));
+int ie_setupram __P((struct ie_softc *sc));
void iewatchdog __P((struct ifnet *));
int ieintr __P((void *));
@@ -267,6 +268,7 @@ int in_ietint = 0;
int iematch();
void ieattach();
+extern void pcctwointr_establish();
struct cfattach ie_ca = {
sizeof(struct ie_softc), iematch, ieattach
@@ -337,7 +339,7 @@ iematch(parent, vcf, args)
struct confargs *ca = args;
int ret;
- if ((ret = badvaddr(IIOV(ca->ca_vaddr), 1)) <=0){
+ if ((ret = badvaddr((unsigned)IIOV(ca->ca_vaddr), 1)) <=0){
return(0);
}
return(1);
@@ -516,7 +518,7 @@ void *v;
*/
int
ieintr(v)
-void *v;
+ void *v;
{
struct ie_softc *sc = v;
register u_short status;
diff --git a/sys/arch/mvme88k/dev/if_ve.c b/sys/arch/mvme88k/dev/if_ve.c
index 39f7b2c0cb7..e528830b612 100644
--- a/sys/arch/mvme88k/dev/if_ve.c
+++ b/sys/arch/mvme88k/dev/if_ve.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ve.c,v 1.5 2001/03/08 00:03:13 miod Exp $ */
+/* $OpenBSD: if_ve.c,v 1.6 2001/03/09 05:44:39 smurph Exp $ */
/*-
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1982, 1992, 1993
@@ -143,9 +143,9 @@ hide u_int16_t verdcsr __P((struct vam7990_softc *, u_int16_t));
/* send command to the nvram controller */
void
nvram_cmd(sc, cmd, addr )
-struct vam7990_softc *sc;
-u_char cmd;
-u_short addr;
+ struct vam7990_softc *sc;
+ u_char cmd;
+ u_short addr;
{
int i;
u_char rcmd = 0;
@@ -163,8 +163,8 @@ u_short addr;
/* read nvram one bit at a time */
u_int16_t
nvram_read(sc, nvram_addr)
-struct vam7990_softc *sc;
-u_char nvram_addr;
+ struct vam7990_softc *sc;
+ u_char nvram_addr;
{
u_short val = 0, mask = 0x04000;
u_int16_t wbit;
@@ -217,7 +217,7 @@ verdcsr(sc, port)
/* reset MVME376, set ipl and vec */
void
vereset(sc)
-struct vam7990_softc *sc;
+ struct vam7990_softc *sc;
{
register struct vereg1 *reg1 = ((struct ve_softc *)sc)->sc_r1;
u_char vec = ((struct ve_softc *)sc)->sc_vec;
@@ -231,7 +231,7 @@ struct vam7990_softc *sc;
/* ack the intrrupt by reenableling interrupts */
void
ve_ackint(sc)
-struct vam7990_softc *sc;
+ struct vam7990_softc *sc;
{
register struct vereg1 *reg1 = ((struct ve_softc *)sc)->sc_r1;
ENABLE_INTR;
@@ -240,12 +240,12 @@ struct vam7990_softc *sc;
int
vematch(parent, vcf, args)
-struct device *parent;
-void *vcf, *args;
+ struct device *parent;
+ void *vcf, *args;
{
struct confargs *ca = args;
- if (!badvaddr(ca->ca_vaddr, 1)) {
+ if (!badvaddr((unsigned)ca->ca_vaddr, 1)) {
return (1);
} else {
return (0);
@@ -259,9 +259,9 @@ void *vcf, *args;
*/
void
veattach(parent, self, aux)
-struct device *parent;
-struct device *self;
-void *aux;
+ struct device *parent;
+ struct device *self;
+ void *aux;
{
register struct ve_softc *lesc = (struct ve_softc *)self;
struct vam7990_softc *sc = &lesc->sc_am7990;
@@ -338,7 +338,7 @@ void *aux;
void
veetheraddr(sc)
-struct vam7990_softc *sc;
+ struct vam7990_softc *sc;
{
u_char * cp = sc->sc_arpcom.ac_enaddr;
u_int16_t ival[3];
@@ -352,7 +352,7 @@ struct vam7990_softc *sc;
void
ve_config(sc)
-struct vam7990_softc *sc;
+ struct vam7990_softc *sc;
{
int mem;
@@ -449,7 +449,7 @@ ve_reset(sc)
*/
void
ve_meminit(sc)
-register struct vam7990_softc *sc;
+ register struct vam7990_softc *sc;
{
u_long a;
int bix;
diff --git a/sys/arch/mvme88k/dev/nvram.c b/sys/arch/mvme88k/dev/nvram.c
index 97f51e5e57c..a6a9f5d098a 100644
--- a/sys/arch/mvme88k/dev/nvram.c
+++ b/sys/arch/mvme88k/dev/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.8 2001/03/08 00:03:14 miod Exp $ */
+/* $OpenBSD: nvram.c,v 1.9 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -83,8 +83,8 @@ int nvrammmap __P((dev_t dev, int off, int prot));
int
nvrammatch(parent, vcf, args)
-struct device *parent;
-void *vcf, *args;
+ struct device *parent;
+ void *vcf, *args;
{
#if 0
int ret;
@@ -116,8 +116,8 @@ void *vcf, *args;
void
nvramattach(parent, self, args)
-struct device *parent, *self;
-void *args;
+ struct device *parent, *self;
+ void *args;
{
struct confargs *ca = args;
struct nvramsoftc *sc = (struct nvramsoftc *)self;
@@ -159,13 +159,12 @@ void *args;
*/
void
microtime(tvp)
-register struct timeval *tvp;
+ register struct timeval *tvp;
{
int s = splhigh();
static struct timeval lasttime;
*tvp = time;
- tvp->tv_usec;
while (tvp->tv_usec >= 1000000) {
tvp->tv_sec++;
tvp->tv_usec -= 1000000;
@@ -199,7 +198,7 @@ const short dayyr[12] =
static u_long
chiptotime(sec, min, hour, day, mon, year)
-register int sec, min, hour, day, mon, year;
+ register int sec, min, hour, day, mon, year;
{
register int days, yr;
@@ -301,7 +300,7 @@ timetochip(c)
void
inittodr(base)
-time_t base;
+ time_t base;
{
struct nvramsoftc *sc = (struct nvramsoftc *) nvram_cd.cd_devs[0];
int sec, min, hour, day, mon, year;
@@ -410,8 +409,8 @@ void resettodr()
/*ARGSUSED*/
int
nvramopen(dev, flag, mode)
-dev_t dev;
-int flag, mode;
+ dev_t dev;
+ int flag, mode;
{
if (minor(dev) >= nvram_cd.cd_ndevs ||
nvram_cd.cd_devs[minor(dev)] == NULL)
@@ -422,8 +421,8 @@ int flag, mode;
/*ARGSUSED*/
int
nvramclose(dev, flag, mode)
-dev_t dev;
-int flag, mode;
+ dev_t dev;
+ int flag, mode;
{
return (0);
}
@@ -455,9 +454,9 @@ nvramioctl(dev, cmd, data, flag, p)
/*ARGSUSED*/
int
nvramread(dev, uio, flags)
-dev_t dev;
-struct uio *uio;
-int flags;
+ dev_t dev;
+ struct uio *uio;
+ int flags;
{
int unit = minor(dev);
struct nvramsoftc *sc = (struct nvramsoftc *) nvram_cd.cd_devs[unit];
@@ -468,9 +467,9 @@ int flags;
/*ARGSUSED*/
int
nvramwrite(dev, uio, flags)
-dev_t dev;
-struct uio *uio;
-int flags;
+ dev_t dev;
+ struct uio *uio;
+ int flags;
{
int unit = minor(dev);
struct nvramsoftc *sc = (struct nvramsoftc *) nvram_cd.cd_devs[unit];
@@ -485,8 +484,8 @@ int flags;
*/
int
nvrammmap(dev, off, prot)
-dev_t dev;
-int off, prot;
+ dev_t dev;
+ int off, prot;
{
int unit = minor(dev);
struct nvramsoftc *sc = (struct nvramsoftc *) nvram_cd.cd_devs[unit];
diff --git a/sys/arch/mvme88k/dev/pcc2.c b/sys/arch/mvme88k/dev/pcc2.c
index c78cbb24a81..6545be0f98c 100644
--- a/sys/arch/mvme88k/dev/pcc2.c
+++ b/sys/arch/mvme88k/dev/pcc2.c
@@ -191,7 +191,6 @@ pcc_handler(struct exception_frame *except)
}
}
-
int
abort_handler()
{
@@ -201,6 +200,7 @@ abort_handler()
Debugger();
return 0;
}
+
static void abort_setup()
{
printf("PCC_ABRT_ICR %x\n",&PCC_ABRT_ICR(pcc_io_base));
diff --git a/sys/arch/mvme88k/dev/sclock.c b/sys/arch/mvme88k/dev/sclock.c
index e129aa29703..30feb7d3e0d 100644
--- a/sys/arch/mvme88k/dev/sclock.c
+++ b/sys/arch/mvme88k/dev/sclock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sclock.c,v 1.4 2001/03/07 23:45:51 miod Exp $ */
+/* $OpenBSD: sclock.c,v 1.5 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
*
@@ -150,8 +150,8 @@ u_char stat_reset;
*/
int
sclockmatch(parent, vcf, args)
-struct device *parent;
-void *vcf, *args;
+ struct device *parent;
+ void *vcf, *args;
{
register struct confargs *ca = args;
register struct cfdata *cf = vcf;
@@ -173,8 +173,8 @@ void *vcf, *args;
void
sclockattach(parent, self, args)
-struct device *parent, *self;
-void *args;
+ struct device *parent, *self;
+ void *args;
{
struct confargs *ca = args;
struct sclocksoftc *sc = (struct sclocksoftc *)self;
@@ -349,7 +349,7 @@ m188_initstatclock(void)
/* Write CIO register */
void
write_cio(reg, val)
-unsigned reg,val;
+ unsigned reg,val;
{
int s, i;
volatile int *cio_ctrl = (volatile int *)CIO_CNTRL;
@@ -371,7 +371,7 @@ unsigned reg,val;
/* Read CIO register */
static u_char
read_cio(reg)
-unsigned reg;
+ unsigned reg;
{
int c;
int s, i;
@@ -398,7 +398,8 @@ unsigned reg;
*/
void
-m188_cio_init(unsigned p)
+m188_cio_init(p)
+ unsigned p;
{
long i;
short period;
diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c
index 6be20e2d605..9ddd0ff2f1f 100644
--- a/sys/arch/mvme88k/dev/ssh.c
+++ b/sys/arch/mvme88k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.2 2001/03/07 23:47:20 miod Exp $ */
+/* $OpenBSD: ssh.c,v 1.3 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -63,8 +63,6 @@
#include <mvme88k/dev/sshreg.h>
#include <mvme88k/dev/sshvar.h>
-extern u_int kvtop();
-
/*
* SCSI delays
* In u-seconds, primarily for state changes on the SPC.
@@ -580,7 +578,7 @@ sshinitialize(sc)
* Also should verify that dev doesn't span non-contiguous
* physical pages.
*/
- sc->sc_scriptspa = kvtop(scripts);
+ sc->sc_scriptspa = kvtop((vm_offset_t)scripts);
/*
* malloc sc_acb to ensure that DS is on a long word boundary.
@@ -754,20 +752,20 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
acb->msg[0] = -1;
acb->ds.scsi_addr = (0x10000 << target) | (sc->sc_sync[target].sxfer << 8);
acb->ds.idlen = 1;
- acb->ds.idbuf = (char *) kvtop(&acb->msgout[0]);
+ acb->ds.idbuf = (char *) kvtop((vm_offset_t)&acb->msgout[0]);
acb->ds.cmdlen = clen;
- acb->ds.cmdbuf = (char *) kvtop(cbuf);
+ acb->ds.cmdbuf = (char *) kvtop((vm_offset_t)cbuf);
acb->ds.stslen = 1;
- acb->ds.stsbuf = (char *) kvtop(&acb->stat[0]);
+ acb->ds.stsbuf = (char *) kvtop((vm_offset_t)&acb->stat[0]);
acb->ds.msglen = 1;
- acb->ds.msgbuf = (char *) kvtop(&acb->msg[0]);
+ acb->ds.msgbuf = (char *) kvtop((vm_offset_t)&acb->msg[0]);
acb->msg[1] = -1;
acb->ds.msginlen = 1;
acb->ds.extmsglen = 1;
acb->ds.synmsglen = 3;
- acb->ds.msginbuf = (char *) kvtop(&acb->msg[1]);
- acb->ds.extmsgbuf = (char *) kvtop(&acb->msg[2]);
- acb->ds.synmsgbuf = (char *) kvtop(&acb->msg[3]);
+ acb->ds.msginbuf = (char *) kvtop((vm_offset_t)&acb->msg[1]);
+ acb->ds.extmsgbuf = (char *) kvtop((vm_offset_t)&acb->msg[2]);
+ acb->ds.synmsgbuf = (char *) kvtop((vm_offset_t)&acb->msg[3]);
bzero(&acb->ds.chain, sizeof (acb->ds.chain));
if (sc->sc_sync[target].state == SYNC_START) {
@@ -811,7 +809,7 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
addr = buf;
dmaend = NULL;
while (count > 0) {
- acb->ds.chain[nchain].databuf = (char *) kvtop (addr);
+ acb->ds.chain[nchain].databuf = (char *) kvtop((vm_offset_t)addr);
if (count < (tcount = NBPG - ((int) addr & PGOFSET)))
tcount = count;
acb->ds.chain[nchain].datalen = tcount;
@@ -885,7 +883,7 @@ ssh_start (sc, target, lun, cbuf, clen, buf, len)
sc->sc_dev.dv_xname);
rp->ssh_temp = 0;
rp->ssh_sbcl = sc->sc_sync[target].sbcl;
- rp->ssh_dsa = kvtop(&acb->ds);
+ rp->ssh_dsa = kvtop((vm_offset_t)&acb->ds);
rp->ssh_dsp = sc->sc_scriptspa;
SSH_TRACE('s',1,0,0)
} else {
@@ -969,9 +967,9 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff00) {
/* Normal completion status, or check condition */
#ifdef DEBUG
- if (rp->ssh_dsa != kvtop(&acb->ds)) {
+ if (rp->ssh_dsa != kvtop((vm_offset_t)&acb->ds)) {
printf ("ssh: invalid dsa: %x %x\n", rp->ssh_dsa,
- kvtop(&acb->ds));
+ kvtop((vm_offset_t)&acb->ds));
panic("*** ssh DSA invalid ***");
}
#endif
@@ -1030,7 +1028,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
}
}
#if CACHECTL
- /*cmmu_inval_cache(kvtop(&acb->stat[0]), 1);*/
+ /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->stat[0]), 1);*/
dma_cachectl(&acb->stat[0], 1);
#endif
*status = acb->stat[0];
@@ -1335,7 +1333,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
#if CACHECTL
dma_cachectl(&acb->stat[0], sizeof(acb->stat[0]));
#endif
- rp->ssh_dsa = kvtop(&acb->ds);
+ rp->ssh_dsa = kvtop((vm_offset_t)&acb->ds);
rp->ssh_sxfer = sc->sc_sync[acb->xs->sc_link->target].sxfer;
rp->ssh_sbcl = sc->sc_sync[acb->xs->sc_link->target].sbcl;
break;
@@ -1381,7 +1379,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
}
target = sc->sc_nexus->xs->sc_link->target;
rp->ssh_temp = 0;
- rp->ssh_dsa = kvtop(&sc->sc_nexus->ds);
+ rp->ssh_dsa = kvtop((vm_offset_t)&sc->sc_nexus->ds);
rp->ssh_sxfer = sc->sc_sync[target].sxfer;
rp->ssh_sbcl = sc->sc_sync[target].sbcl;
rp->ssh_dsp = sc->sc_scriptspa;
@@ -1393,13 +1391,13 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
sc->sc_dev.dv_xname);
/* Unrecognized message in byte */
#if CACHECTL
- /*cmmu_inval_cache(kvtop(&acb->msg[1]), 1);*/
+ /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->msg[1]), 1);*/
dma_cachectl (&acb->msg[1],1);
#endif
printf ("%s: Unrecognized message in data sfbr %x msg %x sbcl %x\n",
sc->sc_dev.dv_xname, rp->ssh_sfbr, acb->msg[1], rp->ssh_sbcl);
/* what should be done here? */
- /*DCIAS(kvtop(&acb->msg[1]));*/
+ /*DCIAS(kvtop((vm_offset_t)&acb->msg[1]));*/
rp->ssh_dsp = sc->sc_scriptspa + Ent_switch;
return (0);
}
@@ -1605,8 +1603,8 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
if (sstat0 == 0 && dstat & SSH_DSTAT_SIR) {
#if CACHECTL
- /*cmmu_inval_cache(kvtop(&acb->stat[0]), 1); */
- /*cmmu_inval_cache(kvtop(&acb->msg[0]), 1); */
+ /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->stat[0]), 1); */
+ /*cmmu_inval_cache(kvtop((vm_offset_t)&acb->msg[0]), 1); */
dma_cachectl (&acb->stat[0], 1);
dma_cachectl (&acb->msg[0], 1);
#endif
@@ -1642,7 +1640,7 @@ bad_phase:
*/
printf ("sshchkintr: target %x ds %x\n", target, &acb->ds);
printf ("scripts %x ds %x rp %x dsp %x dcmd %x\n", sc->sc_scriptspa,
- kvtop(&acb->ds), kvtop(rp), rp->ssh_dsp,
+ kvtop((vm_offset_t)&acb->ds), kvtop((vm_offset_t)rp), rp->ssh_dsp,
*((long *)&rp->ssh_dcmd));
printf ("sshchkintr: istat %x dstat %x sstat0 %x dsps %x "
"dsa %x sbcl %x sts %x msg %x %x sfbr %x\n",
@@ -1749,7 +1747,7 @@ sshintr (sc)
#ifdef DEBUG
if (ssh_debug & 5) {
#if CACHECTL
- /*cmmu_inval_cache(kvtop(&sc->sc_nexus->stat[0]),
+ /*cmmu_inval_cache(kvtop((vm_offset_t)&sc->sc_nexus->stat[0]),
sizeof(sc->sc_nexus->stat[0])); */
dma_cachectl(&sc->sc_nexus->stat[0],
sizeof(sc->sc_nexus->stat[0]));
diff --git a/sys/arch/mvme88k/dev/sshdma.c b/sys/arch/mvme88k/dev/sshdma.c
index 57ee1ad2785..b394146c61c 100644
--- a/sys/arch/mvme88k/dev/sshdma.c
+++ b/sys/arch/mvme88k/dev/sshdma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshdma.c,v 1.2 2001/03/07 23:47:20 miod Exp $ */
+/* $OpenBSD: sshdma.c,v 1.3 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
@@ -69,8 +69,9 @@ int afscmatch __P((struct device *, void *, void *));
void afscattach __P((struct device *, struct device *, void *));
int afscprint __P((void *auxp, char *));
-int sshintr __P((struct ssh_softc *));
+int sshintr __P((struct ssh_softc *));
int afsc_dmaintr __P((void *));
+void sshinitialize __P((struct ssh_softc *));
struct scsi_adapter afsc_scsiswitch = {
ssh_scsicmd,
diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c
index 3d56c575605..8a00619e570 100644
--- a/sys/arch/mvme88k/dev/syscon.c
+++ b/sys/arch/mvme88k/dev/syscon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscon.c,v 1.4 2001/03/07 23:45:52 miod Exp $ */
+/* $OpenBSD: syscon.c,v 1.5 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -110,8 +110,8 @@ int syscon_scan __P((struct device *parent, void *child, void *args));
int
sysconmatch(parent, vcf, args)
-struct device *parent;
-void *vcf, *args;
+ struct device *parent;
+ void *vcf, *args;
{
struct confargs *ca = args;
struct sysconreg *syscon;
@@ -126,8 +126,8 @@ void *vcf, *args;
int
syscon_print(args, bus)
-void *args;
-const char *bus;
+ void *args;
+ const char *bus;
{
struct confargs *ca = args;
@@ -140,8 +140,8 @@ const char *bus;
int
syscon_scan(parent, child, args)
-struct device *parent;
-void *child, *args;
+ struct device *parent;
+ void *child, *args;
{
struct cfdata *cf = child;
struct sysconsoftc *sc = (struct sysconsoftc *)parent;
@@ -174,8 +174,8 @@ void *child, *args;
void
sysconattach(parent, self, args)
-struct device *parent, *self;
-void *args;
+ struct device *parent, *self;
+ void *args;
{
struct confargs *ca = args;
struct sysconsoftc *sc = (struct sysconsoftc *)self;
@@ -224,8 +224,8 @@ void *args;
int
sysconintr_establish(vec, ih)
-int vec;
-struct intrhand *ih;
+ int vec;
+ struct intrhand *ih;
{
return (intr_establish(vec, ih));
}
diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c
index a62a9386d8a..0b7f6cd7ef0 100644
--- a/sys/arch/mvme88k/dev/vme.c
+++ b/sys/arch/mvme88k/dev/vme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.c,v 1.8 2001/03/07 23:45:52 miod Exp $ */
+/* $OpenBSD: vme.c,v 1.9 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1995 Theo de Raadt
@@ -285,14 +285,13 @@ vmescan(parent, child, args, bustype)
void
vmeattach(parent, self, args)
-struct device *parent, *self;
-void *args;
+ struct device *parent, *self;
+ void *args;
{
struct vmesoftc *sc = (struct vmesoftc *)self;
struct confargs *ca = args;
struct vme2reg *vme2;
int scon;
- char sconc;
/* XXX any initialization to do? */
@@ -316,11 +315,14 @@ void *args;
#endif
#if NSYSCON > 0
case BUS_SYSCON:
- vmevecbase = 0x80; /* Hard coded for MVME188 */
- sconc = *(char *)GLOBAL1;
- sconc &= M188_SYSCON;
- printf(": %ssystem controller\n", scon ? "" : "not ");
- vmesyscon_init(sc);
+ {
+ char sconc;
+ vmevecbase = 0x80; /* Hard coded for MVME188 */
+ sconc = *(char *)GLOBAL1;
+ sconc &= M188_SYSCON;
+ printf(": %ssystem controller\n", scon ? "" : "not ");
+ vmesyscon_init(sc);
+ }
break;
#endif
}
@@ -470,7 +472,7 @@ vme2chip_init(sc)
#if NSYSCON > 0
void
vmesyscon_init(sc)
-struct vmesoftc *sc;
+ struct vmesoftc *sc;
{
#ifdef TODO
struct sysconreg *syscon = (struct sysconreg *)sc->sc_vaddr;
@@ -516,13 +518,14 @@ vme2chip_map(base, len, dwidth)
{
switch (dwidth) {
case 16:
- return (base);
+ break;
case 32:
if (base < VME2_D32STARTPHYS ||
base + (u_long)len > VME2_D32ENDPHYS)
return (NULL);
- return (base);
+ break;
}
+ return (base);
}
#if NPCCTWO > 0
diff --git a/sys/arch/mvme88k/dev/vme.h b/sys/arch/mvme88k/dev/vme.h
index 98c64ddeaa6..7c3ad02230b 100644
--- a/sys/arch/mvme88k/dev/vme.h
+++ b/sys/arch/mvme88k/dev/vme.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vme.h,v 1.4 2001/02/01 03:38:15 smurph Exp $ */
+/* $OpenBSD: vme.h,v 1.5 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -378,5 +378,6 @@ void * vmemap __P((struct vmesoftc *sc, void * vmeaddr, int len, int bustype));
int vmerw __P((struct vmesoftc *sc, struct uio *uio, int flags, int bus));
int vmeintr_establish __P((int vec, struct intrhand *ih));
int vme_findvec __P((void));
+int vmescan __P((struct device *, void *, void *, int));
#endif __MVEME88K_DEV_VME_H__
diff --git a/sys/arch/mvme88k/dev/vmel.c b/sys/arch/mvme88k/dev/vmel.c
index 064a8fb4b26..ece0f933461 100644
--- a/sys/arch/mvme88k/dev/vmel.c
+++ b/sys/arch/mvme88k/dev/vmel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmel.c,v 1.2 1998/12/15 05:52:31 smurph Exp $ */
+/* $OpenBSD: vmel.c,v 1.3 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -118,8 +118,6 @@ vmelioctl(dev, cmd, data, flag, p)
int cmd, flag;
struct proc *p;
{
- int unit = minor(dev);
- struct vmelsoftc *sc = (struct vmelsoftc *) vmel_cd.cd_devs[unit];
int error = 0;
switch (cmd) {
diff --git a/sys/arch/mvme88k/dev/vmes.c b/sys/arch/mvme88k/dev/vmes.c
index dfe5a6cccb9..b9490861e17 100644
--- a/sys/arch/mvme88k/dev/vmes.c
+++ b/sys/arch/mvme88k/dev/vmes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmes.c,v 1.2 1998/12/15 05:52:31 smurph Exp $ */
+/* $OpenBSD: vmes.c,v 1.3 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -118,8 +118,6 @@ vmesioctl(dev, cmd, data, flag, p)
int cmd, flag;
struct proc *p;
{
- int unit = minor(dev);
- struct vmessoftc *sc = (struct vmessoftc *) vmes_cd.cd_devs[unit];
int error = 0;
switch (cmd) {
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c
index 13fb08a3b81..51587ba9aa7 100644
--- a/sys/arch/mvme88k/dev/vs.c
+++ b/sys/arch/mvme88k/dev/vs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs.c,v 1.4 2001/03/08 00:03:15 miod Exp $ */
+/* $OpenBSD: vs.c,v 1.5 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -101,9 +101,9 @@ extern u_int kvtop();
void
vs_copy(src, dst, cnt)
-void *src;
-void *dst;
-unsigned short cnt;
+ void *src;
+ void *dst;
+ unsigned short cnt;
{
register unsigned short volatile *x, *y, z;
@@ -118,8 +118,8 @@ unsigned short cnt;
void
vs_zero(src, cnt)
-void *src;
-u_long cnt;
+ void *src;
+ u_long cnt;
{
register unsigned short *source;
register unsigned short zero = 0;
@@ -139,7 +139,7 @@ u_long cnt;
*/
void
vs_minphys(bp)
-struct buf *bp;
+ struct buf *bp;
{
/*
* No max transfer at this level.
@@ -149,8 +149,8 @@ struct buf *bp;
int
do_vspoll(sc, to)
-struct vs_softc *sc;
-int to;
+ struct vs_softc *sc;
+ int to;
{
int i;
if (to <= 0 ) to = 50000;
@@ -178,8 +178,8 @@ int to;
int
vs_poll(sc, xs)
-struct vs_softc *sc;
-struct scsi_xfer *xs;
+ struct vs_softc *sc;
+ struct scsi_xfer *xs;
{
int status;
int to;
@@ -212,8 +212,8 @@ struct scsi_xfer *xs;
void
thaw_queue(sc, target)
-struct vs_softc *sc;
-u_int8_t target;
+ struct vs_softc *sc;
+ u_int8_t target;
{
u_short t;
t = target << 8;
@@ -225,9 +225,9 @@ u_int8_t target;
void
vs_scsidone (sc, xs, stat)
-struct vs_softc *sc;
-struct scsi_xfer *xs;
-int stat;
+ struct vs_softc *sc;
+ struct scsi_xfer *xs;
+ int stat;
{
int tgt;
xs->status = stat;
@@ -249,7 +249,7 @@ int stat;
int
vs_scsicmd(xs)
-struct scsi_xfer *xs;
+ struct scsi_xfer *xs;
{
struct scsi_link *slp = xs->sc_link;
struct vs_softc *sc = slp->adapter_softc;
@@ -398,7 +398,7 @@ struct scsi_xfer *xs;
void
vs_chksense(xs)
-struct scsi_xfer *xs;
+ struct scsi_xfer *xs;
{
int s;
struct scsi_link *slp = xs->sc_link;
@@ -453,7 +453,7 @@ struct scsi_xfer *xs;
M328_CQE *
vs_getcqe(sc)
-struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_MCSB *mcsb = (M328_MCSB *)&sc->sc_vsreg->sh_MCSB;
M328_CQE *cqep;
@@ -470,7 +470,7 @@ struct vs_softc *sc;
M328_IOPB *
vs_getiopb(sc)
-struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_MCSB *mcsb = (M328_MCSB *)&sc->sc_vsreg->sh_MCSB;
M328_IOPB *iopb;
@@ -488,7 +488,7 @@ struct vs_softc *sc;
int
vs_initialize(sc)
-struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_CIB *cib = (M328_CIB *)&sc->sc_vsreg->sh_CIB;
M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE;
@@ -600,7 +600,7 @@ struct vs_softc *sc;
void
vs_resync(sc)
-struct vs_softc *sc;
+ struct vs_softc *sc;
{
M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE;
M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB;
@@ -639,7 +639,7 @@ struct vs_softc *sc;
void
vs_reset(sc)
-struct vs_softc *sc;
+ struct vs_softc *sc;
{
u_int s;
M328_CQE *mc = (M328_CQE*)&sc->sc_vsreg->sh_MCE;
@@ -685,9 +685,9 @@ struct vs_softc *sc;
int
vs_checkintr(sc, xs, status)
-struct vs_softc *sc;
-struct scsi_xfer *xs;
-int *status;
+ struct vs_softc *sc;
+ struct scsi_xfer *xs;
+ int *status;
{
int target = -1;
int lun = -1;
@@ -780,7 +780,7 @@ int *status;
/* normal interrupt routine */
int
vs_nintr(sc)
-register struct vs_softc *sc;
+ register struct vs_softc *sc;
{
M328_CRB *crb = (M328_CRB *)&sc->sc_vsreg->sh_CRB;
M328_CMD *m328_cmd;
@@ -829,7 +829,7 @@ register struct vs_softc *sc;
int
vs_eintr(sc)
-register struct vs_softc *sc;
+ register struct vs_softc *sc;
{
M328_CEVSB *crb = (M328_CEVSB *)&sc->sc_vsreg->sh_CRB;
M328_CMD *m328_cmd;
@@ -909,7 +909,7 @@ register struct vs_softc *sc;
static __inline__ void
vs_clear_return_info(sc)
-register struct vs_softc *sc;
+ register struct vs_softc *sc;
{
M328_IOPB *riopb = (M328_IOPB *)&sc->sc_vsreg->sh_RET_IOPB;
M328_CEVSB *crb = (M328_CEVSB *)&sc->sc_vsreg->sh_CRB;
@@ -938,7 +938,7 @@ vs_alloc_scatter_gather(void)
void
vs_dealloc_scatter_gather(sg)
-M328_SG sg;
+ M328_SG sg;
{
register int i;
@@ -952,9 +952,9 @@ M328_SG sg;
void
vs_link_sg_element(element, phys_add, len)
-sg_list_element_t *element;
-register vm_offset_t phys_add;
-register int len;
+ sg_list_element_t *element;
+ register vm_offset_t phys_add;
+ register int len;
{
element->count.bytes = len;
LV(element->address, phys_add);
@@ -966,9 +966,9 @@ register int len;
void
vs_link_sg_list(list, phys_add, elements)
-sg_list_element_t *list;
-register vm_offset_t phys_add;
-register int elements;
+ sg_list_element_t *list;
+ register vm_offset_t phys_add;
+ register int elements;
{
list->count.scatter.gather = elements;
@@ -981,8 +981,8 @@ register int elements;
M328_SG
vs_build_memory_structure(xs, iopb)
-struct scsi_xfer *xs;
-M328_IOPB *iopb; /* the iopb */
+ struct scsi_xfer *xs;
+ M328_IOPB *iopb; /* the iopb */
{
M328_SG sg;
vm_offset_t starting_point_virt, starting_point_phys, point_virt,
diff --git a/sys/arch/mvme88k/dev/vsdma.c b/sys/arch/mvme88k/dev/vsdma.c
index fe7a8a331af..f0cc0e628c1 100644
--- a/sys/arch/mvme88k/dev/vsdma.c
+++ b/sys/arch/mvme88k/dev/vsdma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsdma.c,v 1.4 2001/03/07 23:45:52 miod Exp $ */
+/* $OpenBSD: vsdma.c,v 1.5 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -89,11 +89,11 @@ struct cfdriver vs_cd = {
int
vsmatch(pdp, vcf, args)
-struct device *pdp;
-void *vcf, *args;
+ struct device *pdp;
+ void *vcf, *args;
{
struct confargs *ca = args;
- if (!badvaddr(ca->ca_vaddr, 1)) {
+ if (!badvaddr((unsigned)ca->ca_vaddr, 1)) {
return (1);
} else {
return (0);
@@ -102,8 +102,8 @@ void *vcf, *args;
void
vsattach(parent, self, auxp)
-struct device *parent, *self;
-void *auxp;
+ struct device *parent, *self;
+ void *auxp;
{
struct vs_softc *sc = (struct vs_softc *)self;
struct confargs *ca = auxp;
@@ -156,8 +156,8 @@ void *auxp;
*/
int
vsprint(auxp, pnp)
-void *auxp;
-char *pnp;
+ void *auxp;
+ char *pnp;
{
if (pnp == NULL)
return (UNCONF);
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c
index fdb2366c631..3ce20fe0635 100644
--- a/sys/arch/mvme88k/dev/vx.c
+++ b/sys/arch/mvme88k/dev/vx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vx.c,v 1.5 2001/03/07 23:45:52 miod Exp $ */
+/* $OpenBSD: vx.c,v 1.6 2001/03/09 05:44:39 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -59,39 +59,39 @@
#define DEBUG_KERN 1
struct vx_info {
- struct tty *tty;
- u_char vx_swflags;
- int vx_linestatus;
- int open;
- int waiting;
- u_char vx_consio;
- u_char vx_speed;
- u_char read_pending;
- struct wring *wringp;
- struct rring *rringp;
+ struct tty *tty;
+ u_char vx_swflags;
+ int vx_linestatus;
+ int open;
+ int waiting;
+ u_char vx_consio;
+ u_char vx_speed;
+ u_char read_pending;
+ struct wring *wringp;
+ struct rring *rringp;
};
struct vxsoftc {
- struct device sc_dev;
- struct evcnt sc_intrcnt;
- struct evcnt sc_sintrcnt;
- struct vx_info sc_info[9];
- struct vxreg *vx_reg;
- unsigned int board_addr;
- struct channel *channel;
- char channel_number;
- struct packet sc_bppwait_pkt;
- void *sc_bppwait_pktp;
- struct intrhand sc_ih_c;
- struct intrhand sc_ih_s;
+ struct device sc_dev;
+ struct evcnt sc_intrcnt;
+ struct evcnt sc_sintrcnt;
+ struct vx_info sc_info[9];
+ struct vxreg *vx_reg;
+ unsigned int board_addr;
+ struct channel *channel;
+ char channel_number;
+ struct packet sc_bppwait_pkt;
+ void *sc_bppwait_pktp;
+ struct intrhand sc_ih_c;
+ struct intrhand sc_ih_s;
#if defined(MVME187) || defined(MVME197)
- struct vme2reg *sc_vme2;
+ struct vme2reg *sc_vme2;
#endif
- int sc_ipl;
- int sc_vec;
- int sc_flags;
- struct envelope *elist_head, *elist_tail;
- struct packet *plist_head, *plist_tail;
+ int sc_ipl;
+ int sc_vec;
+ int sc_flags;
+ struct envelope *elist_head, *elist_tail;
+ struct packet *plist_head, *plist_tail;
};
extern int cold; /* var in autoconf.c that is set in machdep.c when booting */
@@ -108,6 +108,7 @@ void read_wakeup __P((struct vxsoftc *sc, int port));
int bpp_send __P((struct vxsoftc *sc, void *pkt, int wait_flag));
int create_channels __P((struct vxsoftc *sc));
+int env_isvalid __P((struct envelope *thisenv));
void memcpy2 __P((void *dest, const void *src, size_t size));
void *get_free_envelope __P((struct vxsoftc *sc));
void put_free_envelope __P((struct vxsoftc *sc, void *envp));
@@ -143,11 +144,11 @@ int vxstop __P((struct tty *tp, int flag));
static void vxputc __P((struct vxsoftc *sc, int port, u_char c));
struct cfattach vx_ca = {
- sizeof(struct vxsoftc), vxmatch, vxattach
+ sizeof(struct vxsoftc), vxmatch, vxattach
};
struct cfdriver vx_cd = {
- NULL, "vx", DV_TTY, 0
+ NULL, "vx", DV_TTY, 0
};
#define VX_UNIT(x) (int)(minor(x) / 9)
@@ -158,743 +159,764 @@ struct envelope *bpp_wait;
unsigned int board_addr;
struct tty * vxtty(dev)
-dev_t dev;
+ dev_t dev;
{
- int unit, port;
- struct vxsoftc *sc;
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (NULL);
- }
- port = VX_PORT(dev);
- return sc->sc_info[port].tty;
+ int unit, port;
+ struct vxsoftc *sc;
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (NULL);
+ }
+ port = VX_PORT(dev);
+ return sc->sc_info[port].tty;
}
int
vxmatch(parent, self, aux)
-struct device *parent;
-void *self;
-void *aux;
+ struct device *parent;
+ void *self;
+ void *aux;
{
- struct vxreg *vx_reg;
- struct confargs *ca = aux;
-
- if (cputyp != CPU_187)
- return 0;
+ struct vxreg *vx_reg;
+ struct confargs *ca = aux;
+
+ if (cputyp != CPU_187)
+ return 0;
#ifdef OLD_MAPPINGS
- ca->ca_vaddr = ca->ca_paddr;
+ ca->ca_vaddr = ca->ca_paddr;
#endif
- ca->ca_len = 0x10000; /* we know this. */
- ca->ca_ipl = 3; /* we need interrupts for this board to work */
-
- vx_reg = (struct vxreg *)ca->ca_vaddr;
- board_addr = (unsigned int)ca->ca_vaddr;
- if (!badvaddr(&vx_reg->ipc_cr, 1)){
- if (ca->ca_vec & 0x03) {
- printf("xvt: bad vector 0x%x\n", ca->ca_vec);
- return (0);
- }
- return (1);
- } else {
- return (0);
- }
+ ca->ca_len = 0x10000; /* we know this. */
+ ca->ca_ipl = 3; /* we need interrupts for this board to work */
+
+ vx_reg = (struct vxreg *)ca->ca_vaddr;
+ board_addr = (unsigned int)ca->ca_vaddr;
+ if (!badvaddr((unsigned)&vx_reg->ipc_cr, 1)) {
+ if (ca->ca_vec & 0x03) {
+ printf("xvt: bad vector 0x%x\n", ca->ca_vec);
+ return (0);
+ }
+ return (1);
+ } else {
+ return (0);
+ }
}
void
vxattach(parent, self, aux)
-struct device *parent;
-struct device *self;
-void *aux;
+ struct device *parent;
+ struct device *self;
+ void *aux;
{
- struct vxsoftc *sc = (struct vxsoftc *)self;
- struct confargs *ca = aux;
-
- /* set up dual port memory and registers and init*/
- sc->vx_reg = (struct vxreg *)ca->ca_vaddr;
- sc->channel = (struct channel *)(ca->ca_vaddr + 0x0100);
+ struct vxsoftc *sc = (struct vxsoftc *)self;
+ struct confargs *ca = aux;
+
+ /* set up dual port memory and registers and init*/
+ sc->vx_reg = (struct vxreg *)ca->ca_vaddr;
+ sc->channel = (struct channel *)(ca->ca_vaddr + 0x0100);
#if defined(MVME187) || defined(MVME197)
- sc->sc_vme2 = ca->ca_master;
+ sc->sc_vme2 = ca->ca_master;
#endif
- sc->sc_ipl = ca->ca_ipl;
- sc->sc_vec = ca->ca_vec;
- sc->board_addr = (unsigned int)ca->ca_vaddr;
-
- printf("\n");
-
- if (create_channels(sc)) {
- printf("%s: failed to create channel %d\n", sc->sc_dev.dv_xname,
- sc->channel->channel_number);
- return;
- }
- if (vx_init(sc)){
- printf("%s: failed to initialize\n", sc->sc_dev.dv_xname);
- return;
- }
-
- /* enable interrupts */
- sc->sc_ih_c.ih_fn = vx_intr;
- sc->sc_ih_c.ih_arg = sc;
- sc->sc_ih_c.ih_wantframe = 0;
- sc->sc_ih_c.ih_ipl = ca->ca_ipl;
-
- vmeintr_establish(ca->ca_vec, &sc->sc_ih_c);
- evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
+ sc->sc_ipl = ca->ca_ipl;
+ sc->sc_vec = ca->ca_vec;
+ sc->board_addr = (unsigned int)ca->ca_vaddr;
+
+ printf("\n");
+
+ if (create_channels(sc)) {
+ printf("%s: failed to create channel %d\n", sc->sc_dev.dv_xname,
+ sc->channel->channel_number);
+ return;
+ }
+ if (vx_init(sc)) {
+ printf("%s: failed to initialize\n", sc->sc_dev.dv_xname);
+ return;
+ }
+
+ /* enable interrupts */
+ sc->sc_ih_c.ih_fn = vx_intr;
+ sc->sc_ih_c.ih_arg = sc;
+ sc->sc_ih_c.ih_wantframe = 0;
+ sc->sc_ih_c.ih_ipl = ca->ca_ipl;
+
+ vmeintr_establish(ca->ca_vec, &sc->sc_ih_c);
+ evcnt_attach(&sc->sc_dev, "intr", &sc->sc_intrcnt);
}
int vxtdefaultrate = TTYDEF_SPEED;
short
dtr_ctl(sc, port, on)
- struct vxsoftc *sc;
- int port;
- int on;
+ struct vxsoftc *sc;
+ int port;
+ int on;
{
- struct packet pkt;
- bzero(&pkt, sizeof(struct packet));
- pkt.command = CMD_IOCTL;
- pkt.ioctl_cmd_l = IOCTL_TCXONC;
- pkt.command_pipe_number = sc->channel_number;
- pkt.status_pipe_number = sc->channel_number;
- pkt.device_number = port;
- if (on) {
- pkt.ioctl_arg_l = 6; /* assert DTR */
- } else {
- pkt.ioctl_arg_l = 7; /* negate DTR */
- }
- bpp_send(sc, &pkt, NOWAIT);
- return (pkt.error_l);
+ struct packet pkt;
+ bzero(&pkt, sizeof(struct packet));
+ pkt.command = CMD_IOCTL;
+ pkt.ioctl_cmd_l = IOCTL_TCXONC;
+ pkt.command_pipe_number = sc->channel_number;
+ pkt.status_pipe_number = sc->channel_number;
+ pkt.device_number = port;
+ if (on) {
+ pkt.ioctl_arg_l = 6; /* assert DTR */
+ } else {
+ pkt.ioctl_arg_l = 7; /* negate DTR */
+ }
+ bpp_send(sc, &pkt, NOWAIT);
+ return (pkt.error_l);
}
short
rts_ctl(sc, port, on)
- struct vxsoftc *sc;
- int port;
- int on;
+struct vxsoftc *sc;
+int port;
+int on;
{
- struct packet pkt;
- bzero(&pkt, sizeof(struct packet));
- pkt.command = CMD_IOCTL;
- pkt.ioctl_cmd_l = IOCTL_TCXONC;
- pkt.command_pipe_number = sc->channel_number;
- pkt.status_pipe_number = sc->channel_number;
- pkt.device_number = port;
- if (on) {
- pkt.ioctl_arg_l = 4; /* assert RTS */
- } else {
- pkt.ioctl_arg_l = 5; /* negate RTS */
- }
- bpp_send(sc, &pkt, NOWAIT);
- return (pkt.error_l);
+ struct packet pkt;
+ bzero(&pkt, sizeof(struct packet));
+ pkt.command = CMD_IOCTL;
+ pkt.ioctl_cmd_l = IOCTL_TCXONC;
+ pkt.command_pipe_number = sc->channel_number;
+ pkt.status_pipe_number = sc->channel_number;
+ pkt.device_number = port;
+ if (on) {
+ pkt.ioctl_arg_l = 4; /* assert RTS */
+ } else {
+ pkt.ioctl_arg_l = 5; /* negate RTS */
+ }
+ bpp_send(sc, &pkt, NOWAIT);
+ return (pkt.error_l);
}
short
flush_ctl(sc, port, which)
- struct vxsoftc *sc;
- int port;
- int which;
+struct vxsoftc *sc;
+int port;
+int which;
{
- struct packet pkt;
- bzero(&pkt, sizeof(struct packet));
- pkt.command = CMD_IOCTL;
- pkt.ioctl_cmd_l = IOCTL_TCFLSH;
- pkt.command_pipe_number = sc->channel_number;
- pkt.status_pipe_number = sc->channel_number;
- pkt.device_number = port;
- pkt.ioctl_arg_l = which; /* 0=input, 1=output, 2=both */
- bpp_send(sc, &pkt, NOWAIT);
- return (pkt.error_l);
+ struct packet pkt;
+ bzero(&pkt, sizeof(struct packet));
+ pkt.command = CMD_IOCTL;
+ pkt.ioctl_cmd_l = IOCTL_TCFLSH;
+ pkt.command_pipe_number = sc->channel_number;
+ pkt.status_pipe_number = sc->channel_number;
+ pkt.device_number = port;
+ pkt.ioctl_arg_l = which; /* 0=input, 1=output, 2=both */
+ bpp_send(sc, &pkt, NOWAIT);
+ return (pkt.error_l);
}
int vx_mctl (dev, bits, how)
-dev_t dev;
-int bits;
-int how;
+ dev_t dev;
+ int bits;
+ int how;
{
- int s, unit, port;
- struct vxsoftc *sc;
- struct vx_info *vxt;
- u_char msvr;
-
- unit = VX_UNIT(dev);
- port = VX_PORT(dev);
- sc = (struct vxsoftc *) vx_cd.cd_devs[unit];
- vxt = &sc->sc_info[port];
-
- s = splvx();
- switch (how) {
- case DMSET:
+ int s, unit, port;
+ struct vxsoftc *sc;
+ struct vx_info *vxt;
+ u_char msvr;
+
+ unit = VX_UNIT(dev);
+ port = VX_PORT(dev);
+ sc = (struct vxsoftc *) vx_cd.cd_devs[unit];
+ vxt = &sc->sc_info[port];
+
+ s = splvx();
+ switch (how) {
+ case DMSET:
if( bits & TIOCM_RTS) {
rts_ctl(sc, port, 1);
- vxt->vx_linestatus |= TIOCM_RTS;
+ vxt->vx_linestatus |= TIOCM_RTS;
} else {
rts_ctl(sc, port, 0);
-
- vxt->vx_linestatus &= ~TIOCM_RTS;
+
+ vxt->vx_linestatus &= ~TIOCM_RTS;
}
- if( bits & TIOCM_DTR) {
+ if ( bits & TIOCM_DTR) {
dtr_ctl(sc, port, 1);
- vxt->vx_linestatus |= TIOCM_DTR;
+ vxt->vx_linestatus |= TIOCM_DTR;
} else {
dtr_ctl(sc, port, 0);
- vxt->vx_linestatus &= ~TIOCM_DTR;
+ vxt->vx_linestatus &= ~TIOCM_DTR;
}
break;
- case DMBIC:
- if ( bits & TIOCM_RTS) {
+ case DMBIC:
+ if ( bits & TIOCM_RTS) {
rts_ctl(sc, port, 0);
- vxt->vx_linestatus &= ~TIOCM_RTS;
- }
- if ( bits & TIOCM_DTR) {
+ vxt->vx_linestatus &= ~TIOCM_RTS;
+ }
+ if ( bits & TIOCM_DTR) {
dtr_ctl(sc, port, 0);
- vxt->vx_linestatus &= ~TIOCM_DTR;
- }
- break;
+ vxt->vx_linestatus &= ~TIOCM_DTR;
+ }
+ break;
- case DMBIS:
- if ( bits & TIOCM_RTS) {
+ case DMBIS:
+ if ( bits & TIOCM_RTS) {
rts_ctl(sc, port, 1);
- vxt->vx_linestatus |= TIOCM_RTS;
- }
- if ( bits & TIOCM_DTR) {
+ vxt->vx_linestatus |= TIOCM_RTS;
+ }
+ if ( bits & TIOCM_DTR) {
dtr_ctl(sc, port, 1);
- vxt->vx_linestatus |= TIOCM_DTR;
- }
- break;
+ vxt->vx_linestatus |= TIOCM_DTR;
+ }
+ break;
- case DMGET:
+ case DMGET:
bits = 0;
msvr = vxt->vx_linestatus;
- if( msvr & TIOCM_DSR) {
+ if ( msvr & TIOCM_DSR) {
bits |= TIOCM_DSR;
}
- if( msvr & TIOCM_CD) {
+ if ( msvr & TIOCM_CD) {
bits |= TIOCM_CD;
}
- if( msvr & TIOCM_CTS) {
+ if ( msvr & TIOCM_CTS) {
bits |= TIOCM_CTS;
}
- if( msvr & TIOCM_DTR) {
+ if ( msvr & TIOCM_DTR) {
bits |= TIOCM_DTR;
}
- if( msvr & TIOCM_RTS) {
+ if ( msvr & TIOCM_RTS) {
bits |= TIOCM_RTS;
}
- break;
- }
-
- splx(s);
- bits = 0;
+ break;
+ }
+
+ splx(s);
+ bits = 0;
bits |= TIOCM_DTR;
bits |= TIOCM_RTS;
bits |= TIOCM_CTS;
bits |= TIOCM_CD;
bits |= TIOCM_DSR;
- return (bits);
+ return (bits);
}
int vxopen (dev, flag, mode, p)
-dev_t dev;
-int flag;
-int mode;
-struct proc *p;
+ dev_t dev;
+ int flag;
+ int mode;
+ struct proc *p;
{
- int s, unit, port;
- struct vx_info *vxt;
- struct vxsoftc *sc;
- struct tty *tp;
- struct open_packet opkt;
- u_short code;
-
- unit = VX_UNIT(dev);
- port = VX_PORT(dev);
-
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (ENODEV);
- }
-
- /*flush_ctl(sc, port, 2);*/
-
- bzero(&opkt, sizeof(struct packet));
- opkt.eye_catcher[0] = 0x33;
- opkt.eye_catcher[1] = 0x33;
- opkt.eye_catcher[2] = 0x33;
- opkt.eye_catcher[3] = 0x33;
- opkt.command_pipe_number = sc->channel_number;
- opkt.status_pipe_number = sc->channel_number;
- opkt.command = CMD_OPEN;
- opkt.device_number = port;
-
- bpp_send(sc, &opkt, WAIT_POLL);
-
- if (opkt.error_l) {
+ int s, unit, port;
+ struct vx_info *vxt;
+ struct vxsoftc *sc;
+ struct tty *tp;
+ struct open_packet opkt;
+ u_short code;
+
+ unit = VX_UNIT(dev);
+ port = VX_PORT(dev);
+
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (ENODEV);
+ }
+
+ /*flush_ctl(sc, port, 2);*/
+
+ bzero(&opkt, sizeof(struct packet));
+ opkt.eye_catcher[0] = 0x33;
+ opkt.eye_catcher[1] = 0x33;
+ opkt.eye_catcher[2] = 0x33;
+ opkt.eye_catcher[3] = 0x33;
+ opkt.command_pipe_number = sc->channel_number;
+ opkt.status_pipe_number = sc->channel_number;
+ opkt.command = CMD_OPEN;
+ opkt.device_number = port;
+
+ bpp_send(sc, &opkt, WAIT_POLL);
+
+ if (opkt.error_l) {
#ifdef DEBUG_VXT
- printf("unit %d, port %d, ", unit, port);
- printf("error = %d\n", opkt.error_l);
+ printf("unit %d, port %d, ", unit, port);
+ printf("error = %d\n", opkt.error_l);
#endif
- return (ENODEV);
- }
-
- code = opkt.event_code;
+ return (ENODEV);
+ }
+
+ code = opkt.event_code;
s = splvx();
-
- vxt = &sc->sc_info[port];
- if (vxt->tty) {
- tp = vxt->tty;
- } else {
- tp = vxt->tty = ttymalloc();
- }
-
- /* set line status */
- tp->t_state |= TS_CARR_ON;
- if (code & E_DCD) {
+
+ vxt = &sc->sc_info[port];
+ if (vxt->tty) {
+ tp = vxt->tty;
+ } else {
+ tp = vxt->tty = ttymalloc();
+ }
+
+ /* set line status */
+ tp->t_state |= TS_CARR_ON;
+ if (code & E_DCD) {
tp->t_state |= TS_CARR_ON;
- vxt->vx_linestatus |= TIOCM_CD;
- }
- if (code & E_DSR) {
- vxt->vx_linestatus |= TIOCM_DSR;
- }
- if (code & E_CTS) {
- vxt->vx_linestatus |= TIOCM_CTS;
- }
-
- tp->t_oproc = vxstart;
- tp->t_param = vx_param;
- 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_lflag = TTYDEF_LFLAG;
- tp->t_ispeed = tp->t_ospeed = vxtdefaultrate;
- tp->t_cflag = TTYDEF_CFLAG;
- }
- /*
- * do these all the time
- */
- if (vxt->vx_swflags & TIOCFLAG_CLOCAL)
- tp->t_cflag |= CLOCAL;
- if (vxt->vx_swflags & TIOCFLAG_CRTSCTS)
- tp->t_cflag |= CRTSCTS;
- if (vxt->vx_swflags & TIOCFLAG_MDMBUF)
- tp->t_cflag |= MDMBUF;
- vx_param(tp, &tp->t_termios);
- ttsetwater(tp);
-
- (void)vx_mctl(dev, TIOCM_DTR | TIOCM_RTS, DMSET);
-
- tp->t_state |= TS_CARR_ON;
- } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) {
- splx(s);
- return (EBUSY);
- }
-
- /*
- * Reset the tty pointer, as there could have been a dialout
- * use of the tty with a dialin open waiting.
- */
- tp->t_dev = dev;
- sc->sc_info[port].open = 1;
- read_wakeup(sc, port);
- splx(s);
- return ((*linesw[tp->t_line].l_open)(dev, tp));
+ vxt->vx_linestatus |= TIOCM_CD;
+ }
+ if (code & E_DSR) {
+ vxt->vx_linestatus |= TIOCM_DSR;
+ }
+ if (code & E_CTS) {
+ vxt->vx_linestatus |= TIOCM_CTS;
+ }
+
+ tp->t_oproc = vxstart;
+ tp->t_param = vx_param;
+ 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_lflag = TTYDEF_LFLAG;
+ tp->t_ispeed = tp->t_ospeed = vxtdefaultrate;
+ tp->t_cflag = TTYDEF_CFLAG;
+ }
+ /*
+ * do these all the time
+ */
+ if (vxt->vx_swflags & TIOCFLAG_CLOCAL)
+ tp->t_cflag |= CLOCAL;
+ if (vxt->vx_swflags & TIOCFLAG_CRTSCTS)
+ tp->t_cflag |= CRTSCTS;
+ if (vxt->vx_swflags & TIOCFLAG_MDMBUF)
+ tp->t_cflag |= MDMBUF;
+ vx_param(tp, &tp->t_termios);
+ ttsetwater(tp);
+
+ (void)vx_mctl(dev, TIOCM_DTR | TIOCM_RTS, DMSET);
+
+ tp->t_state |= TS_CARR_ON;
+ } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) {
+ splx(s);
+ return (EBUSY);
+ }
+
+ /*
+ * Reset the tty pointer, as there could have been a dialout
+ * use of the tty with a dialin open waiting.
+ */
+ tp->t_dev = dev;
+ sc->sc_info[port].open = 1;
+ read_wakeup(sc, port);
+ splx(s);
+ return ((*linesw[tp->t_line].l_open)(dev, tp));
}
int
vx_param(tp, t)
-struct tty *tp;
-struct termios *t;
+ struct tty *tp;
+ struct termios *t;
{
- int unit, port;
- struct vxsoftc *sc;
- dev_t dev;
-
- dev = tp->t_dev;
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (ENODEV);
- }
- port = VX_PORT(dev);
- tp->t_ispeed = t->c_ispeed;
- tp->t_ospeed = t->c_ospeed;
- tp->t_cflag = t->c_cflag;
- vx_ccparam(sc, t, port);
- vx_unblock(tp);
- return 0;
+ int unit, port;
+ struct vxsoftc *sc;
+ dev_t dev;
+
+ dev = tp->t_dev;
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (ENODEV);
+ }
+ port = VX_PORT(dev);
+ tp->t_ispeed = t->c_ispeed;
+ tp->t_ospeed = t->c_ospeed;
+ tp->t_cflag = t->c_cflag;
+ vx_ccparam(sc, t, port);
+ vx_unblock(tp);
+ return 0;
}
int
vxclose (dev, flag, mode, p)
-dev_t dev;
-int flag;
-int mode;
-struct proc *p;
+ dev_t dev;
+ int flag;
+ int mode;
+ struct proc *p;
{
- int unit, port;
- struct tty *tp;
- struct vx_info *vxt;
- struct vxsoftc *sc;
- int s;
- struct close_packet cpkt;
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (ENODEV);
- }
- port = VX_PORT(dev);
+ int unit, port;
+ struct tty *tp;
+ struct vx_info *vxt;
+ struct vxsoftc *sc;
+ int s;
+ struct close_packet cpkt;
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (ENODEV);
+ }
+ port = VX_PORT(dev);
/* flush_ctl(sc, port, 2); flush both input and output */
-
- vxt = &sc->sc_info[port];
- tp = vxt->tty;
- (*linesw[tp->t_line].l_close)(tp, flag);
-
- if((tp->t_cflag & HUPCL) != 0) {
+
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ (*linesw[tp->t_line].l_close)(tp, flag);
+
+ if ((tp->t_cflag & HUPCL) != 0) {
rts_ctl(sc, port, 0);
dtr_ctl(sc, port, 0);
}
-
- s = splvx();
-
- bzero(&cpkt, sizeof(struct packet));
- cpkt.eye_catcher[0] = 0x55;
- cpkt.eye_catcher[1] = 0x55;
- cpkt.eye_catcher[2] = 0x55;
- cpkt.eye_catcher[3] = 0x55;
- cpkt.command_pipe_number = sc->channel_number;
- cpkt.status_pipe_number = sc->channel_number;
- cpkt.command = CMD_CLOSE;
- cpkt.device_number = port;
-
- bpp_send(sc, &cpkt, NOWAIT);
- splx(s);
- ttyclose(tp);
- sc->sc_info[port].open = 0;
- return (0);
+
+ s = splvx();
+
+ bzero(&cpkt, sizeof(struct packet));
+ cpkt.eye_catcher[0] = 0x55;
+ cpkt.eye_catcher[1] = 0x55;
+ cpkt.eye_catcher[2] = 0x55;
+ cpkt.eye_catcher[3] = 0x55;
+ cpkt.command_pipe_number = sc->channel_number;
+ cpkt.status_pipe_number = sc->channel_number;
+ cpkt.command = CMD_CLOSE;
+ cpkt.device_number = port;
+
+ bpp_send(sc, &cpkt, NOWAIT);
+ splx(s);
+ ttyclose(tp);
+ sc->sc_info[port].open = 0;
+ return (0);
}
void
read_wakeup(sc, port)
-struct vxsoftc *sc;
-int port;
+ struct vxsoftc *sc;
+ int port;
{
- struct read_wakeup_packet rwp;
- volatile struct vx_info *vxt;
- vxt = &sc->sc_info[port];
- /*
- * If we already have a read_wakeup paket
- * for this port, do nothing.
- */
- if (vxt->read_pending) {
- return;
- } else {
- vxt->read_pending = 1;
- }
-
- bzero(&rwp, sizeof(struct packet));
- rwp.eye_catcher[0] = 0x11;
- rwp.eye_catcher[1] = 0x11;
- rwp.eye_catcher[2] = 0x11;
- rwp.eye_catcher[3] = 0x11;
- rwp.command_pipe_number = sc->channel_number;
- rwp.status_pipe_number = sc->channel_number;
- rwp.command = CMD_READW;
- rwp.device_number = port;
-
- /*
- * Do not wait. Characters will be transferred
- * to (*linesw[tp->t_line].l_rint)(c,tp); by
- * vx_intr() (IPC will notify via interrupt)
- */
- bpp_send(sc, &rwp, NOWAIT);
+ struct read_wakeup_packet rwp;
+ volatile struct vx_info *vxt;
+ vxt = &sc->sc_info[port];
+ /*
+ * If we already have a read_wakeup paket
+ * for this port, do nothing.
+ */
+ if (vxt->read_pending) {
+ return;
+ } else {
+ vxt->read_pending = 1;
+ }
+
+ bzero(&rwp, sizeof(struct packet));
+ rwp.eye_catcher[0] = 0x11;
+ rwp.eye_catcher[1] = 0x11;
+ rwp.eye_catcher[2] = 0x11;
+ rwp.eye_catcher[3] = 0x11;
+ rwp.command_pipe_number = sc->channel_number;
+ rwp.status_pipe_number = sc->channel_number;
+ rwp.command = CMD_READW;
+ rwp.device_number = port;
+
+ /*
+ * Do not wait. Characters will be transferred
+ * to (*linesw[tp->t_line].l_rint)(c,tp); by
+ * vx_intr() (IPC will notify via interrupt)
+ */
+ bpp_send(sc, &rwp, NOWAIT);
}
int
vxread (dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
- int unit, port;
- struct tty *tp;
- volatile struct vx_info *vxt;
- volatile struct vxsoftc *sc;
-
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (ENODEV);
- }
- port = VX_PORT(dev);
- vxt = &sc->sc_info[port];
- tp = vxt->tty;
- if (!tp) return ENXIO;
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ int unit, port;
+ struct tty *tp;
+ volatile struct vx_info *vxt;
+ volatile struct vxsoftc *sc;
+
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (ENODEV);
+ }
+ port = VX_PORT(dev);
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ if (!tp) return ENXIO;
+ return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
}
int
vxwrite (dev, uio, flag)
-dev_t dev;
-struct uio *uio;
-int flag;
+ dev_t dev;
+ struct uio *uio;
+ int flag;
{
- int unit, port;
- struct tty *tp;
- struct vx_info *vxt;
- struct vxsoftc *sc;
- struct wring *wp;
- struct write_wakeup_packet wwp;
- u_short get, put;
-
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (ENODEV);
- }
-
- port = VX_PORT(dev);
- vxt = &sc->sc_info[port];
- tp = vxt->tty;
- if (!tp) return ENXIO;
-
- wp = sc->sc_info[port].wringp;
- get = wp->get;
- put = wp->put;
-
- if ((put + 1) == get) {
- bzero(&wwp, sizeof(struct packet));
- wwp.eye_catcher[0] = 0x22;
- wwp.eye_catcher[1] = 0x22;
- wwp.eye_catcher[2] = 0x22;
- wwp.eye_catcher[3] = 0x22;
- wwp.command_pipe_number = sc->channel_number;
- wwp.status_pipe_number = sc->channel_number;
- wwp.command = CMD_WRITEW;
- wwp.device_number = port;
-
- bpp_send(sc, &wwp, WAIT_POLL);
-
- if (wwp.error_l) {
- return (ENXIO);
- }
- }
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ int unit, port;
+ struct tty *tp;
+ struct vx_info *vxt;
+ struct vxsoftc *sc;
+ struct wring *wp;
+ struct write_wakeup_packet wwp;
+ u_short get, put;
+
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (ENODEV);
+ }
+
+ port = VX_PORT(dev);
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ if (!tp) return ENXIO;
+
+ wp = sc->sc_info[port].wringp;
+ get = wp->get;
+ put = wp->put;
+
+ if ((put + 1) == get) {
+ bzero(&wwp, sizeof(struct packet));
+ wwp.eye_catcher[0] = 0x22;
+ wwp.eye_catcher[1] = 0x22;
+ wwp.eye_catcher[2] = 0x22;
+ wwp.eye_catcher[3] = 0x22;
+ wwp.command_pipe_number = sc->channel_number;
+ wwp.status_pipe_number = sc->channel_number;
+ wwp.command = CMD_WRITEW;
+ wwp.device_number = port;
+
+ port = VX_PORT(dev);
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ if (!tp) return ENXIO;
+
+ wp = sc->sc_info[port].wringp;
+ get = wp->get;
+ put = wp->put;
+
+ if ((put + 1) == get) {
+ bzero(&wwp, sizeof(struct packet));
+ wwp.eye_catcher[0] = 0x22;
+ wwp.eye_catcher[1] = 0x22;
+ wwp.eye_catcher[2] = 0x22;
+ wwp.eye_catcher[3] = 0x22;
+ wwp.command_pipe_number = sc->channel_number;
+ wwp.status_pipe_number = sc->channel_number;
+ wwp.command = CMD_WRITEW;
+ wwp.device_number = port;
+
+ bpp_send(sc, &wwp, WAIT_POLL);
+
+ if (wwp.error_l) {
+ return (ENXIO);
+ }
+ }
+ }
+ return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
int
vxioctl (dev, cmd, data, flag, p)
-dev_t dev;
-int cmd;
-caddr_t data;
-int flag;
-struct proc *p;
+ dev_t dev;
+ int cmd;
+ caddr_t data;
+ int flag;
+ struct proc *p;
{
- int error;
- int unit, port;
- struct tty *tp;
- struct vx_info *vxt;
- struct vxsoftc *sc;
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return (ENODEV);
- }
- port = VX_PORT(dev);
- vxt = &sc->sc_info[port];
- tp = vxt->tty;
- 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:
+ int error;
+ int unit, port;
+ struct tty *tp;
+ struct vx_info *vxt;
+ struct vxsoftc *sc;
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return (ENODEV);
+ }
+ port = VX_PORT(dev);
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ 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) vx_mctl(dev, TIOCM_DTR | TIOCM_RTS, DMBIS);
- break;
+ break;
- case TIOCCDTR:
+ case TIOCCDTR:
(void) vx_mctl(dev, TIOCM_DTR | TIOCM_RTS, DMBIC);
- break;
+ break;
- case TIOCMSET:
+ case TIOCMSET:
(void) vx_mctl(dev, *(int *) data, DMSET);
- break;
+ break;
- case TIOCMBIS:
+ case TIOCMBIS:
(void) vx_mctl(dev, *(int *) data, DMBIS);
- break;
+ break;
- case TIOCMBIC:
+ case TIOCMBIC:
(void) vx_mctl(dev, *(int *) data, DMBIC);
- break;
+ break;
- case TIOCMGET:
+ case TIOCMGET:
*(int *)data = vx_mctl(dev, 0, DMGET);
- break;
+ break;
- case TIOCGFLAGS:
+ case TIOCGFLAGS:
*(int *)data = vxt->vx_swflags;
break;
- case TIOCSFLAGS:
+ case TIOCSFLAGS:
error = suser(p->p_ucred, &p->p_acflag);
if (error != 0)
- return(EPERM);
+ return (EPERM);
vxt->vx_swflags = *(int *)data;
vxt->vx_swflags &= /* only allow valid flags */
- (TIOCFLAG_SOFTCAR | TIOCFLAG_CLOCAL | TIOCFLAG_CRTSCTS);
- break;
+ (TIOCFLAG_SOFTCAR | TIOCFLAG_CLOCAL | TIOCFLAG_CRTSCTS);
+ break;
- default:
- return (ENOTTY);
- }
- return 0;
+ default:
+ return (ENOTTY);
+ }
+ return 0;
}
int
vxstop(tp, flag)
-struct tty *tp;
-int flag;
+ struct tty *tp;
+ int flag;
{
- int s;
+ int s;
s = splvx();
- if (tp->t_state & TS_BUSY) {
- if ((tp->t_state & TS_TTSTOP) == 0)
- tp->t_state |= TS_FLUSH;
- }
+ if (tp->t_state & TS_BUSY) {
+ if ((tp->t_state & TS_TTSTOP) == 0)
+ tp->t_state |= TS_FLUSH;
+ }
splx(s);
- return 0;
+ return 0;
}
static void
vxputc(sc, port, c)
-struct vxsoftc *sc;
-int port;
-u_char c;
+ struct vxsoftc *sc;
+ int port;
+ u_char c;
{
- struct wring *wp;
-
- wp = sc->sc_info[port].wringp;
- wp->data[wp->put++ & (WRING_BUF_SIZE-1)] = c;
- wp->put &= (WRING_BUF_SIZE-1);
- return;
+ struct wring *wp;
+
+ wp = sc->sc_info[port].wringp;
+ wp->data[wp->put++ & (WRING_BUF_SIZE-1)] = c;
+ wp->put &= (WRING_BUF_SIZE-1);
+ return;
}
u_short vxtspeed(speed)
-int speed;
+ int speed;
{
- switch (speed) {
- case B0:
- return VB0;
- break;
- case B50:
- return VB50;
- break;
- case B75:
- return VB75;
- break;
- case B110:
- return VB110;
- break;
- case B134:
- return VB134;
- break;
- case B150:
- return VB150;
- break;
- case B200:
- return VB200;
- break;
- case B300:
- return VB300;
- break;
- case B600:
- return VB600;
- break;
- case B1200:
- return VB1200;
- break;
- case B1800:
- return VB1800;
- break;
- case B2400:
- return VB2400;
- break;
- case B4800:
- return VB4800;
- break;
- case B9600:
- return VB9600;
- break;
- case B19200:
- return VB19200;
- break;
- case B38400:
- return VB38400;
- break;
- default:
- return VB9600;
- break;
- }
+ switch (speed) {
+ case B0:
+ return VB0;
+ break;
+ case B50:
+ return VB50;
+ break;
+ case B75:
+ return VB75;
+ break;
+ case B110:
+ return VB110;
+ break;
+ case B134:
+ return VB134;
+ break;
+ case B150:
+ return VB150;
+ break;
+ case B200:
+ return VB200;
+ break;
+ case B300:
+ return VB300;
+ break;
+ case B600:
+ return VB600;
+ break;
+ case B1200:
+ return VB1200;
+ break;
+ case B1800:
+ return VB1800;
+ break;
+ case B2400:
+ return VB2400;
+ break;
+ case B4800:
+ return VB4800;
+ break;
+ case B9600:
+ return VB9600;
+ break;
+ case B19200:
+ return VB19200;
+ break;
+ case B38400:
+ return VB38400;
+ break;
+ default:
+ return VB9600;
+ break;
+ }
}
int
vx_ccparam(sc, par, port)
-struct vxsoftc *sc;
-struct termios *par;
-int port;
+ struct vxsoftc *sc;
+ struct termios *par;
+ int port;
{
- int imask=0, s;
- int cflag /*, iflag, oflag, lflag*/;
- struct ioctl_a_packet pkt;
- bzero(&pkt, sizeof(struct packet));
-
- if (par->c_ospeed == 0) {
- s = splvx();
- /* dont kill the console */
- if(sc->sc_info[port].vx_consio == 0) {
- /* disconnect, drop RTS DTR stop reciever */
- rts_ctl(sc, port, 0);
- dtr_ctl(sc, port, 0);
- }
- splx(s);
- return (0xff);
- }
-
- pkt.command = CMD_IOCTL;
- pkt.ioctl_cmd_l = IOCTL_TCGETA;
- pkt.command_pipe_number = sc->channel_number;
- pkt.status_pipe_number = sc->channel_number;
- pkt.device_number = port;
- bpp_send(sc, &pkt, WAIT_POLL);
-
- cflag = pkt.c_cflag;
- cflag |= vxtspeed(par->c_ospeed);
-
- switch (par->c_cflag & CSIZE) {
+ int imask=0, s;
+ int cflag /*, iflag, oflag, lflag*/;
+ struct ioctl_a_packet pkt;
+ bzero(&pkt, sizeof(struct packet));
+
+ if (par->c_ospeed == 0) {
+ s = splvx();
+ /* dont kill the console */
+ if (sc->sc_info[port].vx_consio == 0) {
+ /* disconnect, drop RTS DTR stop reciever */
+ rts_ctl(sc, port, 0);
+ dtr_ctl(sc, port, 0);
+ }
+ splx(s);
+ return (0xff);
+ }
+
+ pkt.command = CMD_IOCTL;
+ pkt.ioctl_cmd_l = IOCTL_TCGETA;
+ pkt.command_pipe_number = sc->channel_number;
+ pkt.status_pipe_number = sc->channel_number;
+ pkt.device_number = port;
+ bpp_send(sc, &pkt, WAIT_POLL);
+
+ cflag = pkt.c_cflag;
+ cflag |= vxtspeed(par->c_ospeed);
+
+ switch (par->c_cflag & CSIZE) {
case CS5:
cflag |= VCS5;
imask = 0x1F;
@@ -910,162 +932,179 @@ int port;
default:
cflag |= VCS8;
imask = 0xFF;
- }
-
- if (par->c_cflag & PARENB) cflag |= VPARENB; else cflag &= ~VPARENB;
- if (par->c_cflag & PARODD) cflag |= VPARODD; else cflag &= ~VPARODD;
- if (par->c_cflag & CREAD) cflag |= VCREAD; else cflag &= ~VCREAD;
- if (par->c_cflag & CLOCAL) cflag |= VCLOCAL; else cflag &= ~VCLOCAL;
- if (par->c_cflag & HUPCL) cflag |= VHUPCL; else cflag &= ~VHUPCL;
- /*
- if (par->c_iflag & BRKINT) iflag |= VBRKINT; else iflag &= ~VBRKINT;
- if (par->c_iflag & ISTRIP) iflag |= VISTRIP; else iflag &= ~VISTRIP;
- if (par->c_iflag & ICRNL) iflag |= VICRNL; else iflag &= ~VICRNL;
- if (par->c_iflag & IXON) iflag |= VIXON; else iflag &= ~VIXON;
- if (par->c_iflag & IXANY) iflag |= VIXANY; else iflag &= ~VIXANY;
- if (par->c_oflag & OPOST) oflag |= VOPOST; else oflag &= ~VOPOST;
- if (par->c_oflag & ONLCR) oflag |= VONLCR; else oflag &= ~VONLCR;
- if (par->c_oflag & OXTABS) oflag |= VOXTABS; else oflag &= ~VOXTABS;
- if (par->c_lflag & ECHO) lflag |= VECHO; else lflag &= ~VECHO;
- if (par->c_lflag & ECHOE) lflag |= VECHOE; else lflag &= ~VECHOE;
- if (par->c_lflag & ICANON) lflag |= VICANON; else lflag &= ~VICANON;
- if (par->c_lflag & ISIG) lflag |= VISIG; else lflag &= ~VISIG;
- */
- pkt.command = CMD_IOCTL;
- pkt.ioctl_cmd_l = IOCTL_TCSETA;
- pkt.command_pipe_number = sc->channel_number;
- pkt.status_pipe_number = sc->channel_number;
- pkt.device_number = port;
- pkt.c_cflag = cflag;
-/*
- pkt.c_iflag = iflag;
- pkt.c_oflag = oflag;
- pkt.c_lflag = lflag;
- */
+ }
- bpp_send(sc, &pkt, WAIT_POLL);
- return imask;
+ if (par->c_cflag & PARENB) cflag |= VPARENB;
+ else cflag &= ~VPARENB;
+ if (par->c_cflag & PARODD) cflag |= VPARODD;
+ else cflag &= ~VPARODD;
+ if (par->c_cflag & CREAD) cflag |= VCREAD;
+ else cflag &= ~VCREAD;
+ if (par->c_cflag & CLOCAL) cflag |= VCLOCAL;
+ else cflag &= ~VCLOCAL;
+ if (par->c_cflag & HUPCL) cflag |= VHUPCL;
+ else cflag &= ~VHUPCL;
+#if 0
+ if (par->c_iflag & BRKINT) iflag |= VBRKINT;
+ else iflag &= ~VBRKINT;
+ if (par->c_iflag & ISTRIP) iflag |= VISTRIP;
+ else iflag &= ~VISTRIP;
+ if (par->c_iflag & ICRNL) iflag |= VICRNL;
+ else iflag &= ~VICRNL;
+ if (par->c_iflag & IXON) iflag |= VIXON;
+ else iflag &= ~VIXON;
+ if (par->c_iflag & IXANY) iflag |= VIXANY;
+ else iflag &= ~VIXANY;
+ if (par->c_oflag & OPOST) oflag |= VOPOST;
+ else oflag &= ~VOPOST;
+ if (par->c_oflag & ONLCR) oflag |= VONLCR;
+ else oflag &= ~VONLCR;
+ if (par->c_oflag & OXTABS) oflag |= VOXTABS;
+ else oflag &= ~VOXTABS;
+ if (par->c_lflag & ECHO) lflag |= VECHO;
+ else lflag &= ~VECHO;
+ if (par->c_lflag & ECHOE) lflag |= VECHOE;
+ else lflag &= ~VECHOE;
+ if (par->c_lflag & ICANON) lflag |= VICANON;
+ else lflag &= ~VICANON;
+ if (par->c_lflag & ISIG) lflag |= VISIG;
+ else lflag &= ~VISIG;
+#endif
+ pkt.command = CMD_IOCTL;
+ pkt.ioctl_cmd_l = IOCTL_TCSETA;
+ pkt.command_pipe_number = sc->channel_number;
+ pkt.status_pipe_number = sc->channel_number;
+ pkt.device_number = port;
+ pkt.c_cflag = cflag;
+#if 0
+ pkt.c_iflag = iflag;
+ pkt.c_oflag = oflag;
+ pkt.c_lflag = lflag;
+#endif
+
+ bpp_send(sc, &pkt, WAIT_POLL);
+ return imask;
}
void
vx_unblock(tp)
-struct tty *tp;
+ struct tty *tp;
{
- tp->t_state &= ~TS_FLUSH;
- if (tp->t_outq.c_cc != 0)
- vxstart(tp);
+ tp->t_state &= ~TS_FLUSH;
+ if (tp->t_outq.c_cc != 0)
+ vxstart(tp);
}
void
vxstart(tp)
-struct tty *tp;
+ struct tty *tp;
{
- dev_t dev;
- struct vxsoftc *sc;
- struct wring *wp;
- int cc, port, unit, s, cnt, i;
- u_short get, put;
- char buffer[WRING_BUF_SIZE];
-
- dev = tp->t_dev;
- port = VX_PORT(dev);
- unit = VX_UNIT(dev);
- if (unit >= vx_cd.cd_ndevs ||
- (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
- return;
- }
-
- if ((tp->t_state & TS_ISOPEN) == 0)
- return;
-
- s = splvx();
- if ((tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP | TS_FLUSH)) == 0) {
- tp->t_state |= TS_BUSY;
- wp = sc->sc_info[port].wringp;
- get = wp->get;
- put = wp->put;
- cc = tp->t_outq.c_cc;
- while (cc > 0) {
- cnt = min(WRING_BUF_SIZE, cc);
- cnt = q_to_b(&tp->t_outq, buffer, cnt);
- buffer[cnt] = 0;
- for (i=0; i<cnt; i++) {
- vxputc(sc, port, buffer[i]);
- }
- cc -= cnt;
- }
- tp->t_state &= ~TS_BUSY;
- }
- splx(s);
- return;
+ dev_t dev;
+ struct vxsoftc *sc;
+ struct wring *wp;
+ int cc, port, unit, s, cnt, i;
+ u_short get, put;
+ char buffer[WRING_BUF_SIZE];
+
+ dev = tp->t_dev;
+ port = VX_PORT(dev);
+ unit = VX_UNIT(dev);
+ if (unit >= vx_cd.cd_ndevs ||
+ (sc = (struct vxsoftc *) vx_cd.cd_devs[unit]) == NULL) {
+ return;
+ }
+
+ if ((tp->t_state & TS_ISOPEN) == 0)
+ return;
+
+ s = splvx();
+ if ((tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP | TS_FLUSH)) == 0) {
+ tp->t_state |= TS_BUSY;
+ wp = sc->sc_info[port].wringp;
+ get = wp->get;
+ put = wp->put;
+ cc = tp->t_outq.c_cc;
+ while (cc > 0) {
+ cnt = min(WRING_BUF_SIZE, cc);
+ cnt = q_to_b(&tp->t_outq, buffer, cnt);
+ buffer[cnt] = 0;
+ for (i=0; i<cnt; i++) {
+ vxputc(sc, port, buffer[i]);
+ }
+ cc -= cnt;
+ }
+ tp->t_state &= ~TS_BUSY;
+ }
+ splx(s);
+ return;
}
void
read_chars(sc, port)
-struct vxsoftc *sc;
-int port;
+ struct vxsoftc *sc;
+ int port;
{
- /*
- * This routine is called by vx_intr() when there are
- * characters in the read ring. It will process one
- * cooked line, put the chars in the line disipline ring,
- * and then return. The characters may then
- * be read by vxread.
- */
- struct vx_info *vxt;
- struct rring *rp;
- struct tty *tp;
- u_short get, put;
- int frame_count, i, open;
- char c;
-
- vxt = &sc->sc_info[port];
- tp = vxt->tty;
- rp = vxt->rringp;
- open = vxt->open;
- get = rp->get;
- put = rp->put;
+ /*
+ * This routine is called by vx_intr() when there are
+ * characters in the read ring. It will process one
+ * cooked line, put the chars in the line disipline ring,
+ * and then return. The characters may then
+ * be read by vxread.
+ */
+ struct vx_info *vxt;
+ struct rring *rp;
+ struct tty *tp;
+ u_short get, put;
+ int frame_count, i, open;
+ char c;
+
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ rp = vxt->rringp;
+ open = vxt->open;
+ get = rp->get;
+ put = rp->put;
#ifdef DEBUG_VXT
- printf("read_chars() get=%d, put=%d ", get, put);
- printf("open = %d ring at 0x%x\n", open, rp);
+ printf("read_chars() get=%d, put=%d ", get, put);
+ printf("open = %d ring at 0x%x\n", open, rp);
#endif
- while (get != put) {
- frame_count = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
- rp->get &= (RRING_BUF_SIZE - 1);
- for (i=0; i<frame_count; i++) {
- c = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
- rp->get &= (RRING_BUF_SIZE - 1);
- if (open)
- (*linesw[tp->t_line].l_rint)(c,tp);
- }
- c = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
- rp->get &= (RRING_BUF_SIZE - 1);
- if (!(c & DELIMITER)) {
- vx_frame (sc, port);
- break;
- } else {
- break;
- }
- get = rp->get;
- put = rp->put;
- }
- vxt->read_pending = 0;
- read_wakeup(sc, port);
- return;
+ while (get != put) {
+ frame_count = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
+ rp->get &= (RRING_BUF_SIZE - 1);
+ for (i=0; i<frame_count; i++) {
+ c = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
+ rp->get &= (RRING_BUF_SIZE - 1);
+ if (open)
+ (*linesw[tp->t_line].l_rint)(c,tp);
+ }
+ c = rp->data[rp->get++ & (RRING_BUF_SIZE - 1)];
+ rp->get &= (RRING_BUF_SIZE - 1);
+ if (!(c & DELIMITER)) {
+ vx_frame (sc, port);
+ break;
+ } else {
+ break;
+ }
+ get = rp->get;
+ put = rp->put;
+ }
+ vxt->read_pending = 0;
+ read_wakeup(sc, port);
+ return;
}
void
ccode(sc, port, c)
-struct vxsoftc *sc;
-int port;
-char c;
+ struct vxsoftc *sc;
+ int port;
+ char c;
{
- struct vx_info *vxt;
- struct tty *tp;
- tp = vxt->tty;
- vxt = &sc->sc_info[port];
- tp = vxt->tty;
- (*linesw[tp->t_line].l_rint)(c,tp);
+ struct vx_info *vxt;
+ struct tty *tp;
+ tp = vxt->tty;
+ vxt = &sc->sc_info[port];
+ tp = vxt->tty;
+ (*linesw[tp->t_line].l_rint)(c,tp);
}
int
@@ -1073,176 +1112,181 @@ vx_intr(arg)
void *arg;
{
struct vxsoftc *sc = arg;
-
- struct envelope *envp, *next_envp;
- struct packet *pktp, pkt;
- int valid;
+ struct envelope *envp, *next_envp;
+ struct packet *pktp, pkt;
+ int valid;
short cmd;
u_char port;
+
#if defined(MVME187) || defined(MVME197)
- struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vme2;
+ struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vme2;
- if (vme2->vme2_vbr & VME2_SYSFAIL){
- /* do something... print_dump(sc); */
- }
+ if (vme2->vme2_vbr & VME2_SYSFAIL) {
+ /* do something... print_dump(sc); */
+
+ }
#endif /* defined(MVME187) || defined(MVME197) */
- if (!cold) sc->sc_intrcnt.ev_count++;
-
- while (env_isvalid(get_status_head(sc))) {
- pktp = get_packet(sc, get_status_head(sc));
- valid = env_isvalid(get_status_head(sc));
- cmd = pktp->command;
- port = pktp->device_number;
- /* if we are waiting on this packet, strore the info so bpp_send
- can process the packet */
- if (sc->sc_bppwait_pktp == pktp)
- memcpy2(&sc->sc_bppwait_pkt, pktp, sizeof(struct packet));
-
- memcpy2(&pkt, pktp, sizeof(struct packet));
- next_envp = get_next_envelope(get_status_head(sc));
- envp = get_status_head(sc);
- /* return envelope and packet to the free queues */
- put_free_envelope(sc, envp);
- put_free_packet(sc, pktp);
- /* mark new status pipe head pointer */
- set_status_head(sc, next_envp);
- /* if it was valid, process packet */
- switch (cmd) {
- case CMD_READW:
+ if (!cold) sc->sc_intrcnt.ev_count++;
+
+ while (env_isvalid(get_status_head(sc))) {
+ pktp = get_packet(sc, get_status_head(sc));
+ valid = env_isvalid(get_status_head(sc));
+ cmd = pktp->command;
+ port = pktp->device_number;
+ /* if we are waiting on this packet, strore the info so bpp_send
+ can process the packet */
+ if (sc->sc_bppwait_pktp == pktp)
+ memcpy2(&sc->sc_bppwait_pkt, pktp, sizeof(struct packet));
+
+ memcpy2(&pkt, pktp, sizeof(struct packet));
+ next_envp = get_next_envelope(get_status_head(sc));
+ envp = get_status_head(sc);
+ /* return envelope and packet to the free queues */
+ put_free_envelope(sc, envp);
+ put_free_packet(sc, pktp);
+ /* mark new status pipe head pointer */
+ set_status_head(sc, next_envp);
+ /* if it was valid, process packet */
+ switch (cmd) {
+ case CMD_READW:
#ifdef DEBUG_VXT
- printf("READW Packet\n");
+ printf("READW Packet\n");
#endif
- read_chars(sc, port);
- return 1;
- break;
- case CMD_WRITEW:
+ read_chars(sc, port);
+ return 1;
+ break;
+ case CMD_WRITEW:
#ifdef DEBUG_VXT
- printf("WRITEW Packet\n"); /* Still don't know XXXsmurph */
+ printf("WRITEW Packet\n"); /* Still don't know XXXsmurph */
#endif
- return 1;
- break;
- case CMD_EVENT:
+ return 1;
+ break;
+ case CMD_EVENT:
#ifdef DEBUG_VXT
- printf("EVENT Packet\n");
+ printf("EVENT Packet\n");
#endif
- vx_event(sc, &pkt);
- return 1;
- break;
- case CMD_PROCCESED:
+ vx_event(sc, &pkt);
+ return 1;
+ break;
+ case CMD_PROCCESED:
#ifdef DEBUG_VXT
- printf("CMD_PROCCESED Packet\n");
+ printf("CMD_PROCCESED Packet\n");
#endif
- return 1;
- break;
- default:
+ return 1;
+ break;
+ default:
#ifdef DEBUG_VXT
- printf("Other packet 0x%x\n", cmd);
+ printf("Other packet 0x%x\n", cmd);
#endif
- return 1;
- break;
- }
- }
- return 1;
+ return 1;
+ break;
+ }
+ }
+ return 1;
}
int
vx_event(sc, evntp)
-struct vxsoftc *sc;
-struct packet *evntp;
+ struct vxsoftc *sc;
+ struct packet *evntp;
{
- u_short code = evntp->event_code;
- struct event_packet evnt;
- struct vx_info *vxt;
-
- vxt = &sc->sc_info[evntp->device_number];
-
- if (code & E_INTR) {
- ccode(sc, evntp->device_number, CINTR);
- }
- if (code & E_QUIT) {
- ccode(sc, evntp->device_number, CQUIT);
- }
- if (code & E_HUP) {
- rts_ctl(sc, evntp->device_number, 0);
- dtr_ctl(sc, evntp->device_number, 0);
- }
- if (code & E_DCD) {
- vxt->vx_linestatus |= TIOCM_CD;
- }
- if (code & E_DSR) {
- vxt->vx_linestatus |= TIOCM_DSR;
- }
- if (code & E_CTS) {
- vxt->vx_linestatus |= TIOCM_CTS;
- }
- if (code & E_LOST_DCD) {
- vxt->vx_linestatus &= ~TIOCM_CD;
- }
- if (code & E_LOST_DSR) {
- vxt->vx_linestatus &= ~TIOCM_DSR;
- }
- if (code & E_LOST_CTS) {
- vxt->vx_linestatus &= ~TIOCM_CTS;
- }
- if (code & E_PR_FAULT) {
- /* do something... */
- }
- if (code & E_PR_POUT) {
- /* do something... */
- }
- if (code & E_PR_SELECT) {
- /* do something... */
- }
- if (code & E_SWITCH) {
- /* do something... */
- }
- if (code & E_BREAK) {
- vx_break (sc, evntp->device_number);
- }
-
- /* send and event packet backe to the device */
- bzero(&evnt, sizeof(struct event_packet));
- evnt.command = CMD_EVENT;
- evnt.device_number = evntp->device_number;
- evnt.command_pipe_number = sc->channel_number;
- /* return status on same channel */
- evnt.status_pipe_number = sc->channel_number;
- /* send packet to the firmware */
- bpp_send(sc, &evnt, NOWAIT);
- return 1;
+ u_short code = evntp->event_code;
+ struct event_packet evnt;
+ struct vx_info *vxt;
+
+ vxt = &sc->sc_info[evntp->device_number];
+
+ if (code & E_INTR) {
+ ccode(sc, evntp->device_number, CINTR);
+ }
+ if (code & E_QUIT) {
+ ccode(sc, evntp->device_number, CQUIT);
+ }
+ if (code & E_HUP) {
+ rts_ctl(sc, evntp->device_number, 0);
+ dtr_ctl(sc, evntp->device_number, 0);
+ }
+ if (code & E_DCD) {
+ vxt->vx_linestatus |= TIOCM_CD;
+ }
+ if (code & E_DSR) {
+ vxt->vx_linestatus |= TIOCM_DSR;
+ }
+ if (code & E_CTS) {
+ vxt->vx_linestatus |= TIOCM_CTS;
+ }
+ if (code & E_LOST_DCD) {
+ vxt->vx_linestatus &= ~TIOCM_CD;
+ }
+ if (code & E_LOST_DSR) {
+ vxt->vx_linestatus &= ~TIOCM_DSR;
+ }
+ if (code & E_LOST_CTS) {
+ vxt->vx_linestatus &= ~TIOCM_CTS;
+ }
+ if (code & E_PR_FAULT) {
+ /* do something... */
+
+ }
+ if (code & E_PR_POUT) {
+ /* do something... */
+
+ }
+ if (code & E_PR_SELECT) {
+ /* do something... */
+
+ }
+ if (code & E_SWITCH) {
+ /* do something... */
+
+ }
+ if (code & E_BREAK) {
+ vx_break (sc, evntp->device_number);
+ }
+
+ /* send and event packet backe to the device */
+ bzero(&evnt, sizeof(struct event_packet));
+ evnt.command = CMD_EVENT;
+ evnt.device_number = evntp->device_number;
+ evnt.command_pipe_number = sc->channel_number;
+ /* return status on same channel */
+ evnt.status_pipe_number = sc->channel_number;
+ /* send packet to the firmware */
+ bpp_send(sc, &evnt, NOWAIT);
+ return 1;
}
void
vx_overflow (sc, port, ptime, msg)
-struct vxsoftc *sc;
-int port;
-long *ptime;
-u_char *msg;
+ struct vxsoftc *sc;
+ int port;
+ long *ptime;
+ u_char *msg;
{
- log(LOG_WARNING, "%s port %d: overrun\n", sc->sc_dev.dv_xname, port);
- return;
+ log(LOG_WARNING, "%s port %d: overrun\n", sc->sc_dev.dv_xname, port);
+ return;
}
void
vx_frame (sc, port)
-struct vxsoftc *sc;
-int port;
+ struct vxsoftc *sc;
+ int port;
{
- log(LOG_WARNING, "%s port %d: frame error\n", sc->sc_dev.dv_xname, port);
- return;
+ log(LOG_WARNING, "%s port %d: frame error\n", sc->sc_dev.dv_xname, port);
+ return;
}
void
vx_break (sc, port)
-struct vxsoftc *sc;
-int port;
+ struct vxsoftc *sc;
+ int port;
{
#ifdef DEBUG_KERN
- Debugger();
+ Debugger();
#else
- log(LOG_WARNING, "%s port %d: break detected\n", sc->sc_dev.dv_xname, port);
+ log(LOG_WARNING, "%s port %d: break detected\n", sc->sc_dev.dv_xname, port);
#endif
- return;
+ return;
}
/*
@@ -1256,114 +1300,114 @@ int port;
void
memcpy2(void *dest, const void *src, size_t size)
{
- int i;
- short *d, *s;
- d = (short*) dest;
- s = (short*) src;
- for (i=0; i<(size/2); i++) {
- *d = *s;
- d++;
- s++;
- }
+ int i;
+ short *d, *s;
+ d = (short*) dest;
+ s = (short*) src;
+ for (i=0; i<(size/2); i++) {
+ *d = *s;
+ d++;
+ s++;
+ }
}
void
wzero(void *addr, size_t size)
{
- int i;
- short *d;
- d = (short*) addr;
- for (i=0; i<(size/2); i++) {
- *d = 0;
- d++;
- }
+ int i;
+ short *d;
+ d = (short*) addr;
+ for (i=0; i<(size/2); i++) {
+ *d = 0;
+ d++;
+ }
}
int
create_free_queue(sc)
struct vxsoftc *sc;
{
- int i;
- struct envelope *envp;
- struct packet *pktp;
-
- envp = (struct envelope *)ENVELOPE_AREA;
- sc->elist_head = envp;
- for (i=0; i < NENVELOPES; i++) {
- bzero(envp, sizeof(struct envelope));
- if (i==(NENVELOPES - 1)) {
- envp->link = NULL;
- } else {
- envp->link = (u_long)envp + sizeof(struct envelope);
- }
- envp->packet_ptr = NULL;
- envp->valid_flag = 0;
- envp++;
- }
- sc->elist_tail = --envp;
-
- pktp = (struct packet *)PACKET_AREA;
- sc->plist_head = pktp;
- for (i=0; i < NPACKETS; i++) {
- bzero(pktp, sizeof(struct packet));
- if (i==(NPACKETS - 1)) {
- pktp->link = NULL;
- } else {
- pktp->link = (u_long)pktp + sizeof(struct packet);
- }
- pktp++;
- }
- sc->plist_tail = --pktp;
- return 0; /* no error */
+ int i;
+ struct envelope *envp;
+ struct packet *pktp;
+
+ envp = (struct envelope *)ENVELOPE_AREA;
+ sc->elist_head = envp;
+ for (i=0; i < NENVELOPES; i++) {
+ bzero(envp, sizeof(struct envelope));
+ if (i==(NENVELOPES - 1)) {
+ envp->link = NULL;
+ } else {
+ envp->link = (u_long)envp + sizeof(struct envelope);
+ }
+ envp->packet_ptr = NULL;
+ envp->valid_flag = 0;
+ envp++;
+ }
+ sc->elist_tail = --envp;
+
+ pktp = (struct packet *)PACKET_AREA;
+ sc->plist_head = pktp;
+ for (i=0; i < NPACKETS; i++) {
+ bzero(pktp, sizeof(struct packet));
+ if (i==(NPACKETS - 1)) {
+ pktp->link = NULL;
+ } else {
+ pktp->link = (u_long)pktp + sizeof(struct packet);
+ }
+ pktp++;
+ }
+ sc->plist_tail = --pktp;
+ return 0; /* no error */
}
void *
get_free_envelope(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- void *envp;
+ void *envp;
- envp = sc->elist_head;
- sc->elist_head = (struct envelope *)sc->elist_head->link;
- bzero(envp, sizeof(struct envelope));
- return envp;
+ envp = sc->elist_head;
+ sc->elist_head = (struct envelope *)sc->elist_head->link;
+ bzero(envp, sizeof(struct envelope));
+ return envp;
}
void
put_free_envelope(sc, ep)
-struct vxsoftc *sc;
-void * ep;
+ struct vxsoftc *sc;
+ void * ep;
{
- struct envelope *envp = (struct envelope *)ep;
- bzero(envp, sizeof(struct envelope));
- sc->elist_tail->link = (ulong)envp;
- envp->link = NULL;
- sc->elist_tail = envp;
+ struct envelope *envp = (struct envelope *)ep;
+ bzero(envp, sizeof(struct envelope));
+ sc->elist_tail->link = (ulong)envp;
+ envp->link = NULL;
+ sc->elist_tail = envp;
}
void*
get_free_packet(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- struct packet *pktp;
+ struct packet *pktp;
- pktp = sc->plist_head;
- sc->plist_head = (struct packet *)sc->plist_head->link;
- bzero(pktp, sizeof(struct packet));
- return pktp;
+ pktp = sc->plist_head;
+ sc->plist_head = (struct packet *)sc->plist_head->link;
+ bzero(pktp, sizeof(struct packet));
+ return pktp;
}
void
put_free_packet(sc, pp)
-struct vxsoftc *sc;
-void *pp;
+ struct vxsoftc *sc;
+ void *pp;
{
- struct packet *pktp = (struct packet *)pp;
- /*bzero(pktp, sizeof(struct packet));*/
- pktp->command = CMD_PROCCESED;
- sc->plist_tail->link = (u_long)pktp;
- pktp->link = NULL;
- sc->plist_tail = pktp;
+ struct packet *pktp = (struct packet *)pp;
+ /*bzero(pktp, sizeof(struct packet));*/
+ pktp->command = CMD_PROCCESED;
+ sc->plist_tail->link = (u_long)pktp;
+ pktp->link = NULL;
+ sc->plist_tail = pktp;
}
/*
@@ -1373,171 +1417,171 @@ void *pp;
*/
int
create_channels(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- struct envelope *envp;
- u_short status;
- u_short tas;
- struct vxreg *ipc_csr;
-
- ipc_csr = sc->vx_reg;
- /* wait for busy bit to clear */
- while ((ipc_csr->ipc_cr & IPC_CR_BUSY));
- create_free_queue(sc);
- /* set up channel header. we only want one */
- tas = ipc_csr->ipc_tas;
- while (!(tas & IPC_TAS_VALID_STATUS)) {
- envp = get_free_envelope(sc);
- sc->channel->command_pipe_head_ptr_h = HI(envp);
- sc->channel->command_pipe_head_ptr_l = LO(envp);
- sc->channel->command_pipe_tail_ptr_h = sc->channel->command_pipe_head_ptr_h;
- sc->channel->command_pipe_tail_ptr_l = sc->channel->command_pipe_head_ptr_l;
- envp = get_free_envelope(sc);
- sc->channel->status_pipe_head_ptr_h = HI(envp);
- sc->channel->status_pipe_head_ptr_l = LO(envp);
- sc->channel->status_pipe_tail_ptr_h = sc->channel->status_pipe_head_ptr_h;
- sc->channel->status_pipe_tail_ptr_l = sc->channel->status_pipe_head_ptr_l;
- sc->channel->interrupt_level = sc->sc_ipl;
- sc->channel->interrupt_vec = sc->sc_vec;
- sc->channel->channel_priority = 0;
- sc->channel->channel_number = 0;
- sc->channel->valid = 1;
- sc->channel->address_modifier = 0x8D; /* A32/D16 supervisor data access */
- sc->channel->datasize = 0; /* 32 bit data mode */
-
- /* loop until TAS bit is zero */
- while ((ipc_csr->ipc_tas & IPC_TAS_TAS));
- ipc_csr->ipc_tas |= IPC_TAS_TAS;
- /* load address of channel header */
- ipc_csr->ipc_addrh = HI(sc->channel);
- ipc_csr->ipc_addrl = LO(sc->channel);
- /* load address modifier reg (supervisor data access) */
- ipc_csr->ipc_amr = 0x8D;
- /* load tas with create channel command */
- ipc_csr->ipc_tas |= IPC_CSR_CREATE;
- /* set vaild command bit */
- ipc_csr->ipc_tas |= IPC_TAS_VALID_CMD;
- /* notify IPC of the CSR command */
- ipc_csr->ipc_cr |= IPC_CR_ATTEN;
- /* loop until IPC sets vaild status bit */
- delay(5000);
- tas = ipc_csr->ipc_tas;
- }
-
- /* save the status */
- status = ipc_csr->ipc_sr;
- /* set COMMAND COMPLETE bit */
- ipc_csr->ipc_tas |= IPC_TAS_COMPLETE;
- /* notify IPC that we are through */
- ipc_csr->ipc_cr |= IPC_CR_ATTEN;
- /* check and see if the channel was created */
- if (!status && sc->channel->valid) {
- sc->channel_number = sc->channel->channel_number;
- printf("%s: created channel %d\n", sc->sc_dev.dv_xname,
- sc->channel->channel_number);
- return 0;
- } else {
- switch (status) {
- case 0x0000:
- printf("%s: channel not valid\n",
- sc->sc_dev.dv_xname);
- break;
- case 0xFFFF:
- printf("%s: invalid CSR command\n",
- sc->sc_dev.dv_xname);
- break;
- case 0xC000:
- printf("%s: could not read channel structure\n",
- sc->sc_dev.dv_xname);
- break;
- case 0x8000:
- printf("%s: could not write channel structure\n",
- sc->sc_dev.dv_xname);
- break;
- default:
- printf("%s: unknown IPC CSR command error 0x%x\n",
- sc->sc_dev.dv_xname, status);
- break;
- }
- return status; /* error */
- }
+ struct envelope *envp;
+ u_short status;
+ u_short tas;
+ struct vxreg *ipc_csr;
+
+ ipc_csr = sc->vx_reg;
+ /* wait for busy bit to clear */
+ while ((ipc_csr->ipc_cr & IPC_CR_BUSY));
+ create_free_queue(sc);
+ /* set up channel header. we only want one */
+ tas = ipc_csr->ipc_tas;
+ while (!(tas & IPC_TAS_VALID_STATUS)) {
+ envp = get_free_envelope(sc);
+ sc->channel->command_pipe_head_ptr_h = HI(envp);
+ sc->channel->command_pipe_head_ptr_l = LO(envp);
+ sc->channel->command_pipe_tail_ptr_h = sc->channel->command_pipe_head_ptr_h;
+ sc->channel->command_pipe_tail_ptr_l = sc->channel->command_pipe_head_ptr_l;
+ envp = get_free_envelope(sc);
+ sc->channel->status_pipe_head_ptr_h = HI(envp);
+ sc->channel->status_pipe_head_ptr_l = LO(envp);
+ sc->channel->status_pipe_tail_ptr_h = sc->channel->status_pipe_head_ptr_h;
+ sc->channel->status_pipe_tail_ptr_l = sc->channel->status_pipe_head_ptr_l;
+ sc->channel->interrupt_level = sc->sc_ipl;
+ sc->channel->interrupt_vec = sc->sc_vec;
+ sc->channel->channel_priority = 0;
+ sc->channel->channel_number = 0;
+ sc->channel->valid = 1;
+ sc->channel->address_modifier = 0x8D; /* A32/D16 supervisor data access */
+ sc->channel->datasize = 0; /* 32 bit data mode */
+
+ /* loop until TAS bit is zero */
+ while ((ipc_csr->ipc_tas & IPC_TAS_TAS));
+ ipc_csr->ipc_tas |= IPC_TAS_TAS;
+ /* load address of channel header */
+ ipc_csr->ipc_addrh = HI(sc->channel);
+ ipc_csr->ipc_addrl = LO(sc->channel);
+ /* load address modifier reg (supervisor data access) */
+ ipc_csr->ipc_amr = 0x8D;
+ /* load tas with create channel command */
+ ipc_csr->ipc_tas |= IPC_CSR_CREATE;
+ /* set vaild command bit */
+ ipc_csr->ipc_tas |= IPC_TAS_VALID_CMD;
+ /* notify IPC of the CSR command */
+ ipc_csr->ipc_cr |= IPC_CR_ATTEN;
+ /* loop until IPC sets vaild status bit */
+ delay(5000);
+ tas = ipc_csr->ipc_tas;
+ }
+
+ /* save the status */
+ status = ipc_csr->ipc_sr;
+ /* set COMMAND COMPLETE bit */
+ ipc_csr->ipc_tas |= IPC_TAS_COMPLETE;
+ /* notify IPC that we are through */
+ ipc_csr->ipc_cr |= IPC_CR_ATTEN;
+ /* check and see if the channel was created */
+ if (!status && sc->channel->valid) {
+ sc->channel_number = sc->channel->channel_number;
+ printf("%s: created channel %d\n", sc->sc_dev.dv_xname,
+ sc->channel->channel_number);
+ return 0;
+ } else {
+ switch (status) {
+ case 0x0000:
+ printf("%s: channel not valid\n",
+ sc->sc_dev.dv_xname);
+ break;
+ case 0xFFFF:
+ printf("%s: invalid CSR command\n",
+ sc->sc_dev.dv_xname);
+ break;
+ case 0xC000:
+ printf("%s: could not read channel structure\n",
+ sc->sc_dev.dv_xname);
+ break;
+ case 0x8000:
+ printf("%s: could not write channel structure\n",
+ sc->sc_dev.dv_xname);
+ break;
+ default:
+ printf("%s: unknown IPC CSR command error 0x%x\n",
+ sc->sc_dev.dv_xname, status);
+ break;
+ }
+ return status; /* error */
+ }
}
void
print_dump(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- char *dump_area;
- char dump[209];
- bzero(&dump, 209);
+ char *dump_area;
+ char dump[209];
+ bzero(&dump, 209);
- dump_area = (char *)0xff780030;
- memcpy2(&dump, dump_area, 208);
-
- printf("%s", dump);
+ dump_area = (char *)0xff780030;
+ memcpy2(&dump, dump_area, 208);
+
+ printf("%s", dump);
}
void *
get_next_envelope(thisenv)
-struct envelope *thisenv;
+ struct envelope *thisenv;
{
- return ((void *)thisenv->link);
+ return ((void *)thisenv->link);
}
int
env_isvalid(thisenv)
-struct envelope *thisenv;
+ struct envelope *thisenv;
{
- return thisenv->valid_flag;
+ return thisenv->valid_flag;
}
struct envelope *
get_cmd_tail(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- unsigned long retaddr;
- retaddr = (unsigned long)sc->vx_reg;
- retaddr += sc->channel->command_pipe_tail_ptr_l;
- return ((struct envelope *)retaddr);
+ unsigned long retaddr;
+ retaddr = (unsigned long)sc->vx_reg;
+ retaddr += sc->channel->command_pipe_tail_ptr_l;
+ return ((struct envelope *)retaddr);
}
struct envelope *
get_status_head(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- unsigned long retaddr;
- retaddr = (unsigned long)sc->vx_reg;
- retaddr += sc->channel->status_pipe_head_ptr_l;
- return ((struct envelope *)retaddr);
+ unsigned long retaddr;
+ retaddr = (unsigned long)sc->vx_reg;
+ retaddr += sc->channel->status_pipe_head_ptr_l;
+ return ((struct envelope *)retaddr);
}
void
set_status_head(sc, envp)
-struct vxsoftc *sc;
-void *envp;
+ struct vxsoftc *sc;
+ void *envp;
{
- sc->channel->status_pipe_head_ptr_h = HI(envp);
- sc->channel->status_pipe_head_ptr_l = LO(envp);
- return;
+ sc->channel->status_pipe_head_ptr_h = HI(envp);
+ sc->channel->status_pipe_head_ptr_l = LO(envp);
+ return;
}
struct packet *
get_packet(sc, thisenv)
-struct vxsoftc *sc;
-struct envelope *thisenv;
+ struct vxsoftc *sc;
+ struct envelope *thisenv;
{
- unsigned long baseaddr;
-
- if (thisenv == NULL) return NULL;
- baseaddr = (unsigned long)sc->vx_reg;
- /*
- * packet ptr returned on status pipe is only last two bytes
- * so we must supply the full address based on the board address.
- * This also works for all envelopes because every address is an
- * offset to the board address
- */
- baseaddr |= thisenv->packet_ptr;
- return ((void*)baseaddr);
+ unsigned long baseaddr;
+
+ if (thisenv == NULL) return NULL;
+ baseaddr = (unsigned long)sc->vx_reg;
+ /*
+ * packet ptr returned on status pipe is only last two bytes
+ * so we must supply the full address based on the board address.
+ * This also works for all envelopes because every address is an
+ * offset to the board address
+ */
+ baseaddr |= thisenv->packet_ptr;
+ return ((void*)baseaddr);
}
/*
@@ -1546,127 +1590,127 @@ struct envelope *thisenv;
int
bpp_send(struct vxsoftc *sc, void *pkt, int wait_flag)
{
- struct envelope *envp;
- struct packet *pktp;
- unsigned long newenv;
-
-
- /* load up packet in dual port mem */
- pktp = get_free_packet(sc);
- memcpy2(pktp, pkt, sizeof(struct packet));
-
- envp = get_cmd_tail(sc);
- newenv = (unsigned long)get_free_envelope(sc); /* put a NULL env on the tail */
- envp->link = newenv;
- sc->channel->command_pipe_tail_ptr_h = HI(newenv);
- sc->channel->command_pipe_tail_ptr_l = LO(newenv);
- envp->packet_ptr = (u_long)pktp; /* add the command packet */
- envp->valid_flag = 1; /* set valid command flag */
-
- sc->vx_reg->ipc_cr |= IPC_CR_ATTEN;
- if (wait_flag) { /* wait for a packet to return */
- while (pktp->command != CMD_PROCCESED) {
+ struct envelope *envp;
+ struct packet *pktp;
+ unsigned long newenv;
+
+
+ /* load up packet in dual port mem */
+ pktp = get_free_packet(sc);
+ memcpy2(pktp, pkt, sizeof(struct packet));
+
+ envp = get_cmd_tail(sc);
+ newenv = (unsigned long)get_free_envelope(sc); /* put a NULL env on the tail */
+ envp->link = newenv;
+ sc->channel->command_pipe_tail_ptr_h = HI(newenv);
+ sc->channel->command_pipe_tail_ptr_l = LO(newenv);
+ envp->packet_ptr = (u_long)pktp; /* add the command packet */
+ envp->valid_flag = 1; /* set valid command flag */
+
+ sc->vx_reg->ipc_cr |= IPC_CR_ATTEN;
+ if (wait_flag) { /* wait for a packet to return */
+ while (pktp->command != CMD_PROCCESED) {
#ifdef DEBUG_VXT
- printf("Polling for packet 0x%x in envelope 0x%x...\n", pktp, envp);
+ printf("Polling for packet 0x%x in envelope 0x%x...\n", pktp, envp);
#endif
- vx_intr(sc);
- delay(5000);
- }
- memcpy2(pkt, pktp, sizeof(struct packet));
- return 0;
- }
- return 0; /* no error */
+ vx_intr(sc);
+ delay(5000);
+ }
+ memcpy2(pkt, pktp, sizeof(struct packet));
+ return 0;
+ }
+ return 0; /* no error */
}
/*
* BPP commands
*/
+
int
vx_init(sc)
-struct vxsoftc *sc;
+ struct vxsoftc *sc;
{
- int i;
- struct init_info *infp, inf;
- struct wring *wringp;
- struct rring *rringp;
- struct termio def_termio;
- struct init_packet init;
- struct event_packet evnt;
-
- bzero(&def_termio, sizeof(struct termio));
- /* init wait queue */
- bzero(&sc->sc_bppwait_pkt, sizeof(struct packet));
- sc->sc_bppwait_pktp = NULL;
- /* set up init_info array */
- wringp = (struct wring *)WRING_AREA;
- rringp = (struct rring *)RRING_AREA;
- infp = (struct init_info *)INIT_INFO_AREA;
- for (i=0; i<9; i++) {
- bzero(&inf, sizeof(struct init_info));
- infp->write_ring_ptr_h = HI(wringp);
- infp->write_ring_ptr_l = LO(wringp);
- sc->sc_info[i].wringp = wringp;
- infp->read_ring_ptr_h = HI(rringp);
- infp->read_ring_ptr_l = LO(rringp);
- sc->sc_info[i].rringp = rringp;
+ int i;
+ struct init_info *infp, inf;
+ struct wring *wringp;
+ struct rring *rringp;
+ struct termio def_termio;
+ struct init_packet init;
+ struct event_packet evnt;
+
+ bzero(&def_termio, sizeof(struct termio));
+ /* init wait queue */
+ bzero(&sc->sc_bppwait_pkt, sizeof(struct packet));
+ sc->sc_bppwait_pktp = NULL;
+ /* set up init_info array */
+ wringp = (struct wring *)WRING_AREA;
+ rringp = (struct rring *)RRING_AREA;
+ infp = (struct init_info *)INIT_INFO_AREA;
+ for (i=0; i<9; i++) {
+ bzero(&inf, sizeof(struct init_info));
+ infp->write_ring_ptr_h = HI(wringp);
+ infp->write_ring_ptr_l = LO(wringp);
+ sc->sc_info[i].wringp = wringp;
+ infp->read_ring_ptr_h = HI(rringp);
+ infp->read_ring_ptr_l = LO(rringp);
+ sc->sc_info[i].rringp = rringp;
#ifdef DEBUG_VXT
- printf("write at 0x%8x, read at 0x%8x\n", wringp, rringp);
+ printf("write at 0x%8x, read at 0x%8x\n", wringp, rringp);
#endif
- infp->write_ring_size = WRING_DATA_SIZE;
- infp->read_ring_size = RRING_DATA_SIZE;
- infp->def_termio.c_iflag = VBRKINT;
- infp->def_termio.c_oflag = 0;
- infp->def_termio.c_cflag = (VB9600 | VCS8);
-
- infp->def_termio.c_lflag = VISIG; /* enable signal processing */
- infp->def_termio.c_line = 1; /* raw line disipline, we want to control it! */
- infp->def_termio.c_cc[0] = CINTR;
- infp->def_termio.c_cc[1] = CQUIT;
- infp->def_termio.c_cc[2] = CERASE;
- infp->def_termio.c_cc[3] = CKILL;
- infp->def_termio.c_cc[4] = 20;
- infp->def_termio.c_cc[5] = 2;
- infp->reserved1 = 0; /* Must be Zero */
- infp->reserved2 = 0;
- infp->reserved3 = 0;
- infp->reserved4 = 0;
- wringp++; rringp++; infp++;
- }
- /* set up init_packet */
- bzero(&init, sizeof(struct init_packet));
- init.eye_catcher[0] = 0x12;
- init.eye_catcher[1] = 0x34;
- init.eye_catcher[2] = 0x56;
- init.eye_catcher[3] = 0x78;
- init.command = CMD_INIT;
- init.command_pipe_number = sc->channel_number;
- /* return status on the same channel */
- init.status_pipe_number = sc->channel_number;
- init.interrupt_level = sc->sc_ipl;
- init.interrupt_vec = sc->sc_vec;
- init.init_info_ptr_h = HI(INIT_INFO_AREA);
- init.init_info_ptr_l = LO(INIT_INFO_AREA);
-
- /* send packet to the firmware and wait for completion */
- bpp_send(sc, &init, WAIT_POLL);
-
- /* check for error */
- if (init.error_l !=0) {
- return init.error_l;
- } else {
- /* send one event packet to each device; */
- for (i=0; i<9; i++) {
- bzero(&evnt, sizeof(struct event_packet));
- evnt.command = CMD_EVENT;
- evnt.device_number = i;
- evnt.command_pipe_number = sc->channel_number;
- /* return status on same channel */
- evnt.status_pipe_number = sc->channel_number;
- /* send packet to the firmware */
- bpp_send(sc, &evnt, NOWAIT);
- }
- return 0;
- }
+ infp->write_ring_size = WRING_DATA_SIZE;
+ infp->read_ring_size = RRING_DATA_SIZE;
+ infp->def_termio.c_iflag = VBRKINT;
+ infp->def_termio.c_oflag = 0;
+ infp->def_termio.c_cflag = (VB9600 | VCS8);
+
+ infp->def_termio.c_lflag = VISIG; /* enable signal processing */
+ infp->def_termio.c_line = 1; /* raw line disipline, we want to control it! */
+ infp->def_termio.c_cc[0] = CINTR;
+ infp->def_termio.c_cc[1] = CQUIT;
+ infp->def_termio.c_cc[2] = CERASE;
+ infp->def_termio.c_cc[3] = CKILL;
+ infp->def_termio.c_cc[4] = 20;
+ infp->def_termio.c_cc[5] = 2;
+ infp->reserved1 = 0; /* Must be Zero */
+ infp->reserved2 = 0;
+ infp->reserved3 = 0;
+ infp->reserved4 = 0;
+ wringp++; rringp++; infp++;
+ }
+ /* set up init_packet */
+ bzero(&init, sizeof(struct init_packet));
+ init.eye_catcher[0] = 0x12;
+ init.eye_catcher[1] = 0x34;
+ init.eye_catcher[2] = 0x56;
+ init.eye_catcher[3] = 0x78;
+ init.command = CMD_INIT;
+ init.command_pipe_number = sc->channel_number;
+ /* return status on the same channel */
+ init.status_pipe_number = sc->channel_number;
+ init.interrupt_level = sc->sc_ipl;
+ init.interrupt_vec = sc->sc_vec;
+ init.init_info_ptr_h = HI(INIT_INFO_AREA);
+ init.init_info_ptr_l = LO(INIT_INFO_AREA);
+
+ /* send packet to the firmware and wait for completion */
+ bpp_send(sc, &init, WAIT_POLL);
+
+ /* check for error */
+ if (init.error_l !=0) {
+ return init.error_l;
+ } else {
+ /* send one event packet to each device; */
+ for (i=0; i<9; i++) {
+ bzero(&evnt, sizeof(struct event_packet));
+ evnt.command = CMD_EVENT;
+ evnt.device_number = i;
+ evnt.command_pipe_number = sc->channel_number;
+ /* return status on same channel */
+ evnt.status_pipe_number = sc->channel_number;
+ /* send packet to the firmware */
+ bpp_send(sc, &evnt, NOWAIT);
+ }
+ return 0;
+ }
}
-
diff --git a/sys/arch/mvme88k/include/assert.h b/sys/arch/mvme88k/include/assert.h
index 7d7568de671..4aa9f896a24 100644
--- a/sys/arch/mvme88k/include/assert.h
+++ b/sys/arch/mvme88k/include/assert.h
@@ -1,6 +1,7 @@
-/* $OpenBSD: assert.h,v 1.5 2001/01/14 20:25:23 smurph Exp $ */
+/* $OpenBSD: assert.h,v 1.6 2001/03/09 05:44:40 smurph Exp $ */
#ifndef __MACHINE_ASSERT_H__
#define __MACHINE_ASSERT_H__
+#ifndef assert
#define assert(x) \
({\
if (!(x)) {\
@@ -9,4 +10,6 @@
panic("assertion"); \
} \
})
+#endif /* assert */
#endif __MACHINE_ASSERT_H__
+
diff --git a/sys/arch/mvme88k/include/bugio.h b/sys/arch/mvme88k/include/bugio.h
index 8c196174930..2afc6b72ed0 100644
--- a/sys/arch/mvme88k/include/bugio.h
+++ b/sys/arch/mvme88k/include/bugio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugio.h,v 1.7 2001/01/14 20:25:23 smurph Exp $ */
+/* $OpenBSD: bugio.h,v 1.8 2001/03/09 05:44:40 smurph Exp $ */
#ifndef __MACHINE_BUGIO_H__
#define __MACHINE_BUGIO_H__
#include "sys/cdefs.h"
@@ -74,27 +74,28 @@ struct bugniocall {
unsigned char ci;
unsigned char cd;
#define NETCTRL_INITDEVICE 0
-#define NETCTRL_GETHDW 1
-#define NETCTRL_TX 2
-#define NETCTRL_RX 3
-#define NETCTRL_FLUSH 4
-#define NETCTRL_RESET 5
+#define NETCTRL_GETHDW 1
+#define NETCTRL_TX 2
+#define NETCTRL_RX 3
+#define NETCTRL_FLUSH 4
+#define NETCTRL_RESET 5
unsigned long cid;
unsigned long memaddr;
unsigned long nbytes;
unsigned long csword;
};
-
-char buginchr __P((void));
+void buginit __P((void));
int buginstat __P((void));
-int bugoutchr __P((unsigned char));
-int bugoutstr __P((char *, char *));
-int bugpcrlf __P((void));
+char buginchr __P((void));
+void bugoutchr __P((unsigned char));
+void bugoutstr __P((char *, char *));
+void bugpcrlf __P((void));
int bugdskrd __P((struct bugdisk_io *));
int bugdskwr __P((struct bugdisk_io *));
-int bugrtcrd __P((struct bugrtc *));
-int bugreturn __P((void));
-int bugbrdid __P((struct bugbrdid *));
-int bugnetctrl __P((struct bugniocall *));
+void bugrtcrd __P((struct bugrtc *));
+void bugreturn __P((void));
+int bugfork __P((int cpu, unsigned address));
+void bugbrdid __P((struct bugbrdid *));
+void bugnetctrl __P((struct bugniocall *));
#endif __MACHINE_BUGIO_H__
diff --git a/sys/arch/mvme88k/include/cmmu.h b/sys/arch/mvme88k/include/cmmu.h
index bb0b8a42833..242d78cde52 100644
--- a/sys/arch/mvme88k/include/cmmu.h
+++ b/sys/arch/mvme88k/include/cmmu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmmu.h,v 1.2 2001/03/07 23:37:15 miod Exp $ */
+/* $OpenBSD: cmmu.h,v 1.3 2001/03/09 05:44:40 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -71,13 +71,19 @@ extern unsigned ncpus;
extern unsigned cache_policy;
#ifdef CMMU_DEBUG
- void show_apr(unsigned value);
- void show_sctr(unsigned value);
+void show_apr(unsigned value);
+void show_sctr(unsigned value);
#endif
+#if DDB
+void cmmu_show_translation(unsigned, unsigned, unsigned, int);
+void cmmu_cache_state(unsigned, unsigned);
+void show_cmmu_info(unsigned);
+#endif
/*
- * Prototypes from "mvme88k/mvme88k/cmmu.c"
+ * Prototypes from "mvme88k/mvme88k/cmmu.c
*/
+
unsigned cmmu_cpu_number(void);
#if !DDB
static
@@ -90,6 +96,12 @@ void cmmu_parity_enable(void);
#if !DDB
static
#endif /* !DDB */
+void setup_board_config(void);
+void setup_cmmu_config(void);
+void cmmu_dump_config(void);
+unsigned cmmu_get_by_mode(int cpu, int mode);
+void cpu_configuration_print(int master);
+void dma_cachectl(vm_offset_t va, int size, int op);
void cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
void cmmu_set_sapr(unsigned ap);
void cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
diff --git a/sys/arch/mvme88k/include/cpu.h b/sys/arch/mvme88k/include/cpu.h
index 15196e36f98..a2e41ad04cf 100644
--- a/sys/arch/mvme88k/include/cpu.h
+++ b/sys/arch/mvme88k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.8 2001/03/07 23:42:32 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.9 2001/03/09 05:44:40 smurph Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Copyright (c) 1992, 1993
@@ -89,6 +89,11 @@ extern int intstack;
#define CLKF_INTR(framep) (((struct trapframe *)(framep))->r[31] > intstack)
/*
+ * Get interrupt glue.
+ */
+#include <machine/intr.h>
+
+/*
* Internal IO space (iiomapsize).
*
* Internal IO space is mapped in the kernel from ``OBIO_START'' to
diff --git a/sys/arch/mvme88k/include/db_machdep.h b/sys/arch/mvme88k/include/db_machdep.h
index 0efd4ec2018..b25d1493006 100644
--- a/sys/arch/mvme88k/include/db_machdep.h
+++ b/sys/arch/mvme88k/include/db_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.h,v 1.6 2001/03/08 00:03:22 miod Exp $ */
+/* $OpenBSD: db_machdep.h,v 1.7 2001/03/09 05:44:40 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -109,6 +109,8 @@ boolean_t inst_branch __P((unsigned));
db_addr_t next_instr_address __P((db_addr_t, unsigned));
db_addr_t branch_taken __P((u_int, db_addr_t,
db_expr_t (*) __P((db_regs_t *, int)), db_regs_t *));
+int ddb_break_trap __P((int type, db_regs_t *eframe));
+int ddb_entry_trap __P((int level, db_regs_t *eframe));
/* breakpoint/watchpoint foo */
#define IS_BREAKPOINT_TRAP(type,code) ((type)==T_KDB_BREAK)
diff --git a/sys/arch/mvme88k/include/intr.h b/sys/arch/mvme88k/include/intr.h
new file mode 100644
index 00000000000..c742dbb69f3
--- /dev/null
+++ b/sys/arch/mvme88k/include/intr.h
@@ -0,0 +1,130 @@
+/* $OpenBSD: intr.h,v 1.1 2001/03/09 05:44:40 smurph Exp $ */
+/*
+ * Copyright (C) 2000 Steve Murphree, Jr.
+ * 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.
+ * 3. 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 _MVME88K_INTR_H_
+#define _MVME88K_INTR_H_
+/*
+ * INTERRUPT STAT levels. for 'systat vmstat'
+ * intrcnt and friends are defined in locore.S
+ * XXX smurph
+ */
+
+#ifndef _LOCORE
+
+#define M88K_NIRQ 12
+
+#define M88K_SPUR_IRQ 0
+#define M88K_LEVEL1_IRQ 1
+#define M88K_LEVEL2_IRQ 2
+#define M88K_LEVEL3_IRQ 3
+#define M88K_LEVEL4_IRQ 4
+#define M88K_LEVEL5_IRQ 5
+#define M88K_LEVEL6_IRQ 6
+#define M88K_LEVEL7_IRQ 7
+/*
+ * We keep track of these seperately, but
+ * they will be reflected with the above also.
+ */
+#define M88K_CLK_IRQ 8
+#define M88K_SCLK_IRQ 9
+#define M88K_PCLK_IRQ 10
+#define M88K_NMI_IRQ 11
+
+extern int intrcnt[M88K_NIRQ];
+
+#endif
+
+/*
+ * IPL levels.
+ * We use 6 as IPL_HIGH so that abort can be programmed at 7 so that
+ * it is always possible to break into the system unless interrupts
+ * are disabled.
+ */
+
+#define IPL_NONE 0
+#define IPL_SOFTCLOCK 1
+#define IPL_SOFTNET 1
+#define IPL_BIO 2
+#define IPL_NET 3
+#define IPL_IMP 3
+#define IPL_TTY 3
+#define IPL_CLOCK 5
+#define IPL_STATCLOCK 5
+#define IPL_VM 6
+#define IPL_HIGH 6
+#define IPL_SCHED 6
+#define IPL_NMI 7
+#define IPL_ABORT 7
+
+#ifndef ASSEMBLER
+#ifdef _KERNEL
+unsigned setipl __P((unsigned level));
+#if DDB
+unsigned db_setipl __P((unsigned level));
+#endif
+int spl0 __P((void));
+#endif /* ASSEMBLER */
+
+/* needs major cleanup - XXX nivas */
+
+#if 0
+spl0 is a function by itself. I really am serious about the clean up
+above...
+#define spl0() spln(0)
+#endif /* 0 */
+#define spl1() setipl(1)
+#define spl2() setipl(2)
+#define spl3() setipl(3)
+#define spl4() setipl(4)
+#define spl5() setipl(5)
+#define spl6() setipl(6)
+#define spl7() setipl(7)
+
+#define splnone spl0
+#define spllowersoftclock() setipl(IPL_SOFTCLOCK)
+#define splsoftclock() setipl(IPL_SOFTCLOCK)
+#define splsoftnet() setipl(IPL_SOFTNET)
+#define splbio() setipl(IPL_BIO)
+#define splnet() setipl(IPL_NET)
+#define spltty() setipl(IPL_TTY)
+#define splclock() setipl(IPL_CLOCK)
+#define splstatclock() setipl(IPL_STATCLOCK)
+#define splimp() setipl(IPL_IMP)
+#define splvm() setipl(IPL_VM)
+#define splhigh() setipl(IPL_HIGH)
+#define splsched() setipl(IPL_SCHED)
+
+#define splx(x) ((x) ? setipl((x)) : spl0())
+
+#if DDB
+#define db_splx(x) db_setipl((x))
+#define db_splhigh() db_setipl(IPL_HIGH)
+#endif /* DDB */
+
+#endif /* _KERNEL */
+#endif /* _MVME88K_INTR_H_ */
diff --git a/sys/arch/mvme88k/include/locore.h b/sys/arch/mvme88k/include/locore.h
index 68e95ba9b49..7c8403e3671 100644
--- a/sys/arch/mvme88k/include/locore.h
+++ b/sys/arch/mvme88k/include/locore.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.h,v 1.6 2001/03/08 00:03:22 miod Exp $ */
+/* $OpenBSD: locore.h,v 1.7 2001/03/09 05:44:40 smurph Exp $ */
#ifndef _MACHINE_LOCORE_H_
#define _MACHINE_LOCORE_H_
@@ -28,4 +28,15 @@ extern unsigned do_xmem_word __P((vm_offset_t address, unsigned int data,
extern unsigned do_xmem_byte __P((vm_offset_t address, unsigned int data,
boolean_t supervisor_mode));
+extern unsigned read_processor_identification_register __P((void));
+extern int badaddr __P((vm_offset_t addr, int size));
+extern void set_cpu_number __P((unsigned number));
+extern void doboot __P((void));
+
+#if defined(MVME187) || defined(MVME188)
+extern void dae_print __P((unsigned *eframe));
+extern void data_access_emulation __P((unsigned *eframe));
+extern int guarded_access( );
+#endif
+
#endif /* _MACHINE_LOCORE_H_ */
diff --git a/sys/arch/mvme88k/include/m88110.h b/sys/arch/mvme88k/include/m88110.h
index 66ffb2900bf..c3edb14fd38 100644
--- a/sys/arch/mvme88k/include/m88110.h
+++ b/sys/arch/mvme88k/include/m88110.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.h,v 1.3 2001/03/07 23:37:16 miod Exp $ */
+/* $OpenBSD: m88110.h,v 1.4 2001/03/09 05:44:40 smurph Exp $ */
#ifndef __MACHINE_M88110_H__
#define __MACHINE_M88110_H__
@@ -132,6 +132,12 @@ void m197_cmmu_parity_enable(void);
#if !DDB
static
#endif /* !DDB */
+void m197_setup_board_config(void);
+void m197_setup_cmmu_config(void);
+void m197_cmmu_dump_config(void);
+unsigned m197_cmmu_get_by_mode(int cpu, int mode);
+void m197_cpu_configuration_print(int master);
+void m197_dma_cachectl(vm_offset_t va, int size, int op);
void m197_cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
void m197_cmmu_set_sapr(unsigned ap);
void m197_cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
diff --git a/sys/arch/mvme88k/include/m882xx.h b/sys/arch/mvme88k/include/m882xx.h
index d4b5260f0af..188d1403324 100644
--- a/sys/arch/mvme88k/include/m882xx.h
+++ b/sys/arch/mvme88k/include/m882xx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: m882xx.h,v 1.6 2001/03/07 23:37:16 miod Exp $ */
+/* $OpenBSD: m882xx.h,v 1.7 2001/03/09 05:44:40 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -135,6 +135,11 @@
/*
* Prototypes from "mvme88k/mvme88k/m18x_cmmu.c"
*/
+#if DDB
+void m18x_cmmu_show_translation(unsigned, unsigned, unsigned, int);
+void m18x_cmmu_cache_state(unsigned, unsigned);
+void m18x_show_cmmu_info(unsigned);
+#endif
#ifdef CMMU_DEBUG
void m18x_show_apr(unsigned value);
@@ -153,6 +158,13 @@ void m18x_cmmu_parity_enable(void);
#if !DDB
static
#endif /* !DDB */
+int m18x_cmmu_alive(int mmu);
+void m18x_setup_board_config(void);
+void m18x_setup_cmmu_config(void);
+void m18x_cmmu_dump_config(void);
+unsigned m18x_cmmu_get_by_mode(int cpu, int mode);
+void m18x_cpu_configuration_print(int master);
+void m18x_dma_cachectl(vm_offset_t va, int size, int op);
void m18x_cmmu_remote_set(unsigned cpu, unsigned r, unsigned data, unsigned x);
void m18x_cmmu_set_sapr(unsigned ap);
void m18x_cmmu_remote_set_sapr(unsigned cpu, unsigned ap);
diff --git a/sys/arch/mvme88k/include/mmu.h b/sys/arch/mvme88k/include/mmu.h
index 0a6bef314c4..67eca239b82 100644
--- a/sys/arch/mvme88k/include/mmu.h
+++ b/sys/arch/mvme88k/include/mmu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mmu.h,v 1.6 2001/01/14 20:25:24 smurph Exp $ */
+/* $OpenBSD: mmu.h,v 1.7 2001/03/09 05:44:40 smurph Exp $ */
/*
* Ashura Project
*/
@@ -307,7 +307,7 @@ extern vm_offset_t kmapva;
sdt = (sdt_entry_t *)kmapva + SDTIDX(va) + SDT_ENTRIES; \
(pte_template_t *)(sdt->table_addr << PDT_SHIFT) + PDTIDX(va); \
})
-
+u_int kvtop( );
#define DMA_CACHE_SYNC 0x1
#define DMA_CACHE_SYNC_INVAL 0x2
diff --git a/sys/arch/mvme88k/include/param.h b/sys/arch/mvme88k/include/param.h
index d03e3190454..6f229547d5c 100644
--- a/sys/arch/mvme88k/include/param.h
+++ b/sys/arch/mvme88k/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.14 2001/03/07 23:50:35 miod Exp $ */
+/* $OpenBSD: param.h,v 1.15 2001/03/09 05:44:40 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* Copyright (c) 1988 University of Utah.
@@ -40,7 +40,7 @@
* from: Utah $Hdr: machparam.h 1.11 89/08/14$
*
* @(#)param.h 7.8 (Berkeley) 6/28/91
- * $Id: param.h,v 1.14 2001/03/07 23:50:35 miod Exp $
+ * $Id: param.h,v 1.15 2001/03/09 05:44:40 smurph Exp $
*/
#ifndef _MACHINE_PARAM_H_
#define _MACHINE_PARAM_H_
@@ -173,6 +173,13 @@
#define mvme88k_btop(x) ((unsigned)(x) >> PGSHIFT)
#define mvme88k_ptob(x) ((unsigned)(x) << PGSHIFT)
+#include <machine/psl.h>
+
+/*
+ * Get interrupt glue.
+ */
+#include <machine/intr.h>
+
#ifdef _KERNEL
extern int delay __P((int));
#define DELAY(x) delay(x)
diff --git a/sys/arch/mvme88k/include/psl.h b/sys/arch/mvme88k/include/psl.h
index 23b6295474f..fc5bdc4ab33 100644
--- a/sys/arch/mvme88k/include/psl.h
+++ b/sys/arch/mvme88k/include/psl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: psl.h,v 1.7 2001/03/07 23:37:17 miod Exp $ */
+/* $OpenBSD: psl.h,v 1.8 2001/03/09 05:44:40 smurph Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -45,98 +45,6 @@
#ifndef __M88K_M88100_PSL_H__
#define __M88K_M88100_PSL_H__
-/*
- * INTERRUPT STAT levels. for 'systat vmstat'
- * intrcnt and friends are defined in locore.S
- * XXX smurph
- */
-#ifndef _LOCORE
-
-#define M88K_NIRQ 12
-
-#define M88K_SPUR_IRQ 0
-#define M88K_LEVEL1_IRQ 1
-#define M88K_LEVEL2_IRQ 2
-#define M88K_LEVEL3_IRQ 3
-#define M88K_LEVEL4_IRQ 4
-#define M88K_LEVEL5_IRQ 5
-#define M88K_LEVEL6_IRQ 6
-#define M88K_LEVEL7_IRQ 7
-/*
- * We keep track of these seperately, but
- * they will be reflected with the above also.
- */
-#define M88K_CLK_IRQ 8
-#define M88K_SCLK_IRQ 9
-#define M88K_PCLK_IRQ 10
-#define M88K_NMI_IRQ 11
-
-extern int intrcnt[M88K_NIRQ];
-
-#endif
-
-
-/* needs major cleanup - XXX nivas */
-
-#ifndef _LOCORE
-unsigned setipl __P((unsigned));
-#endif
-
-#if 0
-spl0 is a function by itself. I really am serious about the clean up
-above...
-#define spl0() spln(0)
-#else
-#ifndef _LOCORE
-int spl0 __P((void));
-#endif
-#endif /* 0 */
-#define spl1() setipl(1)
-#define spl2() setipl(2)
-#define spl3() setipl(3)
-#define spl4() setipl(4)
-#define spl5() setipl(5)
-#define spl6() setipl(6)
-#define spl7() setipl(7)
-
-/*
- * IPL levels.
- * We use 6 as IPL_HIGH so that abort can be programmed at 7 so that
- * it is always possible to break into the system unless interrupts
- * are disabled.
- */
-
-#define IPL_NONE 0
-#define IPL_SOFTCLOCK 1
-#define IPL_SOFTNET 1
-#define IPL_BIO 2
-#define IPL_NET 3
-#define IPL_TTY 3
-#define IPL_CLOCK 5
-#define IPL_STATCLOCK 5
-#define IPL_IMP 6
-#define IPL_VM 6
-#define IPL_HIGH 6
-#define IPL_SCHED 6
-#define IPL_NMI 7
-#define IPL_ABORT 7
-
-#define splnone spl0
-#define spllowersoftclock() setipl(IPL_SOFTCLOCK)
-#define splsoftclock() setipl(IPL_SOFTCLOCK)
-#define splsoftnet() setipl(IPL_SOFTNET)
-#define splbio() setipl(IPL_BIO)
-#define splnet() setipl(IPL_NET)
-#define spltty() setipl(IPL_TTY)
-#define splclock() setipl(IPL_CLOCK)
-#define splstatclock() setipl(IPL_STATCLOCK)
-#define splimp() setipl(IPL_IMP)
-#define splvm() setipl(IPL_VM)
-#define splhigh() setipl(IPL_HIGH)
-#define splsched() setipl(IPL_SCHED)
-
-#define splx(x) ((x) ? setipl((x)) : spl0())
-
/*
* 88100 control registers
*/
diff --git a/sys/arch/mvme88k/include/trap.h b/sys/arch/mvme88k/include/trap.h
index 681804c94aa..bc0aeba3e71 100644
--- a/sys/arch/mvme88k/include/trap.h
+++ b/sys/arch/mvme88k/include/trap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.h,v 1.7 2001/02/01 03:38:18 smurph Exp $ */
+/* $OpenBSD: trap.h,v 1.8 2001/03/09 05:44:40 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1992 Carnegie Mellon University
@@ -72,5 +72,36 @@
#define T_INT 28 /* interrupt exception */
#define T_USER 29 /* user mode fault */
+#ifndef ASSEMBLER
+void panictrap(int type, struct m88100_saved_state *frame);
+void test_trap2(int num, int m197);
+void test_trap(struct m88100_saved_state *frame);
+void error_fault(struct m88100_saved_state *frame);
+void error_reset(struct m88100_saved_state *frame);
+void child_return(struct proc *p);
+u_long allocate_sir(void (*proc)(), void *arg);
+void init_sir();
+unsigned ss_get_value(struct proc *p, unsigned addr, int size);
+int ss_put_value(struct proc *p, unsigned addr, unsigned value, int size);
+unsigned ss_branch_taken(unsigned inst, unsigned pc,
+ unsigned (*func)(unsigned int, struct trapframe *),
+ struct trapframe *func_data); /* 'opaque' */
+unsigned ss_getreg_val(unsigned regno, struct trapframe *tf);
+int ss_inst_branch(unsigned ins);
+int ss_inst_delayed(unsigned ins);
+unsigned ss_next_instr_address(struct proc *p, unsigned pc, unsigned delay_slot);
+int cpu_singlestep(register struct proc *p);
+
+#if defined(MVME187) || defined(MVME188)
+void trap(unsigned type, struct m88100_saved_state *frame);
+void syscall(register_t code, struct m88100_saved_state *tf);
+#endif /* defined(MVME187) || defined(MVME188) */
+
+#ifdef MVME197
+void trap2(unsigned type, struct m88100_saved_state *frame);
+void m197_syscall(register_t code, struct m88100_saved_state *tf);
+#endif /* MVME197 */
+#endif /* ASSEMBLER */
+
#endif __MACHINE_TRAP_H__
diff --git a/sys/arch/mvme88k/mvme88k/autoconf.c b/sys/arch/mvme88k/mvme88k/autoconf.c
index 675953275c8..af2e23df2da 100644
--- a/sys/arch/mvme88k/mvme88k/autoconf.c
+++ b/sys/arch/mvme88k/mvme88k/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.8 2001/01/13 05:18:59 smurph Exp $ */
+/* $OpenBSD: autoconf.c,v 1.9 2001/03/09 05:44:41 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -54,13 +54,13 @@
* the machine.
*/
-struct device *parsedisk __P((char *, int, int, dev_t *));
-void setroot __P((void));
-void swapconf __P((void));
-void configure __P((void));
-char buginchr __P((void));
-int getsb __P((char *, int));
-
+struct device *parsedisk __P((char *, int, int, dev_t *));
+void setroot __P((void));
+void swapconf __P((void));
+void configure __P((void));
+char buginchr __P((void));
+int getsb __P((char *, int));
+void dumpconf __P((void));
int cold; /* 1 if still booting */
#include <sys/kernel.h>
@@ -97,15 +97,15 @@ configure()
/*ARGSUSED*/
int
simple_devprint(auxp, pnp)
-void *auxp;
-char *pnp;
+ void *auxp;
+ char *pnp;
{
return (QUIET);
}
int
matchname(fp, sp)
-char *fp, *sp;
+ char *fp, *sp;
{
int len;
@@ -154,7 +154,7 @@ struct nam2blk {
static int
findblkmajor(dv)
-struct device *dv;
+ struct device *dv;
{
char *name = dv->dv_xname;
register int i;
@@ -167,9 +167,9 @@ struct device *dv;
static struct device *
getdisk(str, len, defpart, devp)
-char *str;
-int len, defpart;
-dev_t *devp;
+ char *str;
+ int len, defpart;
+ dev_t *devp;
{
register struct device *dv;
@@ -191,9 +191,9 @@ dev_t *devp;
struct device *
parsedisk(str, len, defpart, devp)
-char *str;
-int len, defpart;
-dev_t *devp;
+ char *str;
+ int len, defpart;
+ dev_t *devp;
{
register struct device *dv;
register char *cp, c;
@@ -421,8 +421,8 @@ setroot()
*/
struct device *
getdevunit(name, unit)
-char *name;
-int unit;
+ char *name;
+ int unit;
{
struct device *dev = alldevs.tqh_first;
char num[10], fullname[16];
@@ -446,8 +446,8 @@ int unit;
int
getsb(cp, size)
-char *cp;
-int size;
+ char *cp;
+ int size;
{
register char *lp;
register int len;
diff --git a/sys/arch/mvme88k/mvme88k/cmmu.c b/sys/arch/mvme88k/mvme88k/cmmu.c
index 1f62907a58b..59030788176 100644
--- a/sys/arch/mvme88k/mvme88k/cmmu.c
+++ b/sys/arch/mvme88k/mvme88k/cmmu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmmu.c,v 1.8 2001/03/08 00:03:30 miod Exp $ */
+/* $OpenBSD: cmmu.c,v 1.9 2001/03/09 05:44:41 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -90,6 +90,7 @@ int vme188_config;
int max_cpus, max_cmmus;
int cpu_cmmu_ratio;
+#ifdef CMMU_DEBUG
void
show_apr(unsigned value)
{
@@ -125,6 +126,7 @@ show_sctr(unsigned value)
#endif
}
}
+#endif /* CMMU_DEBUG */
void
setup_board_config(void)
diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c
index e4cfefa69d8..1ed696e00c8 100644
--- a/sys/arch/mvme88k/mvme88k/disksubr.c
+++ b/sys/arch/mvme88k/mvme88k/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.12 2001/03/08 00:03:30 miod Exp $ */
+/* $OpenBSD: disksubr.c,v 1.13 2001/03/09 05:44:41 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1995 Dale Rahn.
@@ -31,9 +31,10 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/device.h>
-#define DKTYPENAMES
+#undef DKTYPENAMES
#include <sys/disklabel.h>
#include <sys/disk.h>
diff --git a/sys/arch/mvme88k/mvme88k/eh.S b/sys/arch/mvme88k/mvme88k/eh.S
index 78415e6a6dd..0b7b53ab351 100644
--- a/sys/arch/mvme88k/mvme88k/eh.S
+++ b/sys/arch/mvme88k/mvme88k/eh.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: eh.S,v 1.11 2001/03/07 23:40:35 miod Exp $ */
+/* $OpenBSD: eh.S,v 1.12 2001/03/09 05:44:41 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -212,6 +212,9 @@
* restored and control returns to where the exception occurred.
*
*/
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
#include "assym.s"
#include <machine/trap.h> /* for T_ defines */
@@ -2098,7 +2101,7 @@ LABEL(_check_ast)
bsr _getipl
bcnd eq0, r2, 2f
- bsr panic
+ bsr _panic
2:
#endif
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S
index 3947496a863..f96dc343aee 100644
--- a/sys/arch/mvme88k/mvme88k/locore.S
+++ b/sys/arch/mvme88k/mvme88k/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.12 2001/03/07 23:40:35 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.13 2001/03/09 05:44:41 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -57,6 +57,10 @@
* rights to redistribute these changes.
*/
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
+
#include "assym.s"
#include "machine/asm.h"
#include "machine/trap.h"
diff --git a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
index e2f07c27718..aa9eb98d1ae 100644
--- a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
+++ b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore_asm_routines.S,v 1.12 2001/03/08 22:25:06 miod Exp $ */
+/* $OpenBSD: locore_asm_routines.S,v 1.13 2001/03/09 05:44:41 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -36,6 +36,10 @@
*
**************************************************************RCS*****/
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
+
#include "assym.s"
#include <machine/trap.h>
#include <machine/cpu_number.h>
diff --git a/sys/arch/mvme88k/mvme88k/locore_c_routines.c b/sys/arch/mvme88k/mvme88k/locore_c_routines.c
index 97fe6dd0d81..abadd8781cb 100644
--- a/sys/arch/mvme88k/mvme88k/locore_c_routines.c
+++ b/sys/arch/mvme88k/mvme88k/locore_c_routines.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore_c_routines.c,v 1.9 2001/03/08 00:03:31 miod Exp $ */
+/* $OpenBSD: locore_c_routines.c,v 1.10 2001/03/09 05:44:41 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -407,8 +407,8 @@ unsigned int int_mask_val[INT_LEVEL] = {
*/
unsigned int
safe_level(mask, curlevel)
-unsigned mask;
-unsigned curlevel;
+ unsigned mask;
+ unsigned curlevel;
{
register int i;
@@ -490,8 +490,9 @@ spl(void)
{
unsigned curspl;
m88k_psr_type psr; /* proccessor status register */
+#ifdef MVME188
int cpu = 0;
-
+#endif
psr = disable_interrupts_return_psr();
switch (cputyp) {
#ifdef MVME188
@@ -519,7 +520,9 @@ db_spl(void)
{
unsigned curspl;
m88k_psr_type psr; /* proccessor status register */
+#ifdef MVME188
int cpu = 0;
+#endif
psr = disable_interrupts_return_psr();
switch (cputyp) {
@@ -562,7 +565,9 @@ setipl(unsigned level)
{
unsigned curspl;
m88k_psr_type psr; /* proccessor status register */
+#ifdef MVME188
int cpu = 0;
+#endif
if (level > 7) {
level = 0; /* assume this for the time being */
}
@@ -603,7 +608,9 @@ db_setipl(unsigned level)
{
unsigned curspl;
m88k_psr_type psr; /* proccessor status register */
+#ifdef MVME188
int cpu = 0;
+#endif
psr = disable_interrupts_return_psr();
switch (cputyp) {
@@ -640,14 +647,14 @@ db_setipl(unsigned level)
#include <sys/simplelock.h>
void
simple_lock_init(lkp)
-__volatile struct simplelock *lkp;
+ __volatile struct simplelock *lkp;
{
lkp->lock_data = 0;
}
int
test_and_set(lock)
-__volatile int *lock;
+ __volatile int *lock;
{
#if 0
int oldlock = *lock;
diff --git a/sys/arch/mvme88k/mvme88k/m18x_cmmu.c b/sys/arch/mvme88k/mvme88k/m18x_cmmu.c
index e80a1805903..0cf9b7fb6d3 100644
--- a/sys/arch/mvme88k/mvme88k/m18x_cmmu.c
+++ b/sys/arch/mvme88k/mvme88k/m18x_cmmu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m18x_cmmu.c,v 1.6 2001/03/08 00:03:31 miod Exp $ */
+/* $OpenBSD: m18x_cmmu.c,v 1.7 2001/03/09 05:44:41 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -60,13 +60,25 @@
#include <sys/param.h>
#include <sys/types.h>
+#include <sys/systm.h>
#include <sys/simplelock.h>
#include <machine/asm_macro.h>
#include <machine/board.h>
#include <machine/cpus.h>
#include <machine/cpu_number.h>
+#include <machine/locore.h>
#include <machine/m882xx.h>
+#if DDB
+ #include <ddb/db_output.h> /* db_printf() */
+#endif /* DDB */
+
+#if DDB
+ #define DEBUG_MSG db_printf
+#else
+ #define DEBUG_MSG printf
+#endif /* DDB */
+
/* On some versions of 88200, page size flushes don't work. I am using
* sledge hammer approach till I find for sure which ones are bad XXX nivas */
#define BROKEN_MMU_MASK
@@ -81,6 +93,8 @@ unsigned int m18x_debuglevel = 0;
#endif
#undef SHADOW_BATC /* don't use BATCs for now XXX nivas */
+int badwordaddr __P((void *addr));
+
struct cmmu_regs {
/* base + $000 */volatile unsigned idr;
/* base + $004 */volatile unsigned scr;
@@ -378,10 +392,12 @@ m18x_setup_board_config(void)
void
m18x_setup_cmmu_config(void)
{
+ register int num, cmmu_num;
+#ifdef MVME188
+ register int val1, val2;
volatile unsigned long *pcnfa;
volatile unsigned long *pcnfb;
-
- register int num, cmmu_num, val1, val2;
+#endif
dprintf(DB_CMMU,("m18x_setup_cmmu_config: initializing with %d CPU(s) and %d CMMU(s)\n",
max_cpus, max_cmmus));
@@ -390,7 +406,7 @@ m18x_setup_cmmu_config(void)
* Probe for available MMUs
*/
for (cmmu_num = 0; cmmu_num < max_cmmus; cmmu_num++)
- if (!badwordaddr((vm_offset_t)cmmu[cmmu_num].cmmu_regs)) {
+ if (!badwordaddr((void *)cmmu[cmmu_num].cmmu_regs)) {
union cpupid id;
id.cpupid = cmmu[cmmu_num].cmmu_regs->idr;
@@ -580,24 +596,25 @@ m18x_setup_cmmu_config(void)
return;
}
+#ifdef MVME188
static char *cmmu_strat_string[] = {
"address split ",
"user/spv split",
"spv SRAM split",
"all SRAM split"
};
+#endif
void
m18x_cmmu_dump_config(void)
{
-
+#ifdef MVME188
volatile unsigned long *pcnfa;
volatile unsigned long *pcnfb;
register int cmmu_num;
+#endif /* MVME188 */
- if (cputyp != CPU_188) return;
-
- db_printf("Current CPU/CMMU configuration:\n\n");
+ DEBUG_MSG("Current CPU/CMMU configuration:\n\n");
switch (cputyp) {
#ifdef MVME187
@@ -607,15 +624,15 @@ m18x_cmmu_dump_config(void)
case CPU_197:
#endif
#if defined(MVME187) || defined(MVME197)
- db_printf("VME1x7 split mode\n\n");
+ DEBUG_MSG("VME1x7 split mode\n\n");
#endif /* defined(MVME187) || defined(MVME197) */
#ifdef MVME188
case CPU_188:
- db_printf("VME188 address decoder: PCNFA = 0x%1x, PCNFB = 0x%1x\n\n", *pcnfa & 0xf, *pcnfb & 0xf);
+ DEBUG_MSG("VME188 address decoder: PCNFA = 0x%1x, PCNFB = 0x%1x\n\n", *pcnfa & 0xf, *pcnfb & 0xf);
pcnfa = (volatile unsigned long *)MVME188_PCNFA;
pcnfb = (volatile unsigned long *)MVME188_PCNFB;
for (cmmu_num = 0; cmmu_num < max_cmmus; cmmu_num++) {
- db_printf("CMMU #%d: %s CMMU for CPU %d:\n Strategy: %s\n %s access addr 0x%08x mask 0x%08x match %s\n",
+ DEBUG_MSG("CMMU #%d: %s CMMU for CPU %d:\n Strategy: %s\n %s access addr 0x%08x mask 0x%08x match %s\n",
cmmu_num,
(cmmu[cmmu_num].which == INST_CMMU) ? "inst" : "data",
cmmu[cmmu_num].cmmu_cpu,
@@ -631,7 +648,7 @@ m18x_cmmu_dump_config(void)
}
#endif /* MVME188 */
default:
- db_printf("Unknown CPU\n\n");
+ DEBUG_MSG("Unknown CPU\n\n");
}
}
@@ -712,6 +729,7 @@ m18x_cmmu_get_by_mode(int cpu, int mode)
(mode == DATA_CMMU) ? "data" : "instruction", cpu);
panic("m18x_cmmu_get_by_mode");
/* NOTREACHED */
+ return(0);
}
#endif
@@ -1897,7 +1915,7 @@ m18x_cmmu_show_translation(
unsigned value;
if (verbose_flag)
- db_printf("-------------------------------------------\n");
+ DEBUG_MSG("-------------------------------------------\n");
@@ -1909,19 +1927,19 @@ m18x_cmmu_show_translation(
supervisor_flag = 0; /* thread implies user */
if (thread->task == 0) {
- db_printf("[thread %x has empty task pointer]\n", thread);
+ DEBUG_MSG("[thread %x has empty task pointer]\n", thread);
return;
} else if (thread->task->map == 0) {
- db_printf("[thread/task %x/%x has empty map pointer]\n",
+ DEBUG_MSG("[thread/task %x/%x has empty map pointer]\n",
thread, thread->task);
return;
} else if (thread->task->map->pmap == 0) {
- db_printf("[thread/task/map %x/%x/%x has empty pmap pointer]\n",
+ DEBUG_MSG("[thread/task/map %x/%x/%x has empty pmap pointer]\n",
thread, thread->task, thread->task->map);
return;
}
if (thread->task->map->pmap->lock.lock_data) {
- db_printf("[Warning: thread %x's task %x's map %x's "
+ DEBUG_MSG("[Warning: thread %x's task %x's map %x's "
"pmap %x is locked]\n", thread, thread->task,
thread->task->map, thread->task->map->pmap);
}
@@ -1933,7 +1951,7 @@ m18x_cmmu_show_translation(
apr_data.field.te = 1;
value = apr_data.bits;
if (verbose_flag) {
- db_printf("[thread %x task %x map %x pmap %x UAPR is %x]\n",
+ DEBUG_MSG("[thread %x task %x map %x pmap %x UAPR is %x]\n",
thread, thread->task, thread->task->map,
thread->task->map->pmap, value);
}
@@ -1943,22 +1961,22 @@ m18x_cmmu_show_translation(
if (cmmu_num == -1) {
int cpu = cpu_number();
if (cpu_cmmu[cpu].pair[DATA_CMMU] == 0) {
- db_printf("ack! can't figure my own data cmmu number.\n");
+ DEBUG_MSG("ack! can't figure my own data cmmu number.\n");
return;
}
cmmu_num = cpu_cmmu[cpu].pair[DATA_CMMU] - cmmu;
if (verbose_flag)
- db_printf("The data cmmu for cpu#%d is cmmu#%d.\n",
+ DEBUG_MSG("The data cmmu for cpu#%d is cmmu#%d.\n",
0, cmmu_num);
} else if (cmmu_num < 0 || cmmu_num >= MAX_CMMUS) {
- db_printf("invalid cpu number [%d]... must be in range [0..%d]\n",
+ DEBUG_MSG("invalid cpu number [%d]... must be in range [0..%d]\n",
cmmu_num, MAX_CMMUS - 1);
return;
}
if (cmmu[cmmu_num].cmmu_alive == 0) {
- db_printf("warning: cmmu %d is not alive.\n", cmmu_num);
+ DEBUG_MSG("warning: cmmu %d is not alive.\n", cmmu_num);
#if 0
return;
#endif
@@ -1966,14 +1984,14 @@ m18x_cmmu_show_translation(
if (!verbose_flag) {
if (!(cmmu[cmmu_num].cmmu_regs->sctr & CMMU_SCTR_SE))
- db_printf("WARNING: snooping not enabled for CMMU#%d.\n",
+ DEBUG_MSG("WARNING: snooping not enabled for CMMU#%d.\n",
cmmu_num);
} else {
int i;
for (i=0; i<MAX_CMMUS; i++)
if ((i == cmmu_num || cmmu[i].cmmu_alive) &&
(verbose_flag>1 || !(cmmu[i].cmmu_regs->sctr&CMMU_SCTR_SE))) {
- db_printf("CMMU#%d (cpu %d %s) snooping %s\n", i,
+ DEBUG_MSG("CMMU#%d (cpu %d %s) snooping %s\n", i,
cmmu[i].cmmu_cpu, cmmu[i].which ? "data" : "inst",
(cmmu[i].cmmu_regs->sctr & CMMU_SCTR_SE) ? "on":"OFF");
}
@@ -1996,15 +2014,15 @@ m18x_cmmu_show_translation(
batc.bits = cmmu[cmmu_num].batc[i];
if (batc.field.v == 0) {
if (verbose_flag>1)
- db_printf("cmmu #%d batc[%d] invalid.\n", cmmu_num, i);
+ DEBUG_MSG("cmmu #%d batc[%d] invalid.\n", cmmu_num, i);
} else {
- db_printf("cmmu#%d batc[%d] v%08x p%08x", cmmu_num, i,
+ DEBUG_MSG("cmmu#%d batc[%d] v%08x p%08x", cmmu_num, i,
batc.field.lba << 18, batc.field.pba);
- if (batc.field.s) db_printf(", supervisor");
- if (batc.field.wt) db_printf(", wt.th");
- if (batc.field.g) db_printf(", global");
- if (batc.field.ci) db_printf(", cache inhibit");
- if (batc.field.wp) db_printf(", write protect");
+ if (batc.field.s) DEBUG_MSG(", supervisor");
+ if (batc.field.wt) DEBUG_MSG(", wt.th");
+ if (batc.field.g) DEBUG_MSG(", global");
+ if (batc.field.ci) DEBUG_MSG(", cache inhibit");
+ if (batc.field.wp) DEBUG_MSG(", write protect");
}
}
}
@@ -2022,24 +2040,24 @@ m18x_cmmu_show_translation(
cmmu_regs->scr = supervisor_flag ? CMMU_PROBE_SUPER : CMMU_PROBE_USER;
ssr.bits = cmmu_regs->ssr;
if (verbose_flag > 1)
- db_printf("probe of 0x%08x returns ssr=0x%08x\n",
+ DEBUG_MSG("probe of 0x%08x returns ssr=0x%08x\n",
address, ssr.bits);
if (ssr.field.v)
- db_printf("PROBE of 0x%08x returns phys=0x%x",
+ DEBUG_MSG("PROBE of 0x%08x returns phys=0x%x",
address, cmmu_regs->sar);
else
- db_printf("PROBE fault at 0x%x", cmmu_regs->pfADDRr);
- if (ssr.field.ce) db_printf(", copyback err");
- if (ssr.field.be) db_printf(", bus err");
- if (ssr.field.wt) db_printf(", writethrough");
- if (ssr.field.sp) db_printf(", sup prot");
- if (ssr.field.g) db_printf(", global");
- if (ssr.field.ci) db_printf(", cache inhibit");
- if (ssr.field.m) db_printf(", modified");
- if (ssr.field.u) db_printf(", used");
- if (ssr.field.wp) db_printf(", write prot");
- if (ssr.field.bh) db_printf(", BATC");
- db_printf(".\n");
+ DEBUG_MSG("PROBE fault at 0x%x", cmmu_regs->pfADDRr);
+ if (ssr.field.ce) DEBUG_MSG(", copyback err");
+ if (ssr.field.be) DEBUG_MSG(", bus err");
+ if (ssr.field.wt) DEBUG_MSG(", writethrough");
+ if (ssr.field.sp) DEBUG_MSG(", sup prot");
+ if (ssr.field.g) DEBUG_MSG(", global");
+ if (ssr.field.ci) DEBUG_MSG(", cache inhibit");
+ if (ssr.field.m) DEBUG_MSG(", modified");
+ if (ssr.field.u) DEBUG_MSG(", used");
+ if (ssr.field.wp) DEBUG_MSG(", write prot");
+ if (ssr.field.bh) DEBUG_MSG(", BATC");
+ DEBUG_MSG(".\n");
}
/******* INTERPRET AREA DESCRIPTOR *********/
@@ -2047,38 +2065,38 @@ m18x_cmmu_show_translation(
union apr_template apr_template;
apr_template.bits = value;
if (verbose_flag > 1) {
- db_printf("CMMU#%d", cmmu_num);
+ DEBUG_MSG("CMMU#%d", cmmu_num);
#if 0
if (thread == 0)
- db_printf("CMMU#%d", cmmu_num);
+ DEBUG_MSG("CMMU#%d", cmmu_num);
else
- db_printf("THREAD %x", thread);
+ DEBUG_MSG("THREAD %x", thread);
#endif /* 0 */
- db_printf(" %cAPR is 0x%08x\n",
+ DEBUG_MSG(" %cAPR is 0x%08x\n",
supervisor_flag ? 'S' : 'U', apr_template.bits);
}
- db_printf("CMMU#%d", cmmu_num);
+ DEBUG_MSG("CMMU#%d", cmmu_num);
#if 0
if (thread == 0)
- db_printf("CMMU#%d", cmmu_num);
+ DEBUG_MSG("CMMU#%d", cmmu_num);
else
- db_printf("THREAD %x", thread);
+ DEBUG_MSG("THREAD %x", thread);
#endif /* 0 */
- db_printf(" %cAPR: SegTbl: 0x%x000p",
+ DEBUG_MSG(" %cAPR: SegTbl: 0x%x000p",
supervisor_flag ? 'S' : 'U', apr_template.field.st_base);
- if (apr_template.field.wt) db_printf(", WTHRU");
- else db_printf(", !wthru");
- if (apr_template.field.g) db_printf(", GLOBAL");
- else db_printf(", !global");
- if (apr_template.field.ci) db_printf(", $INHIBIT");
- else db_printf(", $ok");
- if (apr_template.field.te) db_printf(", VALID");
- else db_printf(", !valid");
- db_printf(".\n");
+ if (apr_template.field.wt) DEBUG_MSG(", WTHRU");
+ else DEBUG_MSG(", !wthru");
+ if (apr_template.field.g) DEBUG_MSG(", GLOBAL");
+ else DEBUG_MSG(", !global");
+ if (apr_template.field.ci) DEBUG_MSG(", $INHIBIT");
+ else DEBUG_MSG(", $ok");
+ if (apr_template.field.te) DEBUG_MSG(", VALID");
+ else DEBUG_MSG(", !valid");
+ DEBUG_MSG(".\n");
/* if not valid, done now */
if (apr_template.field.te == 0) {
- db_printf("<would report an error, valid bit not set>\n");
+ DEBUG_MSG("<would report an error, valid bit not set>\n");
return;
}
@@ -2088,7 +2106,7 @@ m18x_cmmu_show_translation(
/* translate value from physical to virtual */
if (verbose_flag)
- db_printf("[%x physical is %x virtual]\n", value, value + VEQR_ADDR);
+ DEBUG_MSG("[%x physical is %x virtual]\n", value, value + VEQR_ADDR);
value += VEQR_ADDR;
virtual_address.bits = address;
@@ -2097,39 +2115,39 @@ m18x_cmmu_show_translation(
{
union sdt_entry_template std_template;
if (verbose_flag)
- db_printf("will follow to entry %d of page at 0x%x...\n",
+ DEBUG_MSG("will follow to entry %d of page at 0x%x...\n",
virtual_address.field.segment_table_index, value);
value |= virtual_address.field.segment_table_index *
sizeof(struct sdt_entry);
- if (badwordaddr(value)) {
- db_printf("ERROR: unable to access page at 0x%08x.\n", value);
+ if (badwordaddr((void *)value)) {
+ DEBUG_MSG("ERROR: unable to access page at 0x%08x.\n", value);
return;
}
std_template.bits = *(unsigned *)value;
if (verbose_flag > 1)
- db_printf("SEG DESC @0x%x is 0x%08x\n", value, std_template.bits);
- db_printf("SEG DESC @0x%x: PgTbl: 0x%x000",
+ DEBUG_MSG("SEG DESC @0x%x is 0x%08x\n", value, std_template.bits);
+ DEBUG_MSG("SEG DESC @0x%x: PgTbl: 0x%x000",
value, std_template.sdt_desc.table_addr);
- if (std_template.sdt_desc.wt) db_printf(", WTHRU");
- else db_printf(", !wthru");
- if (std_template.sdt_desc.sup) db_printf(", S-PROT");
- else db_printf(", UserOk");
- if (std_template.sdt_desc.g) db_printf(", GLOBAL");
- else db_printf(", !global");
- if (std_template.sdt_desc.no_cache) db_printf(", $INHIBIT");
- else db_printf(", $ok");
- if (std_template.sdt_desc.prot) db_printf(", W-PROT");
- else db_printf(", WriteOk");
- if (std_template.sdt_desc.dtype) db_printf(", VALID");
- else db_printf(", !valid");
- db_printf(".\n");
+ if (std_template.sdt_desc.wt) DEBUG_MSG(", WTHRU");
+ else DEBUG_MSG(", !wthru");
+ if (std_template.sdt_desc.sup) DEBUG_MSG(", S-PROT");
+ else DEBUG_MSG(", UserOk");
+ if (std_template.sdt_desc.g) DEBUG_MSG(", GLOBAL");
+ else DEBUG_MSG(", !global");
+ if (std_template.sdt_desc.no_cache) DEBUG_MSG(", $INHIBIT");
+ else DEBUG_MSG(", $ok");
+ if (std_template.sdt_desc.prot) DEBUG_MSG(", W-PROT");
+ else DEBUG_MSG(", WriteOk");
+ if (std_template.sdt_desc.dtype) DEBUG_MSG(", VALID");
+ else DEBUG_MSG(", !valid");
+ DEBUG_MSG(".\n");
/* if not valid, done now */
if (std_template.sdt_desc.dtype == 0) {
- db_printf("<would report an error, STD entry not valid>\n");
+ DEBUG_MSG("<would report an error, STD entry not valid>\n");
return;
}
@@ -2139,64 +2157,64 @@ m18x_cmmu_show_translation(
/* translate value from physical to virtual */
if (verbose_flag)
- db_printf("[%x physical is %x virtual]\n", value, value + VEQR_ADDR);
+ DEBUG_MSG("[%x physical is %x virtual]\n", value, value + VEQR_ADDR);
value += VEQR_ADDR;
/******* PAGE TABLE *********/
{
union pte_template pte_template;
if (verbose_flag)
- db_printf("will follow to entry %d of page at 0x%x...\n",
+ DEBUG_MSG("will follow to entry %d of page at 0x%x...\n",
virtual_address.field.page_table_index, value);
value |= virtual_address.field.page_table_index *
sizeof(struct pt_entry);
- if (badwordaddr(value)) {
- db_printf("error: unable to access page at 0x%08x.\n", value);
+ if (badwordaddr((void *)value)) {
+ DEBUG_MSG("error: unable to access page at 0x%08x.\n", value);
return;
}
pte_template.bits = *(unsigned *)value;
if (verbose_flag > 1)
- db_printf("PAGE DESC @0x%x is 0x%08x.\n", value, pte_template.bits);
- db_printf("PAGE DESC @0x%x: page @%x000",
+ DEBUG_MSG("PAGE DESC @0x%x is 0x%08x.\n", value, pte_template.bits);
+ DEBUG_MSG("PAGE DESC @0x%x: page @%x000",
value, pte_template.pte.pfn);
- if (pte_template.pte.wired) db_printf(", WIRE");
- else db_printf(", !wire");
- if (pte_template.pte.wt) db_printf(", WTHRU");
- else db_printf(", !wthru");
- if (pte_template.pte.sup) db_printf(", S-PROT");
- else db_printf(", UserOk");
- if (pte_template.pte.g) db_printf(", GLOBAL");
- else db_printf(", !global");
- if (pte_template.pte.ci) db_printf(", $INHIBIT");
- else db_printf(", $ok");
- if (pte_template.pte.modified) db_printf(", MOD");
- else db_printf(", !mod");
- if (pte_template.pte.pg_used) db_printf(", USED");
- else db_printf(", !used");
- if (pte_template.pte.prot) db_printf(", W-PROT");
- else db_printf(", WriteOk");
- if (pte_template.pte.dtype) db_printf(", VALID");
- else db_printf(", !valid");
- db_printf(".\n");
+ if (pte_template.pte.wired) DEBUG_MSG(", WIRE");
+ else DEBUG_MSG(", !wire");
+ if (pte_template.pte.wt) DEBUG_MSG(", WTHRU");
+ else DEBUG_MSG(", !wthru");
+ if (pte_template.pte.sup) DEBUG_MSG(", S-PROT");
+ else DEBUG_MSG(", UserOk");
+ if (pte_template.pte.g) DEBUG_MSG(", GLOBAL");
+ else DEBUG_MSG(", !global");
+ if (pte_template.pte.ci) DEBUG_MSG(", $INHIBIT");
+ else DEBUG_MSG(", $ok");
+ if (pte_template.pte.modified) DEBUG_MSG(", MOD");
+ else DEBUG_MSG(", !mod");
+ if (pte_template.pte.pg_used) DEBUG_MSG(", USED");
+ else DEBUG_MSG(", !used");
+ if (pte_template.pte.prot) DEBUG_MSG(", W-PROT");
+ else DEBUG_MSG(", WriteOk");
+ if (pte_template.pte.dtype) DEBUG_MSG(", VALID");
+ else DEBUG_MSG(", !valid");
+ DEBUG_MSG(".\n");
/* if not valid, done now */
if (pte_template.pte.dtype == 0) {
- db_printf("<would report an error, PTE entry not valid>\n");
+ DEBUG_MSG("<would report an error, PTE entry not valid>\n");
return;
}
value = pte_template.pte.pfn << 12;
if (verbose_flag)
- db_printf("will follow to byte %d of page at 0x%x...\n",
+ DEBUG_MSG("will follow to byte %d of page at 0x%x...\n",
virtual_address.field.page_offset, value);
value |= virtual_address.field.page_offset;
- if (badwordaddr(value)) {
- db_printf("error: unable to access page at 0x%08x.\n", value);
+ if (badwordaddr((void *)value)) {
+ DEBUG_MSG("error: unable to access page at 0x%08x.\n", value);
return;
}
@@ -2204,10 +2222,10 @@ m18x_cmmu_show_translation(
/* translate value from physical to virtual */
if (verbose_flag)
- db_printf("[%x physical is %x virtual]\n", value, value + VEQR_ADDR);
+ DEBUG_MSG("[%x physical is %x virtual]\n", value, value + VEQR_ADDR);
value += VEQR_ADDR;
- db_printf("WORD at 0x%x is 0x%08x.\n", value, *(unsigned *)value);
+ DEBUG_MSG("WORD at 0x%x is 0x%08x.\n", value, *(unsigned *)value);
}
@@ -2226,7 +2244,7 @@ m18x_cmmu_cache_state(unsigned addr, unsigned supervisor_flag)
if (!cmmu[cmmu_num].cmmu_alive)
continue;
R = cmmu[cmmu_num].cmmu_regs;
- db_printf("cmmu #%d %s cmmu for cpu %d.\n", cmmu_num,
+ DEBUG_MSG("cmmu #%d %s cmmu for cpu %d.\n", cmmu_num,
cmmu[cmmu_num].which ? "data" : "inst",
cmmu[cmmu_num].cmmu_cpu);
R->sar = addr;
@@ -2234,10 +2252,10 @@ m18x_cmmu_cache_state(unsigned addr, unsigned supervisor_flag)
ssr.bits = R->ssr;
if (!ssr.field.v) {
- db_printf("PROBE of 0x%08x faults.\n",addr);
+ DEBUG_MSG("PROBE of 0x%08x faults.\n",addr);
continue;
}
- db_printf("PROBE of 0x%08x returns phys=0x%x", addr, R->sar);
+ DEBUG_MSG("PROBE of 0x%08x returns phys=0x%x", addr, R->sar);
tag = R->sar & ~0xfff;
cssp.bits = R->cssp;
@@ -2245,20 +2263,20 @@ m18x_cmmu_cache_state(unsigned addr, unsigned supervisor_flag)
/* check to see if any of the tags for the set match the address */
for (line = 0; line < 4; line++) {
if (VV(cssp, line) == VV_INVALID) {
- db_printf("line %d invalid.\n", line);
+ DEBUG_MSG("line %d invalid.\n", line);
continue; /* line is invalid */
}
if (D(cssp, line)) {
- db_printf("line %d disabled.\n", line);
+ DEBUG_MSG("line %d disabled.\n", line);
continue; /* line is disabled */
}
if ((R->ctp[line] & ~0xfff) != tag) {
- db_printf("line %d address tag is %x.\n", line,
+ DEBUG_MSG("line %d address tag is %x.\n", line,
(R->ctp[line] & ~0xfff));
continue;
}
- db_printf("found in line %d as %08x (%s).\n",
+ DEBUG_MSG("found in line %d as %08x (%s).\n",
line, R->cdp[line], vv_name[VV(cssp, line)]);
}
}
@@ -2274,7 +2292,7 @@ m18x_show_cmmu_info(unsigned addr)
for (cmmu_num = 0; cmmu_num < MAX_CMMUS; cmmu_num++)
if (cmmu[cmmu_num].cmmu_alive) {
- db_printf("cmmu #%d %s cmmu for cpu %d: ", cmmu_num,
+ DEBUG_MSG("cmmu #%d %s cmmu for cpu %d: ", cmmu_num,
cmmu[cmmu_num].which ? "data" : "inst",
cmmu[cmmu_num].cmmu_cpu);
m18x_cmmu_show_translation(addr, 1, 0, cmmu_num);
diff --git a/sys/arch/mvme88k/mvme88k/m88100_fp.S b/sys/arch/mvme88k/mvme88k/m88100_fp.S
index 470cd0b93b7..842a3360569 100644
--- a/sys/arch/mvme88k/mvme88k/m88100_fp.S
+++ b/sys/arch/mvme88k/mvme88k/m88100_fp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88100_fp.S,v 1.7 2001/03/07 23:40:35 miod Exp $ */
+/* $OpenBSD: m88100_fp.S,v 1.8 2001/03/09 05:44:41 smurph Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
@@ -27,6 +27,9 @@
*/
/* Floating point trouble routines */
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
#include "assym.s"
#include <machine/trap.h>
diff --git a/sys/arch/mvme88k/mvme88k/m88110_fp.S b/sys/arch/mvme88k/mvme88k/m88110_fp.S
index f291e184150..f86e1c7b12c 100644
--- a/sys/arch/mvme88k/mvme88k/m88110_fp.S
+++ b/sys/arch/mvme88k/mvme88k/m88110_fp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110_fp.S,v 1.2 2001/03/07 23:40:35 miod Exp $ */
+/* $OpenBSD: m88110_fp.S,v 1.3 2001/03/09 05:44:42 smurph Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -48,6 +48,10 @@
* 2) Floating Point Privilege Violation
*/
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
+
#include "assym.s"
#include <machine/trap.h>
#include <machine/asm.h>
diff --git a/sys/arch/mvme88k/mvme88k/m88110_mmu.S b/sys/arch/mvme88k/mvme88k/m88110_mmu.S
index 61519af53c7..6cde0945445 100644
--- a/sys/arch/mvme88k/mvme88k/m88110_mmu.S
+++ b/sys/arch/mvme88k/mvme88k/m88110_mmu.S
@@ -1,3 +1,7 @@
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
+
#include <machine/asm.h>
#ifdef MVME197
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 6086463b2d3..065935058b3 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.27 2001/03/07 23:56:06 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.28 2001/03/09 05:44:42 smurph Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -78,6 +78,7 @@
#include <mvme88k/dev/sysconreg.h>
#include <mvme88k/dev/pcctworeg.h>
+#include <machine/locore.h>
#include <machine/cpu.h>
#include <machine/cpu_number.h>
#include <machine/asm_macro.h> /* enable/disable interrupts */
@@ -98,11 +99,12 @@
#endif
#define __IS_MACHDEP_C__
-#include <assym.s> /* EF_EPSR, etc. */
-#include <machine/m88100.h> /* DMT_VALID */
-#include <machine/m882xx.h> /* CMMU stuff */
+#include <assym.s> /* EF_EPSR, etc. */
+#include <machine/m88100.h> /* DMT_VALID */
+#include <machine/m882xx.h> /* CMMU stuff */
#if DDB
#include <machine/db_machdep.h>
+ #include <ddb/db_output.h> /* db_printf() */
#endif /* DDB */
#if DDB
@@ -119,9 +121,15 @@ vm_offset_t interrupt_stack[MAX_CPUS] = {0};
struct funcp mdfp;
/* forwards */
-void m88100_Xfp_precise(void);
-void m88110_Xfp_precise(void);
-void setupiackvectors(void);
+void m88100_Xfp_precise __P((void));
+void m88110_Xfp_precise __P((void));
+void setupiackvectors __P((void));
+void regdump __P((struct trapframe *f));
+void dumpsys __P((void));
+void configure __P((void));
+void consinit __P((void));
+void kdb_init __P((void));
+int badwordaddr __P((void *addr));
volatile unsigned char *ivec[] = {
(unsigned char *)0xFFFE0003, /* not used, no such thing as int 0 */
@@ -331,7 +339,7 @@ size_memory(void)
/* if can't access, we've reached the end */
if (foodebug) printf("%x\n", look);
- if (badwordaddr((vm_offset_t)look)) {
+ if (badwordaddr((void*)look)) {
#if defined(DEBUG)
printf("%x\n", look);
#endif
@@ -410,7 +418,7 @@ save_u_area(struct proc *p, vm_offset_t va)
{
int i;
for (i=0; i<UPAGES; i++) {
- p->p_md.md_upte[i] = kvtopte(va + (i * NBPG))->bits;
+ p->p_md.md_upte[i] = kvtopte((va + (i * NBPG)))->bits;
}
}
@@ -421,11 +429,11 @@ load_u_area(struct proc *p)
int i;
for (i=0; i<UPAGES; i++) {
- t = kvtopte(UADDR + (i * NBPG));
+ t = kvtopte((UADDR + (i * NBPG)));
t->bits = p->p_md.md_upte[i];
}
for (i=0; i<UPAGES; i++) {
- cmmu_flush_tlb(1, UADDR + (i * NBPG), NBPG);
+ cmmu_flush_tlb(1, (UADDR + (i * NBPG)), NBPG);
}
}
@@ -471,7 +479,7 @@ cpu_startup()
vm_size_t size;
int base, residual;
#if defined(UVM)
- vaddr_t minaddr, maxaddr, uarea_pages, addr;
+ vaddr_t minaddr, maxaddr, uarea_pages;
#else
vm_offset_t minaddr, maxaddr, uarea_pages;
#endif
@@ -820,7 +828,7 @@ cpu_startup()
*/
caddr_t
allocsys(v)
-register caddr_t v;
+ register caddr_t v;
{
#define valloc(name, type, num) \
@@ -910,10 +918,10 @@ register caddr_t v;
void
setregs(p, pack, stack, retval)
-struct proc *p;
-struct exec_package *pack;
-u_long stack;
-int retval[2];
+ struct proc *p;
+ struct exec_package *pack;
+ u_long stack;
+ int retval[2];
{
register struct trapframe *tf = USER_REGS(p);
@@ -998,11 +1006,11 @@ int sigpid = 0;
/* MVME197 TODO list :-) smurph */
void
sendsig(catcher, sig, mask, code, type, val)
-sig_t catcher;
-int sig, mask;
-unsigned long code;
-int type;
-union sigval val;
+ sig_t catcher;
+ int sig, mask;
+ unsigned long code;
+ int type;
+ union sigval val;
{
register struct proc *p = curproc;
register struct trapframe *tf;
@@ -1235,7 +1243,7 @@ _doboot()
void
boot(howto)
-register int howto;
+ register int howto;
{
/* take a snap shot before clobbering any registers */
#if 0
@@ -1483,7 +1491,7 @@ slave_main(void)
*/
int
intr_findvec(start, end)
-int start, end;
+ int start, end;
{
int vec;
@@ -1719,7 +1727,7 @@ out_m188:
disable_interrupt();
if (eframe->dmt0 & DMT_VALID) {
trap(T_DATAFLT, eframe);
- data_access_emulation(eframe);
+ data_access_emulation((unsigned *)eframe);
eframe->dmt0 &= ~DMT_VALID;
}
@@ -1847,7 +1855,7 @@ out:
if (cputyp != CPU_197) {
if (eframe->dmt0 & DMT_VALID) {
trap(T_DATAFLT, eframe);
- data_access_emulation(eframe);
+ data_access_emulation((unsigned *)eframe);
eframe->dmt0 &= ~DMT_VALID;
}
}
@@ -1924,7 +1932,7 @@ struct proc *p;
void
_insque(velement, vhead)
-void *velement, *vhead;
+ void *velement, *vhead;
{
register struct prochd *element, *head;
element = velement;
@@ -1941,7 +1949,7 @@ void *velement, *vhead;
void
_remque(velement)
-void *velement;
+ void *velement;
{
register struct prochd *element;
element = velement;
@@ -1952,10 +1960,10 @@ void *velement;
int
copystr(fromaddr, toaddr, maxlength, lencopied)
-const void *fromaddr;
-void *toaddr;
-size_t maxlength;
-size_t *lencopied;
+ const void *fromaddr;
+ void *toaddr;
+ size_t maxlength;
+ size_t *lencopied;
{
u_int tally;
@@ -1978,7 +1986,7 @@ size_t *lencopied;
void
setrunqueue(p)
-register struct proc *p;
+ register struct proc *p;
{
register struct prochd *q;
register struct proc *oldlast;
@@ -2000,7 +2008,7 @@ register struct proc *p;
*/
void
remrunqueue(vp)
-struct proc *vp;
+ struct proc *vp;
{
register struct proc *p = vp;
register int which = p->p_priority >> 2;
@@ -2025,7 +2033,7 @@ bugsyscall()
void
myetheraddr(cp)
-u_char *cp;
+ u_char *cp;
{
struct bugbrdid brdid;
@@ -2118,7 +2126,7 @@ dosoftint()
}
int
-spl0()
+spl0(void)
{
int x;
x = splsoftclock();
@@ -2151,8 +2159,8 @@ char *s;
void
MY_info_done(f, flags)
-struct trapframe *f;
-int flags;
+ struct trapframe *f;
+ int flags;
{
regdump(f);
}
@@ -2199,7 +2207,7 @@ regdump(struct trapframe *f)
printf("dmt1 %x dmd1 %x dma1 %x\n", f->dmt1, f->dmd1, f->dma1);
printf("dmt2 %x dmd2 %x dma2 %x\n", f->dmt2, f->dmd2, f->dma2);
printf("fault type %d\n", (f->dpfsr >> 16) & 0x7);
- dae_print(f);
+ dae_print((unsigned *)f);
}
if (longformat && cputyp != CPU_197) {
printf("fpsr %x ", f->fpsr);
@@ -2256,27 +2264,11 @@ regdump(struct trapframe *f)
#endif
}
-#if DDB
-inline int
-db_splhigh(void)
-{
- return (db_setipl(IPL_HIGH));
-}
-
-inline int
-db_splx(int s)
-{
- return (db_setipl(s));
-}
-#endif /* DDB */
-
-
/*
* Called from locore.S during boot,
* this is the first C code that's run.
*/
-
void
mvme_bootstrap(void)
{
@@ -2421,7 +2413,7 @@ mvme_bootstrap(void)
*/
int
bootcnprobe(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
cp->cn_dev = makedev(14, 0);
cp->cn_pri = CN_NORMAL;
@@ -2430,7 +2422,7 @@ struct consdev *cp;
int
bootcninit(cp)
-struct consdev *cp;
+ struct consdev *cp;
{
/* Nothing to do */
return (1);
@@ -2438,15 +2430,15 @@ struct consdev *cp;
int
bootcngetc(dev)
-dev_t dev;
+ dev_t dev;
{
return (buginchr());
}
void
bootcnputc(dev, c)
-dev_t dev;
-char c;
+ dev_t dev;
+ char c;
{
if (c == '\n')
bugoutchr('\r');
diff --git a/sys/arch/mvme88k/mvme88k/pmap.c b/sys/arch/mvme88k/mvme88k/pmap.c
index 02f98998049..be9f98ad448 100644
--- a/sys/arch/mvme88k/mvme88k/pmap.c
+++ b/sys/arch/mvme88k/mvme88k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.22 2001/03/08 22:26:00 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.23 2001/03/09 05:44:42 smurph Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -52,6 +52,7 @@
/*#define DEBUG 1*/
#include <sys/types.h>
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/simplelock.h>
#include <sys/proc.h>
#include <sys/malloc.h>
@@ -1626,7 +1627,7 @@ pmap_zero_page(vm_offset_t phys)
cmmu_flush_tlb(1, srcva, M88K_PGBYTES);
*srcpte = template.pte;
splx(spl_sav);
- bzero (srcva, M88K_PGBYTES);
+ bzero((void*)srcva, M88K_PGBYTES);
/* force the data out */
cmmu_flush_remote_data_cache(my_cpu,phys, M88K_PGBYTES);
}
diff --git a/sys/arch/mvme88k/mvme88k/pmap_table.c b/sys/arch/mvme88k/mvme88k/pmap_table.c
index a85c66624ab..20896e731d5 100644
--- a/sys/arch/mvme88k/mvme88k/pmap_table.c
+++ b/sys/arch/mvme88k/mvme88k/pmap_table.c
@@ -24,6 +24,8 @@
* the rights to redistribute these changes.
*/
+#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/types.h>
#include <machine/board.h>
#include <sys/param.h>
@@ -71,7 +73,7 @@ static pmap_table_entry m197_board_table[] = {
pmap_table_t
pmap_table_build(endoftext)
-unsigned endoftext;
+ unsigned endoftext;
{
unsigned int i;
pmap_table_t bt, pbt;
diff --git a/sys/arch/mvme88k/mvme88k/process.S b/sys/arch/mvme88k/mvme88k/process.S
index 0768e87930c..1349049dcdc 100644
--- a/sys/arch/mvme88k/mvme88k/process.S
+++ b/sys/arch/mvme88k/mvme88k/process.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.S,v 1.7 2001/03/07 23:40:35 miod Exp $ */
+/* $OpenBSD: process.S,v 1.8 2001/03/09 05:44:42 smurph Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -30,9 +30,14 @@
*
*/
+#ifndef ASSEMBLER
+#define ASSEMBLER
+#endif /* ASSEMBLER */
+
#include "assym.s"
#include "machine/asm.h"
#include "machine/psl.h"
+#include "machine/intr.h"
data
align 4
diff --git a/sys/arch/mvme88k/mvme88k/process_machdep.c b/sys/arch/mvme88k/mvme88k/process_machdep.c
index d28305c2a11..0afc9abedc2 100644
--- a/sys/arch/mvme88k/mvme88k/process_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/process_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process_machdep.c,v 1.8 2001/02/01 03:38:22 smurph Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.9 2001/03/09 05:44:42 smurph Exp $ */
/*
* Copyright (c) 1993 The Regents of the University of California.
@@ -70,6 +70,7 @@
#include <sys/vnode.h>
#include <machine/psl.h>
#include <machine/reg.h>
+#include <machine/trap.h>
#if 0
#include <machine/frame.h>
#endif
@@ -78,8 +79,8 @@
int
process_read_regs(p, regs)
-struct proc *p;
-struct reg *regs;
+ struct proc *p;
+ struct reg *regs;
{
bcopy((caddr_t)USER_REGS(p), (caddr_t)regs, sizeof(struct reg));
@@ -88,8 +89,8 @@ struct reg *regs;
int
process_write_regs(p, regs)
-struct proc *p;
-struct reg *regs;
+ struct proc *p;
+ struct reg *regs;
{
bcopy((caddr_t)regs, (caddr_t)USER_REGS(p), sizeof(struct reg));
return (0);
@@ -97,8 +98,8 @@ struct reg *regs;
int
process_sstep(p, sstep)
-struct proc *p;
-int sstep;
+ struct proc *p;
+ int sstep;
{
if (sstep)
cpu_singlestep(p);
@@ -107,8 +108,8 @@ int sstep;
int
process_set_pc(p, addr)
-struct proc *p;
-caddr_t addr;
+ struct proc *p;
+ caddr_t addr;
{
struct reg *regs;
@@ -124,8 +125,8 @@ caddr_t addr;
int
process_read_fpregs(p, regs)
-struct proc *p;
-struct fpreg *regs;
+ struct proc *p;
+ struct fpreg *regs;
{
#if 0
extern struct fpstate initfpstate;
@@ -141,8 +142,8 @@ struct fpreg *regs;
int
process_write_fpregs(p, regs)
-struct proc *p;
-struct fpreg *regs;
+ struct proc *p;
+ struct fpreg *regs;
{
#if 0
if (p->p_md.md_fpstate == NULL)
diff --git a/sys/arch/mvme88k/mvme88k/trap.c b/sys/arch/mvme88k/mvme88k/trap.c
index 39e7b4ebee0..bb97800ebdf 100644
--- a/sys/arch/mvme88k/mvme88k/trap.c
+++ b/sys/arch/mvme88k/mvme88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.13 2001/03/08 00:03:31 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.14 2001/03/09 05:44:42 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -56,12 +56,14 @@
#include <sys/user.h>
#include <sys/syscall.h>
#include <sys/ktrace.h>
+#include <machine/bugio.h> /* bugreturn() */
#include <machine/cpu.h> /* DMT_VALID, etc. */
#include <machine/asm_macro.h> /* enable/disable interrupts */
#include <machine/m88100.h> /* DMT_VALID, etc. */
#ifdef MVME197
#include <machine/m88110.h> /* DMT_VALID, etc. */
#endif
+#include <machine/locore.h>
#include <machine/trap.h>
#include <machine/psl.h> /* FIP_E, etc. */
#include <machine/pcb.h> /* FIP_E, etc. */
@@ -70,6 +72,7 @@
#if (DDB)
#include <machine/db_machdep.h>
+ #include <ddb/db_output.h> /* db_printf() */
#else
#define PC_REGS(regs) ((regs->sxip & 2) ? regs->sxip & ~3 : \
(regs->snip & 2 ? regs->snip & ~3 : regs->sfip & ~3))
@@ -99,6 +102,9 @@ unsigned traptrace = 0;
/* XXX MAJOR CLEANUP REQUIRED TO PORT TO BSD */
+extern int procfs_domem();
+extern void regdump __P((struct trapframe *f));
+
char *trap_type[] = {
"Reset",
"Interrupt Exception",
@@ -379,7 +385,7 @@ trap(unsigned type, struct m88100_saved_state *frame)
*/
frame->dmt0 = DMT_SKIP;
frame->dpfsr = 0;
- data_access_emulation(frame);
+ data_access_emulation((unsigned *)frame);
/* so data_access_emulation doesn't get called again. */
frame->dmt0 = 0;
return;
@@ -398,7 +404,7 @@ trap(unsigned type, struct m88100_saved_state *frame)
/*
printf("calling data_access_emulation()\n");
*/
- data_access_emulation(frame);
+ data_access_emulation((unsigned *)frame);
frame->dmt0 = 0;
frame->dpfsr = 0;
} else {
@@ -434,7 +440,7 @@ trap(unsigned type, struct m88100_saved_state *frame)
/*
printf("calling data_access_emulation()\n");
*/
- data_access_emulation(frame);
+ data_access_emulation((unsigned *)frame);
frame->dmt0 = 0;
frame->dpfsr = 0;
} else {
@@ -466,7 +472,7 @@ outtahere:
*/
frame->dmt0 = DMT_SKIP;
frame->dpfsr = 0;
- data_access_emulation(frame);
+ data_access_emulation((unsigned *)frame);
/* so data_access_emulation doesn't get called again. */
frame->dmt0 = 0;
return;
@@ -531,7 +537,7 @@ outtahere:
* pipe line and reset dmt0 so that trap won't
* get called again.
*/
- data_access_emulation(frame);
+ data_access_emulation((unsigned *)frame);
frame->dmt0 = 0;
frame->dpfsr = 0;
} else {
@@ -1633,8 +1639,8 @@ child_return(struct proc *p)
*/
u_long
allocate_sir(proc, arg)
-void (*proc)();
-void *arg;
+ void (*proc)();
+ void *arg;
{
int bit;
@@ -1768,7 +1774,7 @@ ss_getreg_val(unsigned regno, struct trapframe *tf)
}
}
-boolean_t
+int
ss_inst_branch(unsigned ins)
{
/* check high five bits */
@@ -1791,7 +1797,7 @@ ss_inst_branch(unsigned ins)
/* ss_inst_delayed - this instruction is followed by a delay slot. Could be
br.n, bsr.n bb0.n, bb1.n, bcnd.n or jmp.n or jsr.n */
-boolean_t
+int
ss_inst_delayed(unsigned ins)
{
/* check the br, bsr, bb0, bb1, bcnd cases */
diff --git a/sys/arch/mvme88k/mvme88k/vm_machdep.c b/sys/arch/mvme88k/mvme88k/vm_machdep.c
index c9fb725a41d..09258c5e544 100644
--- a/sys/arch/mvme88k/mvme88k/vm_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.18 2001/03/08 00:03:31 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.19 2001/03/09 05:44:43 smurph Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -65,6 +65,8 @@
#include <machine/cpu.h>
#include <machine/cpu_number.h>
+#include <machine/locore.h>
+#include <machine/cmmu.h>
#include <machine/pte.h>
extern struct map *iomap;
@@ -92,7 +94,9 @@ cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize)
extern struct pcb *curpcb;
extern void proc_do_uret(), child_return();
extern void proc_trampoline();
-
+ extern void savectx();
+ extern void save_u_area();
+
cpu = cpu_number();
/*
savectx(p1->p_addr->u_pcb);
@@ -204,6 +208,7 @@ cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred, struct core *
void
cpu_swapin(struct proc *p)
{
+ extern void save_u_area();
save_u_area(p, (vm_offset_t)p->p_addr);
}
@@ -528,7 +533,6 @@ u_int
kvtop(vm_offset_t va)
{
extern pmap_t kernel_pmap;
-
return ((u_int)pmap_extract(kernel_pmap, va));
}