summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraichen <graichen@openbsd.org>1997-06-10 14:18:36 +0000
committergraichen <graichen@openbsd.org>1997-06-10 14:18:36 +0000
commit3d698cefc81e4f30e8f66e6a76f780166f5c225e (patch)
tree3c317b85c84d857b7a51df107dbdc92fd309d6f1
parentmissing comma; josh@quick.net (diff)
downloadwireguard-openbsd-3d698cefc81e4f30e8f66e6a76f780166f5c225e.tar.xz
wireguard-openbsd-3d698cefc81e4f30e8f66e6a76f780166f5c225e.zip
update the pmax specific stuff to NetBSD-current as of about 970608 - some
cosmetic things will follow together with an update to an exact NETBSD_CU- RRENT_xxxxxx level
-rw-r--r--sys/arch/pmax/conf/GENERIC14
-rw-r--r--sys/arch/pmax/conf/files.pmax12
-rw-r--r--sys/arch/pmax/dev/dcvar.h11
-rw-r--r--sys/arch/pmax/dev/device.h4
-rw-r--r--sys/arch/pmax/dev/dtop.c26
-rw-r--r--sys/arch/pmax/dev/dtopvar.h46
-rw-r--r--sys/arch/pmax/dev/fb.c11
-rw-r--r--sys/arch/pmax/dev/fb_usrreq.c4
-rw-r--r--sys/arch/pmax/dev/lk201.c4
-rw-r--r--sys/arch/pmax/dev/mfb.c22
-rw-r--r--sys/arch/pmax/dev/mfbvar.h4
-rw-r--r--sys/arch/pmax/dev/pm_ds.c13
-rw-r--r--sys/arch/pmax/dev/qvss_compat.c97
-rw-r--r--sys/arch/pmax/dev/rz.c30
-rw-r--r--sys/arch/pmax/dev/sfb.c4
-rw-r--r--sys/arch/pmax/dev/sfbvar.h4
-rw-r--r--sys/arch/pmax/dev/sii.c7
-rw-r--r--sys/arch/pmax/dev/tz.c14
-rw-r--r--sys/arch/pmax/include/asm.h4
-rw-r--r--sys/arch/pmax/include/autoconf.h4
-rw-r--r--sys/arch/pmax/include/cdefs.h21
-rw-r--r--sys/arch/pmax/include/conf.h9
-rw-r--r--sys/arch/pmax/include/cpuregs.h14
-rw-r--r--sys/arch/pmax/include/ecoff_machdep.h49
-rw-r--r--sys/arch/pmax/include/elf_machdep.h75
-rw-r--r--sys/arch/pmax/include/fbvar.h6
-rw-r--r--sys/arch/pmax/include/locore.h1
-rw-r--r--sys/arch/pmax/include/mips_param.h1
-rw-r--r--sys/arch/pmax/include/param.h12
-rw-r--r--sys/arch/pmax/include/pmap.h6
-rw-r--r--sys/arch/pmax/include/proc.h8
-rw-r--r--sys/arch/pmax/include/tc_machdep.h4
-rw-r--r--sys/arch/pmax/include/types.h4
-rw-r--r--sys/arch/pmax/pmax/autoconf.c7
-rw-r--r--sys/arch/pmax/pmax/conf-glue.c4
-rw-r--r--sys/arch/pmax/pmax/conf.c8
-rw-r--r--sys/arch/pmax/pmax/cpu_cons.c25
-rw-r--r--sys/arch/pmax/pmax/disksubr.c4
-rw-r--r--sys/arch/pmax/pmax/locore.S82
-rw-r--r--sys/arch/pmax/pmax/machdep.c196
-rw-r--r--sys/arch/pmax/pmax/mem.c9
-rw-r--r--sys/arch/pmax/pmax/pmap.c87
-rw-r--r--sys/arch/pmax/pmax/pmax_trap.c42
-rw-r--r--sys/arch/pmax/pmax/process_machdep.c4
-rw-r--r--sys/arch/pmax/pmax/trap.c8
-rw-r--r--sys/arch/pmax/pmax/trap.h6
-rw-r--r--sys/arch/pmax/pmax/vm_machdep.c9
-rw-r--r--sys/arch/pmax/tc/asic.c4
-rw-r--r--sys/arch/pmax/tc/scc.c34
-rw-r--r--sys/arch/pmax/tc/tc_subr.c28
50 files changed, 777 insertions, 325 deletions
diff --git a/sys/arch/pmax/conf/GENERIC b/sys/arch/pmax/conf/GENERIC
index 81bfbb09280..45e2635e89d 100644
--- a/sys/arch/pmax/conf/GENERIC
+++ b/sys/arch/pmax/conf/GENERIC
@@ -91,21 +91,21 @@ le0 at tc? # decstation 5000/200 baseboard
le* at tc? # other lance network interfaces
# ioasic standard baseboard options (5000/2x, 5000/1xx, 5000/2[46]0)
ioasic0 at tc?
-clock0 at ioasic? # rtc
-asc0 at ioasic? # system scsi subslot
-scc0 at ioasic?
-le0 at ioasic? # tc onboard lance
-scc1 at ioasic? # not present on maxine
+clock0 at ioasic? offset? # rtc
+asc0 at ioasic? offset? # system scsi subslot
+scc0 at ioasic? offset?
+le0 at ioasic? offset? # tc onboard lance
+scc1 at ioasic? offset? # not present on maxine
# MAXINE-only ioasic baseboard devices and on-baseboard "options"
xcfb0 at tc? # tc framebuffer "option"
-dtop0 at ioasic0 # destop bus, lk501 kbd, mouse
+dtop0 at ioasic0 offset? # destop bus, lk501 kbd, mouse
# 5000/200-only (aka 3MAX aka KN02) baseboard devices (tc but no ioasic)
clock0 at mainbus0 # rtc
dc0 at mainbus0
le0 at tc? # tc ether "option" on baseboard
asc0 at tc? # tc scsi "option" on baseboard
# for now, pretend this machine has an ioasic
-dc0 at ioasic? # dc7083 four-port dz device
+dc0 at ioasic? offset? # dc7083 four-port dz device
# 2100/3100-only (aka PMAX aka KN01) baseboard devices.
clock0 at mainbus0 # rtc
pm0 at mainbus0 # 3100 onboard fb
diff --git a/sys/arch/pmax/conf/files.pmax b/sys/arch/pmax/conf/files.pmax
index ee0be79a7bc..aff778ff3fa 100644
--- a/sys/arch/pmax/conf/files.pmax
+++ b/sys/arch/pmax/conf/files.pmax
@@ -42,7 +42,7 @@ file dev/tc/tc.c tc needs-flag
# The TurboChannel IOCTL ASIC. Present on IOASIC machines,
# which is all turbochannel machines ever built except the 3MAX (5000/200).
#
-device ioasic { } #{ } # not really optional
+device ioasic { offset = -1 } # not really optional
attach ioasic at tc
file arch/pmax/tc/asic.c ioasic | dc_ds # TTTTT dc_ds is ugly
@@ -104,11 +104,11 @@ file arch/pmax/dev/rz.c rz needs-count
# DC7085 (DZ-like four-port serial device) on mainbus on non-IOASIC machines.
# For the 3MAX (aka kn02 aka 5k/200) pretend that it's on an ASIC.
device dc
-file arch/pmax/dev/dc.c dc needs-flag
+file arch/pmax/dev/dc.c dc
attach dc at ioasic with dc_ioasic
-file arch/pmax/dev/dc_ioasic.c dc_ioasic | dc_ds # TTTTT ugly
+file arch/pmax/dev/dc_ioasic.c dc_ioasic | dc_ds needs-flag # TTTTT ugly
attach dc at mainbus with dc_ds
-file arch/pmax/dev/dc_ds.c dc_ds
+file arch/pmax/dev/dc_ds.c dc_ds needs-flag
# The "desktop bus" on the MAXINE (5k/25). What is it, anyway? ADB?
@@ -135,7 +135,7 @@ device pm
file arch/pmax/dev/pm.c pm needs-flag
file arch/pmax/dev/bt478.c pm
attach pm at mainbus with pm_ds
-file arch/pmax/dev/pm_ds.c dc_ds
+file arch/pmax/dev/pm_ds.c pm_ds
########################################################################
# Turbochannel options.
@@ -156,7 +156,7 @@ file arch/pmax/dev/mfb.c mfb needs-flag
# Zilog 8350/Intel 82350(?) SCC UART.
device scc
attach scc at ioasic
-file arch/pmax/tc/scc.c scc needs-count
+file arch/pmax/tc/scc.c scc needs-flag
# MAXINE onboard framebuffer
device xcfb
diff --git a/sys/arch/pmax/dev/dcvar.h b/sys/arch/pmax/dev/dcvar.h
index d9aad4033a3..954b4c9ef7e 100644
--- a/sys/arch/pmax/dev/dcvar.h
+++ b/sys/arch/pmax/dev/dcvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dcvar.h,v 1.3 1996/09/25 20:48:57 jonathan Exp $ */
+/* $NetBSD: dcvar.h,v 1.4 1997/05/28 14:21:39 jonathan Exp $ */
/*
* External declarations from DECstation dc serial driver.
@@ -37,7 +37,14 @@ int dcintr __P((void * xxxunit));
extern int dcGetc __P ((dev_t dev));
extern int dcparam __P((register struct tty *tp, register struct termios *t));
extern void dcPutc __P((dev_t dev, int c));
-void dc_consinit __P((dev_t dev, dcregs *dcaddr));
+
+struct dc7085regs;
+void dc_consinit __P((dev_t dev, volatile struct dc7085regs *dcaddr));
+
+/* QVSS-compatible in-kernel X input event parser, pointer tracker */
+void (*dcDivertXInput) __P((int cc)); /* X windows keyboard input routine */
+void (*dcMouseEvent) __P((int)); /* X windows mouse motion event routine */
+void (*dcMouseButtons) __P((int)); /* X windows mouse buttons event routine */
#endif /* _DCVAR_H */
#endif /* _KERNEL */
diff --git a/sys/arch/pmax/dev/device.h b/sys/arch/pmax/dev/device.h
index 0d122f5ff7b..819ddd1e4df 100644
--- a/sys/arch/pmax/dev/device.h
+++ b/sys/arch/pmax/dev/device.h
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.11 1996/10/01 01:04:50 jonathan Exp $ */
+/* $NetBSD: device.h,v 1.12 1997/01/31 02:00:56 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,6 +45,7 @@
* different types of controllers.
*/
struct ScsiCmd;
+struct device;
struct pmax_driver {
char *d_name; /* device driver name (e.g., "rz") */
@@ -88,6 +89,7 @@ struct pmax_scsi_device {
int sd_flags; /* flags */
int sd_alive; /* true if init routine succeeded */
+ struct device *sd_devp; /* new config glue kludge */
};
/* Define special unit types used by the config program */
diff --git a/sys/arch/pmax/dev/dtop.c b/sys/arch/pmax/dev/dtop.c
index df0e35c2021..784f03ddea2 100644
--- a/sys/arch/pmax/dev/dtop.c
+++ b/sys/arch/pmax/dev/dtop.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dtop.c,v 1.20 1996/10/13 13:13:55 jonathan Exp $ */
+/* $NetBSD: dtop.c,v 1.23 1997/05/25 04:58:36 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -93,8 +93,6 @@ SOFTWARE.
********************************************************/
-#include "dtop.h"
-#if NDTOP > 0
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
@@ -115,8 +113,11 @@ SOFTWARE.
#include <dev/cons.h>
#include <pmax/cpuregs.h> /* mips cached->uncached */
+#include <machine/dc7085cons.h> /* mdmctl bits same on dtop and dc? */
#include <machine/pmioctl.h>
-#include <machine/dc7085cons.h>
+#include <machine/fbio.h>
+#include <machine/fbvar.h>
+#include <pmax/dev/fbreg.h>
#include <pmax/pmax/asic.h>
#include <pmax/pmax/maxine.h>
@@ -128,12 +129,6 @@ SOFTWARE.
#include <pmax/dev/lk201var.h>
#include <pmax/dev/dtopvar.h>
-#include <machine/fbio.h>
-#include <machine/fbvar.h>
-#include <pmax/dev/fbreg.h>
-
-extern int pmax_boardtype;
-
#define DTOP_MAX_POLL 0x7fff /* about half a sec */
@@ -160,7 +155,8 @@ struct dtop_softc {
short bad_pkts;
struct dtop_ds {
- int (*handler)();
+ int (*handler)
+ __P((dtop_device_t, dtop_message_t, int, int));
dtop_device status;
} device[(DTOP_ADDR_DEFAULT - DTOP_ADDR_FIRST) >> 1];
@@ -184,13 +180,6 @@ int dtop_keyboard_handler __P((dtop_device_t, dtop_message_t, int, int));
int dtopparam __P((struct tty *, struct termios *));
void dtopstart __P((struct tty *));
-void dtopKBDPutc __P((dev_t, int));
-int dtopKBDGetc __P((dev_t));
-
-
-void (*dtopDivertXInput)(); /* X windows keyboard input routine */
-void (*dtopMouseEvent)(); /* X windows mouse motion event routine */
-void (*dtopMouseButtons)(); /* X windows mouse buttons event routine */
/*
@@ -940,4 +929,3 @@ dtop_keyboard_repeat(arg)
dev->keyboard.k_ar_state = K_AR_IDLE;
splx(s);
}
-#endif
diff --git a/sys/arch/pmax/dev/dtopvar.h b/sys/arch/pmax/dev/dtopvar.h
index 0f47e91c284..587e35a18c8 100644
--- a/sys/arch/pmax/dev/dtopvar.h
+++ b/sys/arch/pmax/dev/dtopvar.h
@@ -1,7 +1,53 @@
+/* $NetBSD: dtopvar.h,v 1.2 1997/05/25 04:50:00 jonathan Exp $ */
+
+/*
+ * Copyright (c) 1997 Jonathan Stone. 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Jonathan Stone for
+ * the NetBSD Project.
+ * 4. 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.
+ */
+
int dtopKBDGetc __P((dev_t dev));
void dtopKBDPutc __P((dev_t dev, int c));
/*
+ * Support for UGLY 4.4bsd/pmax-derived console/X11 input redirection
+ * to in-kernel input-event queue.
+ */
+
+/* X11 keyboard input upcall */
+void (*dtopDivertXInput) __P((int));
+
+/* X11 mouse motion event upcall */
+void (*dtopMouseEvent) __P((MouseReport *mrp));
+
+/* X11 mouse buttons event upcall */
+void (*dtopMouseButtons) __P((MouseReport *mrp));
+
+/*
* Device numbers.
*/
#define DTOPKBD_PORT 0
diff --git a/sys/arch/pmax/dev/fb.c b/sys/arch/pmax/dev/fb.c
index 78819923641..0f0bfcc15cb 100644
--- a/sys/arch/pmax/dev/fb.c
+++ b/sys/arch/pmax/dev/fb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fb.c,v 1.18 1996/10/14 04:55:26 jonathan Exp $ */
+/* $NetBSD: fb.c,v 1.19 1997/05/24 08:19:50 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -100,7 +100,8 @@
#include "rasterconsole.h"
-#include "dc.h"
+#include "dc_ioasic.h"
+#include "dc_ds.h"
#include "scc.h"
#include "dtop.h"
@@ -122,7 +123,7 @@ extern int pmax_boardtype;
extern void fbScreenInit __P (( struct fbinfo *fi));
-#if NDC > 0
+#if (NDC_DS > 0) || (NDC_IOASIC > 0)
#include <machine/dc7085cons.h>
#include <pmax/dev/dcvar.h>
#endif
@@ -271,13 +272,13 @@ tb_kbdmouseconfig(fi)
switch (pmax_boardtype) {
-#if NDC > 0
+#if (NDC_DS > 0) || (NDC_IOASIC > 0)
case DS_PMAX:
case DS_3MAX:
fi->fi_glasstty->KBDPutc = dcPutc;
fi->fi_glasstty->kbddev = makedev(DCDEV, DCKBD_PORT);
break;
-#endif /* NDC */
+#endif /* NDC_DS || NDC_IOASIC */
#if NSCC > 0
case DS_3MIN:
diff --git a/sys/arch/pmax/dev/fb_usrreq.c b/sys/arch/pmax/dev/fb_usrreq.c
index 9b01185eb50..b183c32c742 100644
--- a/sys/arch/pmax/dev/fb_usrreq.c
+++ b/sys/arch/pmax/dev/fb_usrreq.c
@@ -183,11 +183,11 @@ fbioctl(dev, cmd, data, flag, p)
break;
case FBIOGVIDEO:
- *(int *)data = fi->fi_blanked;
+ *(int *)data = (fi->fi_blanked) ? FBVIDEO_OFF: FBVIDEO_ON;
break;
case FBIOSVIDEO:
- if (*(int *)data)
+ if (*(int *)data == FBVIDEO_OFF)
return (*(fi->fi_driver->fbd_blank)) (fi);
else
return (*(fi->fi_driver->fbd_unblank)) (fi);
diff --git a/sys/arch/pmax/dev/lk201.c b/sys/arch/pmax/dev/lk201.c
index 6a792aecf58..08b62a312e2 100644
--- a/sys/arch/pmax/dev/lk201.c
+++ b/sys/arch/pmax/dev/lk201.c
@@ -1,3 +1,5 @@
+/* $NetBSD: lk201.c,v 1.6 1997/05/25 05:26:00 jonathan Exp $ */
+
/*
* The LK201 keycode mapping routine is here, along with initialization
* functions for the keyboard and mouse.
@@ -321,8 +323,6 @@ LKgetc(dev)
{
register int c;
- extern sccGetc();
-
#if 0
/*XXX*/ printf("LK-201 getc 0x%x( [%d %d]) in_dev [%d %d]\n",
raw_kbd_getc,
diff --git a/sys/arch/pmax/dev/mfb.c b/sys/arch/pmax/dev/mfb.c
index 1fb35093fbe..baa74cdb61a 100644
--- a/sys/arch/pmax/dev/mfb.c
+++ b/sys/arch/pmax/dev/mfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mfb.c,v 1.20 1996/10/13 13:13:59 jonathan Exp $ */
+/* $NetBSD: mfb.c,v 1.23 1997/04/19 08:25:31 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -202,7 +202,7 @@ void mfbattach __P((struct device *, struct device *, void *));
int mfb_intr __P((void *sc));
struct cfattach mfb_ca = {
- sizeof(struct device), mfbmatch, mfbattach
+ sizeof(struct fbinfo), mfbmatch, mfbattach
};
struct cfdriver mfb_cd = {
@@ -308,13 +308,13 @@ mfbinit(fi, mfbaddr, unit, silent)
fi->fi_base = (caddr_t)(mfbaddr + MFB_OFFSET_BT431);
fi->fi_vdac = (caddr_t)(mfbaddr + MFB_OFFSET_BT455);
fi->fi_size = (fi->fi_pixels + MFB_FB_SIZE) - fi->fi_base;
- fi->fi_linebytes = 1280;
+ fi->fi_linebytes = 2048; /* inter-line stride (blitting) */
fi->fi_driver = &mfb_driver;
fi->fi_blanked = 0;
/* Fill in Frame Buffer Type struct. */
fi->fi_type.fb_boardtype = PMAX_FBTYPE_MFB;
- fi->fi_type.fb_width = 1280;
+ fi->fi_type.fb_width = 1280; /* visible screen pixels */
fi->fi_type.fb_height = 1024;
fi->fi_type.fb_depth = 8;
fi->fi_type.fb_cmsize = 0;
@@ -479,6 +479,7 @@ mfbPosCursor(fi, x, y)
{
bt431_regmap_t *regs = (bt431_regmap_t *)(fi -> fi_base);
+#ifdef MELLON
if (y < 0)
y = 0;
else if (y > fi -> fi_type.fb_width - fi -> fi_cursor.width - 1)
@@ -488,6 +489,15 @@ mfbPosCursor(fi, x, y)
else if (x > fi -> fi_type.fb_height - fi -> fi_cursor.height - 1)
x = fi -> fi_type.fb_height - fi -> fi_cursor.height - 1;
+#else /* old-style pmax glass tty */
+ if (y < fi->fi_fbu->scrInfo.min_cur_y ||
+ y > fi->fi_fbu->scrInfo.max_cur_y)
+ y = fi->fi_fbu->scrInfo.max_cur_y;
+ if (x < fi->fi_fbu->scrInfo.min_cur_x ||
+ x > fi->fi_fbu->scrInfo.max_cur_x)
+ x = fi->fi_fbu->scrInfo.max_cur_x;
+#endif /* old-style pmax glass tty */
+
fi -> fi_cursor.x = x;
fi -> fi_cursor.y = y;
@@ -521,6 +531,8 @@ mfbInitColorMapBlack(fi, blackpix)
u_char rgb [3];
register int i;
+ blackpix = 1; /* XXX XXX XXX defeat screensave bug */
+
if (blackpix)
rgb [0] = rgb [1] = rgb [2] = 0xff;
else
@@ -688,7 +700,7 @@ bt455_video_off(fi)
mfbRestoreCursorColor (fi);
bcopy (cursor_save, cursor_RGB, 6);
- fi -> fi_blanked = 0;
+ fi -> fi_blanked = 1;
return 0;
}
diff --git a/sys/arch/pmax/dev/mfbvar.h b/sys/arch/pmax/dev/mfbvar.h
index 9ba98ecbe5a..112d2701f2e 100644
--- a/sys/arch/pmax/dev/mfbvar.h
+++ b/sys/arch/pmax/dev/mfbvar.h
@@ -1,8 +1,8 @@
-/* $NetBSD: mfbvar.h,v 1.1 1996/09/21 03:06:37 jonathan Exp $ */
+/* $NetBSD: mfbvar.h,v 1.2 1997/05/24 09:15:49 jonathan Exp $ */
/*
* Initialize a Turbochannel MFB 1280x1024x1 2-d framebuffer,
* so it can be used as a bitmapped glass-tty console device.
*/
extern int
-mcfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
+mfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
diff --git a/sys/arch/pmax/dev/pm_ds.c b/sys/arch/pmax/dev/pm_ds.c
index a1619140ba2..8435563d59d 100644
--- a/sys/arch/pmax/dev/pm_ds.c
+++ b/sys/arch/pmax/dev/pm_ds.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pm_ds.c,v 1.3 1996/10/23 02:34:23 mhitch Exp $ */
+/* $NetBSD: pm_ds.c,v 1.4 1997/05/24 08:19:52 jonathan Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -36,10 +36,10 @@
#include "fb.h"
#include "pm.h"
-#include "dc.h"
+#include "dc_ds.h"
#if 0
-#if NDC == 0
+#if NDC_DS == 0
pm needs dc device
#endif
#endif
@@ -71,6 +71,11 @@ struct fbinfo pmfi; /*XXX*/
extern struct pmax_fbtty pmfb;
/*
+ * rcons methods and globals.
+ */
+extern struct pmax_fbtty pmfb;
+
+/*
* XXX
* pmax raster-console infrastructure needs to reset the mouse, so
* we need a driver callback.
@@ -187,6 +192,8 @@ pminit(fi, unit, cold_console_flag)
fi->fi_glasstty = &pmfb;
+ fi->fi_glasstty = &pmfb;
+
/*
* set putc/getc entry point
*/
diff --git a/sys/arch/pmax/dev/qvss_compat.c b/sys/arch/pmax/dev/qvss_compat.c
index 85f0b394ee0..7213063a143 100644
--- a/sys/arch/pmax/dev/qvss_compat.c
+++ b/sys/arch/pmax/dev/qvss_compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: qvss_compat.c,v 1.6 1996/10/13 03:39:36 christos Exp $ */
+/* $NetBSD: qvss_compat.c,v 1.8 1997/05/25 10:53:33 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -89,7 +89,8 @@
#include <pmax/pmax/cons.h>
#include <pmax/pmax/pmaxtype.h>
-#include "dc.h"
+#include "dc_ds.h"
+#include "dc_ioasic.h"
#include "scc.h"
#include "dtop.h"
@@ -99,8 +100,17 @@
*/
#include <pmax/dev/qvssvar.h> /* our own externs */
+
+struct termios; struct dcregs;
+#include <pmax/dev/dtopvar.h> /* dtop console I/O decls */
+#include <pmax/tc/sccvar.h> /* ioasic z8530 I/O decls */
+#include <pmax/dev/dcvar.h> /* DZ-11 chip console I/O */
+
extern int pmax_boardtype;
+/*
+ * Prototypes of local functions
+ */
extern void pmEventQueueInit __P((pmEventQueue *qe));
void genKbdEvent __P((int ch));
void genMouseEvent __P((MouseReport *newRepPtr));
@@ -110,41 +120,12 @@ void genDeconfigMouse __P((void));
void mouseInput __P((int cc));
-
-#if NDC > 0
-extern void (*dcDivertXInput)();
-extern void (*dcMouseEvent)();
-extern void (*dcMouseButtons)();
-#endif
-#if NSCC > 0
-extern void (*sccDivertXInput)();
-extern void (*sccMouseEvent)();
-extern void (*sccMouseButtons)();
-#endif
-#if NDTOP > 0
-extern void (*dtopDivertXInput)();
-extern void (*dtopMouseEvent)();
-extern void (*dtopMouseButtons)();
-#endif
-
-
-#if 0 /*XXX*/
-#if NDC > 0
-#include <machine/dc7085cons.h>
-extern int dcGetc(), dcparam();
-extern void dcPutc();
-#endif
-#if NDTOP > 0
-#include <pmax/dev/dtopreg.h>
-extern void dtopKBDPutc();
-#endif
#if NSCC > 0
-#include <pmax/dev/sccreg.h>
-extern int sccGetc(), sccparam();
-extern void sccPutc();
+extern void (*sccDivertXInput) __P((int cc));
+extern void (*sccMouseEvent) __P((int));
+extern void (*sccMouseButtons) __P((int));
#endif
-#endif /* 0 */
extern struct fbinfo *firstfi;
@@ -566,14 +547,22 @@ genConfigMouse()
s = spltty();
switch (pmax_boardtype) {
-#if NDC > 0
+#if NDC_IOASIC > 0
case DS_3MAX:
+ dcDivertXInput = genKbdEvent;
+ dcMouseEvent = (void (*) __P((int)))genMouseEvent;
+ dcMouseButtons = (void (*) __P((int)))genMouseButtons;
+ break;
+#endif /* NDC_IOASIC */
+
+#if NDC_DS > 0
case DS_PMAX:
dcDivertXInput = genKbdEvent;
- dcMouseEvent = genMouseEvent;
- dcMouseButtons = genMouseButtons;
+ dcMouseEvent = (void (*) __P((int)))genMouseEvent;
+ dcMouseButtons = (void (*) __P((int)))genMouseButtons;
break;
-#endif
+#endif /* NDC_DS */
+
#if NSCC > 1
case DS_3MIN:
case DS_3MAXPLUS:
@@ -605,27 +594,37 @@ genDeconfigMouse()
s = spltty();
switch (pmax_boardtype) {
-#if NDC > 0
+#if NDC_IOASIC > 0
case DS_3MAX:
+
+ dcDivertXInput = (void (*) __P((int)) )0;
+ dcMouseEvent = (void (*) __P((int)) )0;
+ dcMouseButtons = (void (*) __P((int)) )0;
+ break;
+#endif /* NDC_IOASIC */
+
+#if NDC_DS > 0
case DS_PMAX:
- dcDivertXInput = (void (*)())0;
- dcMouseEvent = (void (*)())0;
- dcMouseButtons = (void (*)())0;
+ dcDivertXInput = (void (*) __P((int)) )0;
+ dcMouseEvent = (void (*) __P((int)) )0;
+ dcMouseButtons = (void (*) __P((int)) )0;
break;
-#endif
+#endif /* NDC_DS */
+
#if NSCC > 1
case DS_3MIN:
case DS_3MAXPLUS:
- sccDivertXInput = (void (*)())0;
- sccMouseEvent = (void (*)())0;
- sccMouseButtons = (void (*)())0;
+ sccDivertXInput = (void (*) __P((int)) )0;
+ sccMouseEvent = (void (*) __P((MouseReport *)) )0;
+ sccMouseButtons = (void (*) __P((MouseReport *)) )0;
break;
#endif
+
#if NDTOP > 0
case DS_MAXINE:
- dtopDivertXInput = (void (*)())0;
- dtopMouseEvent = (void (*)())0;
- dtopMouseButtons = (void (*)())0;
+ dtopDivertXInput = (void (*) __P((int)) )0;
+ dtopMouseEvent = (void (*) __P((MouseReport *)) )0;
+ dtopMouseButtons = (void (*) __P((MouseReport *)) )0;
break;
#endif
default:
diff --git a/sys/arch/pmax/dev/rz.c b/sys/arch/pmax/dev/rz.c
index d0ec6e419cc..c6b4cac3075 100644
--- a/sys/arch/pmax/dev/rz.c
+++ b/sys/arch/pmax/dev/rz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rz.c,v 1.20 1996/10/13 03:39:38 christos Exp $ */
+/* $NetBSD: rz.c,v 1.23 1997/02/04 05:24:55 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -59,6 +59,7 @@
#include <sys/uio.h>
#include <sys/stat.h>
#include <sys/syslog.h>
+#include <sys/device.h>
#include <ufs/ffs/fs.h>
@@ -98,16 +99,6 @@ struct size {
* (including the boot area).
*/
static struct size rzdefaultpart[MAXPARTITIONS] = {
-#ifdef GENERIC /* greedy machines have 64 meg of swap */
- { 0, 32768 }, /* A */
- { 32768, 131072 }, /* B */
- { 0, 0 }, /* C */
- { 17408, 0 }, /* D */
- { 115712, 0 }, /* E */
- { 218112, 0 }, /* F */
- { 163840, 0 }, /* G */
- { 115712, 0 } /* H */
-#else
{ 0, 16384 }, /* A */
{ 16384, 65536 }, /* B */
{ 0, 0 }, /* C */
@@ -116,7 +107,6 @@ static struct size rzdefaultpart[MAXPARTITIONS] = {
{ 218112, 0 }, /* F */
{ 81920, 0 }, /* G */
{ 115712, 0 } /* H */
-#endif
};
extern char *
@@ -127,7 +117,7 @@ readdisklabel __P((dev_t dev, void (*strat) __P((struct buf *bp)),
* Ultrix disklabel declarations
*/
#ifdef COMPAT_ULTRIX
-#include "../../stand/dec_boot.h"
+#include <pmax/stand/dec_boot.h>
extern char *
compat_label __P((dev_t dev, void (*strat) __P((struct buf *bp)),
@@ -144,6 +134,7 @@ struct rzstats {
};
struct rz_softc {
+ struct device sc_dev; /* new config glue */
struct pmax_scsi_device *sc_sd; /* physical unit info */
pid_t sc_format_pid; /* process using "format" mode */
short sc_flags; /* see below */
@@ -156,7 +147,6 @@ struct rz_softc {
#define sc_bopenpart sc_dkdev.dk_bopenmask /* XXX compat */
#define sc_copenpart sc_dkdev.dk_copenmask /* XXX compat */
#define sc_bshift sc_dkdev.dk_blkshift /* XXX compat */
- char sc_xname[8]; /* XXX external name */
struct rzstats sc_stats; /* statisic counts */
struct buf sc_tab; /* queue of pending operations */
struct buf sc_buf; /* buf for doing I/O */
@@ -356,12 +346,14 @@ rzprobe(xxxsd)
sc->sc_rwcmd.unitNumber = sd->sd_slave;
/* XXX set up the external name */
- bzero(sc->sc_xname, sizeof(sc->sc_xname)); /* XXX */
- sprintf(sc->sc_xname, "rz%d", sd->sd_unit); /* XXX */
+ bzero(&sc->sc_dev, sizeof(sc->sc_dev)); /* XXX */
+ sprintf(sc->sc_dev.dv_xname, "rz%d", sd->sd_unit); /* XXX */
+ sc->sc_dev.dv_unit = sd->sd_unit; /* XXX */
+ sc->sc_dev.dv_class = DV_DISK; /* XXX */
/* Initialize the disk structure. */
bzero(&sc->sc_dkdev, sizeof(sc->sc_dkdev));
- sc->sc_dkdev.dk_name = sc->sc_xname;
+ sc->sc_dkdev.dk_name = sc->sc_dev.dv_xname;
/* try to find out what type of device this is */
sc->sc_format_pid = 1; /* force use of sc_cdb */
@@ -445,6 +437,10 @@ rzprobe(xxxsd)
if (inqbuf.rmb)
sc->sc_flags |= RZF_REMOVEABLE;
sc->sc_buf.b_flags = 0;
+
+ sd->sd_devp = &sc->sc_dev; /* XXX */
+ TAILQ_INSERT_TAIL(&alldevs, &sc->sc_dev, dv_list); /* XXX */
+
return (1);
bad:
diff --git a/sys/arch/pmax/dev/sfb.c b/sys/arch/pmax/dev/sfb.c
index 838c0d0e79a..e0894ed6244 100644
--- a/sys/arch/pmax/dev/sfb.c
+++ b/sys/arch/pmax/dev/sfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sfb.c,v 1.18 1996/10/13 13:14:01 jonathan Exp $ */
+/* $NetBSD: sfb.c,v 1.19 1997/01/22 17:27:54 mhitch Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -131,7 +131,7 @@ void sfbattach __P((struct device *, struct device *, void *));
int sfb_intr __P((void *sc));
struct cfattach sfb_ca = {
- sizeof(struct device), sfbmatch, sfbattach
+ sizeof(struct fbinfo), sfbmatch, sfbattach
};
struct cfdriver sfb_cd = {
diff --git a/sys/arch/pmax/dev/sfbvar.h b/sys/arch/pmax/dev/sfbvar.h
index b72a71f62bc..f30bbd45562 100644
--- a/sys/arch/pmax/dev/sfbvar.h
+++ b/sys/arch/pmax/dev/sfbvar.h
@@ -1,8 +1,8 @@
-/* $NetBSD: sfbvar.h,v 1.1 1996/09/21 03:06:36 jonathan Exp $ */
+/* $NetBSD: sfbvar.h,v 1.2 1997/05/24 09:15:46 jonathan Exp $ */
/*
* Initialize a Turbochannel SFB 2-d framebuffer,
* so it can be used as a bitmapped glass-tty console device.
*/
extern int
-scfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
+sfbinit __P((struct fbinfo *fi, caddr_t base, int unit, int silent));
diff --git a/sys/arch/pmax/dev/sii.c b/sys/arch/pmax/dev/sii.c
index 7052341147a..b010abfccd4 100644
--- a/sys/arch/pmax/dev/sii.c
+++ b/sys/arch/pmax/dev/sii.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sii.c,v 1.20 1996/10/22 23:15:10 mhitch Exp $ */
+/* $NetBSD: sii.c,v 1.23 1997/05/29 19:26:06 jonathan Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -688,6 +688,8 @@ again:
* and to just clear the bit if it's set.
*/
if (cstat & SII_BER) {
+ regs->cstat = SII_BER;
+ wbflush();
}
#endif
@@ -718,6 +720,7 @@ again:
cstat); /* XXX */
if (cstat & SII_DST) {
sc->sc_target = regs->destat;
+ state = &sc->sc_st[sc->sc_target];
state->prevComm = 0;
} else
panic("sc_target 1");
@@ -825,6 +828,7 @@ again:
cstat, dstat); /* XXX */
if (cstat & SII_DST) {
sc->sc_target = regs->destat;
+ state = &sc->sc_st[sc->sc_target];
state->prevComm = 0;
} else {
#ifdef DEBUG
@@ -1606,6 +1610,7 @@ sii_GetByte(regs, phase, ack)
dstat = regs->dstat;
state = regs->cstat & SII_STATE_MSK;
+ i = -1;
if (!(dstat & SII_IBF) || (dstat & SII_MIS)) {
regs->comm = state | phase;
wbflush();
diff --git a/sys/arch/pmax/dev/tz.c b/sys/arch/pmax/dev/tz.c
index 13bcc3fc275..028b028b646 100644
--- a/sys/arch/pmax/dev/tz.c
+++ b/sys/arch/pmax/dev/tz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tz.c,v 1.14 1996/10/13 12:34:20 jonathan Exp $ */
+/* $NetBSD: tz.c,v 1.15 1997/01/31 02:00:59 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -57,6 +57,7 @@
#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/tprintf.h>
+#include <sys/device.h>
#include <sys/conf.h>
#include <machine/conf.h>
@@ -77,6 +78,7 @@ struct pmax_driver tzdriver = {
};
struct tz_softc {
+ struct device sc_dev; /* new config glue */
struct pmax_scsi_device *sc_sd; /* physical unit info */
int sc_flags; /* see below */
int sc_tapeid; /* tape drive id */
@@ -140,6 +142,12 @@ tzprobe(xxxsd)
sc->sc_cmd.flags = 0;
sc->sc_rwcmd.unitNumber = sd->sd_slave;
+ /* XXX set up device info */ /* XXX */
+ bzero(&sc->sc_dev, sizeof(sc->sc_dev)); /* XXX */
+ sprintf(sc->sc_dev.dv_xname, "tz%d", sd->sd_unit); /* XXX */
+ sc->sc_dev.dv_unit = sd->sd_unit; /* XXX */
+ sc->sc_dev.dv_class = DV_TAPE; /* XXX */
+
/* try to find out what type of device this is */
sc->sc_flags = TZF_ALTCMD; /* force use of sc_cdb */
sc->sc_cdb.len = sizeof(ScsiGroup0Cmd);
@@ -232,6 +240,10 @@ tzprobe(xxxsd)
sc->sc_tapeid = 0;
}
}
+
+ sd->sd_devp = &sc->sc_dev; /* XXX */
+ TAILQ_INSERT_TAIL(&alldevs, &sc->sc_dev, dv_list); /* XXX */
+
return (1);
bad:
diff --git a/sys/arch/pmax/include/asm.h b/sys/arch/pmax/include/asm.h
index 6d1efa978be..56d58cd16b8 100644
--- a/sys/arch/pmax/include/asm.h
+++ b/sys/arch/pmax/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.3 1997/05/11 16:12:12 pefo Exp $ */
+/* $OpenBSD: asm.h,v 1.4 1997/06/10 14:18:56 graichen Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -92,7 +92,7 @@
/*
* Define -pg profile entry code.
*/
-#if defined(GPROF) || defined(PROF)
+#ifdef GPROF
#define MCOUNT \
.set noreorder; \
.set noat; \
diff --git a/sys/arch/pmax/include/autoconf.h b/sys/arch/pmax/include/autoconf.h
index 06416ffb952..ac1d235bba5 100644
--- a/sys/arch/pmax/include/autoconf.h
+++ b/sys/arch/pmax/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.h,v 1.7 1996/05/29 06:19:49 mhitch Exp $ */
+/* $NetBSD: autoconf.h,v 1.8 1997/05/25 06:10:47 jonathan Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -74,3 +74,5 @@ void set_clockintr __P((void (*)(struct clockframe *)));
#endif
void set_iointr __P((void (*)(void *, int)));
int badaddr __P((void *, u_int));
+void configure __P((void));
+void makebootdev __P((char *cp));
diff --git a/sys/arch/pmax/include/cdefs.h b/sys/arch/pmax/include/cdefs.h
index bc0383e8f7d..6812d5fcc4a 100644
--- a/sys/arch/pmax/include/cdefs.h
+++ b/sys/arch/pmax/include/cdefs.h
@@ -35,4 +35,25 @@
#define __indr_references(sym,msg) /* nothing */
#define __warn_references(sym,msg) /* nothing */
+/* Kernel-only .sections for kernel copyright */
+#ifdef _KERNEL
+
+#ifdef __STDC__
+#define __KERNEL_SECTIONSTRING(_sec, _str) \
+ __asm__(".section " #_sec " ; .asciz \"" _str "\" ; .text")
+#else
+#define __KERNEL_SECTIONSTRING(_sec, _str) \
+ __asm__(".section _sec ; .asciz _str ; .text")
+#endif
+
+#define __KERNEL_RCSID(_n, _s) __KERNEL_SECTIONSTRING(.ident, _s)
+#define __KERNEL_COPYRIGHT(_n, _s) __KERNEL_SECTIONSTRING(.copyright, _s)
+
+#ifdef NO_KERNEL_RCSIDS
+#undef __KERNEL_RCSID
+#define __KERNEL_RCSID(_n, _s) /* nothing */
+#endif
+
+#endif /* _KERNEL */
+
#endif /* !_MACHINE_CDEFS_H_ */
diff --git a/sys/arch/pmax/include/conf.h b/sys/arch/pmax/include/conf.h
index e854da965a1..cd3694affe7 100644
--- a/sys/arch/pmax/include/conf.h
+++ b/sys/arch/pmax/include/conf.h
@@ -21,7 +21,7 @@
cdev_decl(mm);
-cdev_decl(scc); /* pmax (also alpha m-d z8530 SCC */
+cdev_decl(scc); /* pmax (also alpha) m-d z8530 SCC */
cdev_decl(dc); /* dc7085 dz11-on-a-chip */
bdev_decl(rz); /* antique 4.4bsd/pmax SCSI disk */
@@ -33,3 +33,10 @@ cdev_decl(tz);
cdev_decl(dtop); /* Personal Decstation (MAXINE) desktop bus */
cdev_decl(fb); /* generic framebuffer pseudo-device */
cdev_decl(rcons); /* framebuffer-based raster console pseudo-device */
+
+/* TTTTT - stuff from NetBSD mips conf.h */
+cdev_decl(pms);
+
+bdev_decl(fd);
+cdev_decl(fd);
+/* TTTTT - end of stuff from NetBSD mips conf.h */
diff --git a/sys/arch/pmax/include/cpuregs.h b/sys/arch/pmax/include/cpuregs.h
index f446b79de00..a5f197211e0 100644
--- a/sys/arch/pmax/include/cpuregs.h
+++ b/sys/arch/pmax/include/cpuregs.h
@@ -587,4 +587,18 @@
#define VMMACH_TLB_FOUND_WITH_PATCH 2
#define VMMACH_TLB_PROBE_ERROR 3
+/* TTTTT - stuff from NetBSD mips cpuregs.h */
+/*
+ * nesting interrupt masks.
+ */
+#define MACH_INT_MASK_SPL_SOFT0 MACH_SOFT_INT_MASK_0
+#define MACH_INT_MASK_SPL_SOFT1 (MACH_SOFT_INT_MASK_1|MACH_INT_MASK_SPL_SOFT0)
+#define MACH_INT_MASK_SPL0 (MACH_INT_MASK_0|MACH_INT_MASK_SPL_SOFT1)
+#define MACH_INT_MASK_SPL1 (MACH_INT_MASK_1|MACH_INT_MASK_SPL0)
+#define MACH_INT_MASK_SPL2 (MACH_INT_MASK_2|MACH_INT_MASK_SPL1)
+#define MACH_INT_MASK_SPL3 (MACH_INT_MASK_3|MACH_INT_MASK_SPL2)
+#define MACH_INT_MASK_SPL4 (MACH_INT_MASK_4|MACH_INT_MASK_SPL3)
+#define MACH_INT_MASK_SPL5 (MACH_INT_MASK_5|MACH_INT_MASK_SPL4)
+/* TTTTT - end of stuff from NetBSD mips cpuregs.h */
+
#endif /* _MACHCONST */
diff --git a/sys/arch/pmax/include/ecoff_machdep.h b/sys/arch/pmax/include/ecoff_machdep.h
index 72dba194502..e5c88a636f4 100644
--- a/sys/arch/pmax/include/ecoff_machdep.h
+++ b/sys/arch/pmax/include/ecoff_machdep.h
@@ -44,3 +44,52 @@
#define ECOFF_BADMAG(ep) ((ep)->f.f_magic != ECOFF_MAGIC_MIPSEL)
#define ECOFF_SEGMENT_ALIGNMENT(ep) ((ep)->a.vstamp < 23 ? 8 : 16)
+
+/* TTTTT - stuff from NetBSD mips dir */
+
+extern void cpu_exec_ecoff_setregs __P((
+ struct proc *, struct exec_package *, u_long, register_t *));
+
+
+/*
+ * ECOFF symbol definitions for 32-bit mips.
+ * XXX 64-bit (mips3?) may be different.
+ */
+struct ecoff_symhdr {
+ int16_t magic;
+ int16_t vstamp;
+ int32_t lineMax;
+ int32_t densenumMax;
+ int32_t procMax;
+ int32_t lsymMax;
+ int32_t optsymMax;
+ int32_t auxsymMax;
+ int32_t lstrMax;
+ int32_t estrMax;
+ int32_t fdMax;
+ int32_t rfdMax;
+ int32_t esymMax;
+ long linesize;
+ long cbLineOffset;
+ long cbDnOffset;
+ long cbPdOffset;
+ long cbSymOffset;
+ long cbOptOffset;
+ long cbAuxOffset;
+ long cbSsOffset;
+ long cbSsExtOffset;
+ long cbFdOffset;
+ long cbRfdOffset;
+ long cbExtOffset;
+};
+
+struct ecoff_extsym {
+ int32_t es_strindex;
+ int32_t es_value;
+ unsigned es_type:6;
+ unsigned es_class:5;
+ unsigned :1;
+ unsigned es_symauxindex:20;
+};
+
+/* TTTTT - end of stuff from NetBSD mips dir */
diff --git a/sys/arch/pmax/include/elf_machdep.h b/sys/arch/pmax/include/elf_machdep.h
index d93b48b6c93..6b8a56bf48e 100644
--- a/sys/arch/pmax/include/elf_machdep.h
+++ b/sys/arch/pmax/include/elf_machdep.h
@@ -1,8 +1,81 @@
-/* $NetBSD: elf_machdep.h,v 1.1 1996/09/26 21:50:59 cgd Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.2 1996/12/17 03:45:05 jonathan Exp $ */
#define ELF32_MACHDEP_ID_CASES \
+
+/*
+ * pmaxes are mipsel machines
+ */
+
+#define ELF32_MACHDEP_ENDIANNESS Elf_ed_2lsb
+
+#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
case Elf_em_mips: \
break;
#define ELF64_MACHDEP_ID_CASES \
/* no 64-bit ELF machine types supported */
+
+/* TTTTT - stuff from NetBSD mips dir */
+/* mips relocs. */
+
+#define R_MIPS_NONE 0
+#define R_MIPS_16 1
+#define R_MIPS_32 2
+#define R_MIPS_REL32 3
+#define R_MIPS_REL R_MIPS_REL32
+#define R_MIPS_26 4
+#define R_MIPS_HI16 5 /* high 16 bits of symbol value */
+#define R_MIPS_LO16 6 /* low 16 bits of symbol value */
+#define R_MIPS_GPREL16 7 /* GP-relative reference */
+#define R_MIPS_LITERAL 8 /* Reference to literal section */
+#define R_MIPS_GOT16 9 /* Reference to global offset table */
+#define R_MIPS_GOT R_MIPS_GOT16
+#define R_MIPS_PC16 10 /* 16 bit PC relative reference */
+#define R_MIPS_CALL16 11 /* 16 bit call thru glbl offset tbl */
+#define R_MIPS_CALL R_MIPS_CALL16
+#define R_MIPS_GPREL32 12
+
+/* 13, 14, 15 are not defined at this point. */
+#define R_MIPS_UNUSED1 13
+#define R_MIPS_UNUSED2 14
+#define R_MIPS_UNUSED3 15
+
+/*
+ * The remaining relocs are apparently part of the 64-bit Irix ELF ABI.
+ */
+#define R_MIPS_SHIFT5 16
+#define R_MIPS_SHIFT6 17
+
+#define R_MIPS_64 18
+#define R_MIPS_GOT_DISP 19
+#define R_MIPS_GOT_PAGE 20
+#define R_MIPS_GOT_OFST 21
+#define R_MIPS_GOT_HI16 22
+#define R_MIPS_GOT_LO16 23
+#define R_MIPS_SUB 24
+#define R_MIPS_INSERT_A 25
+#define R_MIPS_INSERT_B 26
+#define R_MIPS_DELETE 27
+#define R_MIPS_HIGHER 28
+#define R_MIPS_HIGHEST 29
+#define R_MIPS_CALL_HI16 30
+#define R_MIPS_CALL_LO16 31
+#define R_MIPS_SCN_DISP 32
+#define R_MIPS_REL16 33
+#define R_MIPS_ADD_IMMEDIATE 34
+#define R_MIPS_PJUMP 35
+#define R_MIPS_RELGOT 36
+
+#define R_MIPS_max 37
+#define R_TYPE(name) __CONCAT(R_MIPS_,name)
+
+
+/*
+ * Tell the kernel ELF exec code not to try relocating the interpreter
+ * (ld.so) for dynamically-linked ELF binaries.
+ */
+#ifdef _KERNEL
+#define ELF_INTERP_NON_RELOCATABLE
+#endif
+
+/* TTTTT - end of stuff from NetBSD mips dir */
diff --git a/sys/arch/pmax/include/fbvar.h b/sys/arch/pmax/include/fbvar.h
index 6a178238ffe..2547aab7988 100644
--- a/sys/arch/pmax/include/fbvar.h
+++ b/sys/arch/pmax/include/fbvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fbvar.h,v 1.1 1995/09/11 08:18:51 jonathan Exp $ */
+/* $NetBSD: fbvar.h,v 1.2 1997/05/24 05:49:22 jonathan Exp $ */
/*
* Copyright (c) 1992, 1993, 1995
@@ -145,7 +145,9 @@ struct fbdevice {
#define FB_INESC 0x001 /* processing an escape sequence */
#define FB_STANDOUT 0x002 /* standout mode */
-/* #define FB_BOLD 0x? /* boldface mode */
+#ifdef notyet
+# define FB_BOLD 0x? /* boldface mode */
+#endif
#define FB_INVERT 0x008 /* white on black mode */
#define FB_VISBELL 0x010 /* visual bell */
#define FB_CURSOR 0x020 /* cursor is visible */
diff --git a/sys/arch/pmax/include/locore.h b/sys/arch/pmax/include/locore.h
index e3235bfff7d..39492c6693d 100644
--- a/sys/arch/pmax/include/locore.h
+++ b/sys/arch/pmax/include/locore.h
@@ -49,6 +49,7 @@ struct user;
extern int copykstack __P((struct user *up));
extern void MachSaveCurFPState __P((struct proc *p));
extern int switch_exit __P((void)); /* XXX never really returns? */
+extern void blkclr __P((caddr_t val, int size)); /* bulk aligned bzero */
/* MIPS-generic locore functions used by trap.c */
extern void MachFPTrap __P((u_int statusReg, u_int CauseReg, u_int pc));
diff --git a/sys/arch/pmax/include/mips_param.h b/sys/arch/pmax/include/mips_param.h
index 9c3ad6736be..0a4b1947385 100644
--- a/sys/arch/pmax/include/mips_param.h
+++ b/sys/arch/pmax/include/mips_param.h
@@ -7,6 +7,7 @@
*/
#define ALIGNBYTES 7
#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0)
#define NBPG 4096 /* bytes/page */
#define PGOFSET (NBPG-1) /* byte offset into page */
diff --git a/sys/arch/pmax/include/param.h b/sys/arch/pmax/include/param.h
index 81090a088f0..db56a782c17 100644
--- a/sys/arch/pmax/include/param.h
+++ b/sys/arch/pmax/include/param.h
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.17 1996/05/20 10:50:52 jonathan Exp $ */
+/* $NetBSD: param.h,v 1.18 1997/02/26 01:45:41 jonathan Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -88,9 +88,15 @@
* of the hardware page size.
*/
#define MSIZE 128 /* size of an mbuf */
-#define MCLSHIFT 11
-#define MCLBYTES (1 << MCLSHIFT) /* enough for whole Ethernet packet */
+#ifndef MCLSHIFT
+
+# define MCLSHIFT 11 /* convert bytes to m_buf clusters */
+ /* 2K cluster can hold Ether frame */
+#endif /* MCLSHIFT */
+
+#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
#define MCLOFSET (MCLBYTES - 1)
+
#ifndef NMBCLUSTERS
#ifdef GATEWAY
#define NMBCLUSTERS 2048 /* map size, max cluster allocation */
diff --git a/sys/arch/pmax/include/pmap.h b/sys/arch/pmax/include/pmap.h
index fb948a7ed87..500cf946ed6 100644
--- a/sys/arch/pmax/include/pmap.h
+++ b/sys/arch/pmax/include/pmap.h
@@ -107,4 +107,10 @@ struct pmap kernel_pmap_store;
#define pmax_round_seg(a) mips_round_seg(a)
/* End of stuff from the NetBSD mips tree TTTTT */
+/*
+ * Bootstrap the system enough to run with virtual memory.
+ * firstaddr is the first unused kseg0 address (not page aligned).
+ */
+void pmap_bootstrap __P((vm_offset_t firstaddr));
+
#endif /* _PMAP_MACHINE_ */
diff --git a/sys/arch/pmax/include/proc.h b/sys/arch/pmax/include/proc.h
index 202d9562314..72d5cc4811b 100644
--- a/sys/arch/pmax/include/proc.h
+++ b/sys/arch/pmax/include/proc.h
@@ -51,3 +51,11 @@ struct mdproc {
/* md_flags */
#define MDP_FPUSED 0x0001 /* floating point coprocessor used */
+
+/* TTTTT - stuff from NetBSD mips dir */
+#ifdef _KERNEL
+/* kernel single-step emulation */
+struct proc;
+extern int mips_singlestep __P((struct proc *p));
+#endif /* _KERNEL */
+/* TTTTT - end of stuff from NetBSD mips dir */
diff --git a/sys/arch/pmax/include/tc_machdep.h b/sys/arch/pmax/include/tc_machdep.h
index 4afd08f4fee..40a31833858 100644
--- a/sys/arch/pmax/include/tc_machdep.h
+++ b/sys/arch/pmax/include/tc_machdep.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_machdep.h,v 1.5 1996/10/06 06:29:51 jonathan Exp $ */
+/* $NetBSD: tc_machdep.h,v 1.6 1997/05/25 05:58:36 jonathan Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -106,6 +106,6 @@ int tc_checkslot __P((tc_addr_t slotbase, char *namep));
extern int tc_findconsole __P((int preferred_slot));
extern void config_tcbus __P((struct device *parent, int cputype,
int printfn __P((void*, const char*)) ));
-
+extern int badaddr __P((void *, u_int));
#endif /* __MACHINE_TC_MACHDEP_H__*/
diff --git a/sys/arch/pmax/include/types.h b/sys/arch/pmax/include/types.h
index cab9865caa3..2d4ea03a2c4 100644
--- a/sys/arch/pmax/include/types.h
+++ b/sys/arch/pmax/include/types.h
@@ -1,6 +1,8 @@
-/* $NetBSD: types.h,v 1.12 1996/04/09 20:54:08 jonathan Exp $ */
+/* $NetBSD: types.h,v 1.13 1996/12/05 00:13:56 cgd Exp $ */
/*-
+
+#define __BROKEN_INDIRECT_CONFIG
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
diff --git a/sys/arch/pmax/pmax/autoconf.c b/sys/arch/pmax/pmax/autoconf.c
index d0e7c884dc9..6a108f39695 100644
--- a/sys/arch/pmax/pmax/autoconf.c
+++ b/sys/arch/pmax/pmax/autoconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.18 1996/10/13 03:39:44 christos Exp $ */
+/* $NetBSD: autoconf.c,v 1.24 1997/05/25 08:17:00 jonathan Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -61,6 +61,7 @@
#include <sys/device.h>
#include <machine/cpu.h>
+#include <machine/autoconf.h>
#include <pmax/dev/device.h>
#include <pmax/pmax/pmaxtype.h>
#include <pmax/pmax/turbochannel.h>
@@ -80,10 +81,6 @@ void xconsinit __P((void)); /* XXX console-init continuation */
int spl0 __P((void));
#endif
-void configure __P((void));
-void makebootdev __P((char *cp));
-
-
/*
* The following several variables are related to
diff --git a/sys/arch/pmax/pmax/conf-glue.c b/sys/arch/pmax/pmax/conf-glue.c
index 8371016d16a..9a6ef834f8d 100644
--- a/sys/arch/pmax/pmax/conf-glue.c
+++ b/sys/arch/pmax/pmax/conf-glue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: conf-glue.c,v 1.12 1996/10/13 03:39:47 christos Exp $ */
+/* $NetBSD: conf-glue.c,v 1.13 1997/05/24 09:37:45 jonathan Exp $ */
/*
* conf-glue.c:
@@ -229,7 +229,7 @@ noattach(parent, self, aux)
ca->ca_name, self->dv_unit,
parent->dv_xname);
#else
- panic("Can't do new-config attach of old device %s\n",
+ panic("Can't do new-config attach of old device %s%d\n",
ca->ca_name, self->dv_unit);
#endif
return;
diff --git a/sys/arch/pmax/pmax/conf.c b/sys/arch/pmax/pmax/conf.c
index b3fe13ce40c..5f8c5420d99 100644
--- a/sys/arch/pmax/pmax/conf.c
+++ b/sys/arch/pmax/pmax/conf.c
@@ -108,7 +108,8 @@ cdev_decl(mm);
#include "bpfilter.h"
#include "dtop.h"
cdev_decl(dtop);
-#include "dc.h"
+#include "dc_ioasic.h"
+#include "dc_ds.h"
cdev_decl(dc);
#include "scc.h"
cdev_decl(scc);
@@ -128,6 +129,11 @@ cdev_decl(xcfb);
cdev_decl(mfb);
dev_decl(filedesc,open);
+#if (NDC_DS > 0) || (NDC_IOASIC > 0)
+# define NDC 1
+#else
+# define NDC 0
+#endif
/* a framebuffer with an attached mouse: */
/* open, close, ioctl, poll, mmap */
diff --git a/sys/arch/pmax/pmax/cpu_cons.c b/sys/arch/pmax/pmax/cpu_cons.c
index 18839089813..b7c0c8953b4 100644
--- a/sys/arch/pmax/pmax/cpu_cons.c
+++ b/sys/arch/pmax/pmax/cpu_cons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_cons.c,v 1.14 1996/10/13 03:39:48 christos Exp $ */
+/* $NetBSD: cpu_cons.c,v 1.17 1997/05/24 08:19:48 jonathan Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -80,13 +80,15 @@
#include "mfb.h"
#include "xcfb.h"
#include "sfb.h"
-#include "dc.h"
+#include "dc_ds.h"
+#include "dc_ioasic.h"
#include "dtop.h"
#include "scc.h"
#include "asc.h"
#include "tc.h"
+#include "rasterconsole.h"
-#if NDC > 0
+#if (NDC_DS > 0) || (NDC_IOASIC > 0)
#include <machine/dc7085cons.h>
#include <pmax/dev/dc_cons.h>
#include <pmax/dev/dc_ds_cons.h>
@@ -209,6 +211,7 @@ consinit()
* whatever the PROM vector gave us.
*/
+#if NRASTERCONSOLE > 0
if (pmax_boardtype == DS_PMAX && kbd == 1)
screen = 1;
/*
@@ -229,7 +232,7 @@ consinit()
if (screen) {
switch (pmax_boardtype) {
case DS_PMAX:
-#if NDC > 0 && NPM > 0
+#if NDC_DS > 0 && NPM > 0
if (pminit(0, 0, 1)) {
cd.cn_pri = CN_INTERNAL;
cd.cn_dev = makedev(DCDEV, DCKBD_PORT);
@@ -238,7 +241,7 @@ consinit()
cd.cn_putc = rcons_vputc; /*XXX*/
return;
}
-#endif /* NDC and NPM */
+#endif /* NDC_DS and NPM */
goto remcons;
case DS_MAXINE:
@@ -259,13 +262,13 @@ consinit()
break;
case DS_3MAX:
-#if NDC > 0
+#if NDC_IOASIC > 0
if (kbd == 7) {
cd.cn_dev = makedev(DCDEV, DCKBD_PORT);
cd.cn_getc = LKgetc;
lk_divert(dcGetc, makedev(DCDEV, DCKBD_PORT));
} else
-#endif /* NDC */
+#endif /* NDC_IOASIC */
goto remcons;
break;
@@ -307,23 +310,25 @@ consinit()
remcons:
+#endif /* NRASTERCONSOLE > 0 */
+
/*
* Configure a serial port as a remote console.
*/
switch (pmax_boardtype) {
case DS_PMAX:
-#if NDC > 0
+#if NDC_DS > 0
if (kbd == 4)
cd.cn_dev = makedev(DCDEV, DCCOMM_PORT);
else
cd.cn_dev = makedev(DCDEV, DCPRINTER_PORT);
dc_ds_consinit(cd.cn_dev);
return;
-#endif /* NDC */
+#endif /* NDC_DS */
break;
case DS_3MAX:
-#if NDC > 0
+#if (NDC_IOASIC > 0)
cd.cn_dev = makedev(DCDEV, DCPRINTER_PORT);
dc_ioasic_consinit(cd.cn_dev);
return;
diff --git a/sys/arch/pmax/pmax/disksubr.c b/sys/arch/pmax/pmax/disksubr.c
index 29c40ee1b56..92ab45160a1 100644
--- a/sys/arch/pmax/pmax/disksubr.c
+++ b/sys/arch/pmax/pmax/disksubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.13 1996/10/13 03:39:49 christos Exp $ */
+/* $NetBSD: disksubr.c,v 1.14 1997/01/15 00:55:43 jonathan Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -46,7 +46,7 @@
#define b_cylin b_resid
#ifdef COMPAT_ULTRIX
-#include "../../stand/dec_boot.h"
+#include <pmax/stand/dec_boot.h>
extern char *
compat_label __P((dev_t dev, void (*strat) __P((struct buf *bp)),
diff --git a/sys/arch/pmax/pmax/locore.S b/sys/arch/pmax/pmax/locore.S
index ec2d9299926..65a54e85fe1 100644
--- a/sys/arch/pmax/pmax/locore.S
+++ b/sys/arch/pmax/pmax/locore.S
@@ -1028,6 +1028,88 @@ LEAF(splsoftnet)
and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
END(splsoftnet)
+/*
+ * hardware-level spls for hardware where the device interrupt priorites
+ * are ordered, and map onto mips interrupt pins in increasing priority.
+ * This maps directly onto BSD spl levels.
+ */
+
+/*
+ * Block out int2 (hardware interrupt 0) and lower mips levels.
+ */
+LEAF(cpu_spl0)
+ mfc0 v0, MACH_COP_0_STATUS_REG # read status register
+ li t0, ~(MACH_INT_MASK_SPL0)
+ and t0, t0, v0
+ mtc0 t0, MACH_COP_0_STATUS_REG # save it
+ nop # 3 ins to disable on r4x00
+ j ra
+ and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
+END(cpu_spl0)
+
+/*
+ * Block out Int3 (hardware interrupt 1) and lower mips levels.
+ */
+LEAF(cpu_spl1)
+ mfc0 v0, MACH_COP_0_STATUS_REG # read status register
+ li t0, ~(MACH_INT_MASK_SPL1)
+ and t0, t0, v0
+ mtc0 t0, MACH_COP_0_STATUS_REG # save it
+ nop # 3 ins to disable on r4x00
+ j ra
+ and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
+END(cpu_spl1)
+
+LEAF(cpu_spl2)
+ mfc0 v0, MACH_COP_0_STATUS_REG # read status register
+ li t0, ~(MACH_INT_MASK_SPL2)
+ and t0, t0, v0
+ mtc0 t0, MACH_COP_0_STATUS_REG # save it
+ nop # 3 ins to disable on r4x00
+ j ra
+ and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
+END(cpu_spl2)
+
+LEAF(cpu_spl3)
+ mfc0 v0, MACH_COP_0_STATUS_REG # read status register
+ li t0, ~(MACH_INT_MASK_SPL3)
+ and t0, t0, v0
+ mtc0 t0, MACH_COP_0_STATUS_REG # save it
+ nop # 3 ins to disable on r4x00
+ j ra
+ and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
+END(cpu_spl3)
+
+LEAF(cpu_spl4)
+ mfc0 v0, MACH_COP_0_STATUS_REG # read status register
+ li t0, ~(MACH_INT_MASK_SPL4)
+
+ and t0, t0, v0
+ mtc0 t0, MACH_COP_0_STATUS_REG # save it
+ nop # 3 ins to disable
+ j ra
+ and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
+END(cpu_spl4)
+
+LEAF(cpu_spl5)
+ mfc0 v0, MACH_COP_0_STATUS_REG # read status register
+ li t0, ~(MACH_INT_MASK_SPL5)
+ and t0, t0, v0
+ mtc0 t0, MACH_COP_0_STATUS_REG # save it
+ nop # 3 ins to disable
+ j ra
+ and v0, v0, (MACH_INT_MASK | MIPS_SR_INT_IE)
+END(cpu_spl5)
+
+/*
+ * hardware-level spls for hardware where teh interrupt priorites
+ * DO NOT map onto levels.
+ *
+ * For now, that means DEcstations that use only two distinct CPU
+ * levels, one for TOD clock interrupts, and a second for all other
+ * external devices (via an external controller.
+ * XXX the spl handling really needs re-writing from scratch.
+ */
LEAF(Mach_spl0)
mfc0 v0, MACH_COP_0_STATUS_REG # read status register
li t0, ~(MACH_INT_MASK_0|MACH_SOFT_INT_MASK_1|MACH_SOFT_INT_MASK_0)
diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c
index 715a4d82685..94ba8f7dcba 100644
--- a/sys/arch/pmax/pmax/machdep.c
+++ b/sys/arch/pmax/pmax/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.67 1996/10/23 20:04:40 mhitch Exp $ */
+/* $NetBSD: machdep.c,v 1.76 1997/05/31 20:33:30 mhitch Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -77,12 +77,12 @@
#endif
#include <vm/vm_kern.h>
+#include <ufs/mfs/mfs_extern.h> /* mfs_initminiroot() */
#include <machine/cpu.h>
#include <machine/reg.h>
#include <machine/psl.h>
#include <machine/pte.h>
-#include <machine/dc7085cons.h>
#include <pmax/stand/dec_prom.h>
@@ -100,27 +100,22 @@
#include <pmax/pmax/asic.h>
#include <pmax/pmax/turbochannel.h>
#include <pmax/pmax/pmaxtype.h>
+#include <pmax/pmax/trap.h> /* mboard-specific interrupt fns */
#include <pmax/pmax/cons.h>
-
#include "pm.h"
#include "cfb.h"
#include "mfb.h"
#include "xcfb.h"
#include "sfb.h"
-#include "dc.h"
#include "dtop.h"
#include "scc.h"
#include "le_ioasic.h"
#include "asc.h"
-#if NDTOP > 0
-#include <pmax/dev/dtopvar.h>
-#endif
-
-
extern void fbPutc();
+#if defined(DS5000_25) || defined(DS5000_100) || defined(DS5000_240)
/* Will scan from max to min, inclusive */
static int tc_max_slot = KN02_TC_MAX;
static int tc_min_slot = KN02_TC_MIN;
@@ -131,6 +126,7 @@ static u_int tc_slot_phys_base [TC_MAX_SLOTS] = {
KN02_PHYS_TC_4_START, KN02_PHYS_TC_5_START,
KN02_PHYS_TC_6_START, KN02_PHYS_TC_7_START
};
+#endif
/* the following is used externally (sysctl_hw) */
char machine[] = "pmax"; /* cpu "architecture" */
@@ -168,12 +164,7 @@ extern void (*tc_enable_interrupt) __P ((u_int slotno,
void (*tc_enable_interrupt) __P ((u_int slotno,
int (*handler) __P ((void *sc)),
void *sc, int onoff));
-extern int (*mips_hardware_intr)();
-
-int kn02_intr(), kmin_intr(), xine_intr();
-
#ifdef DS3100
-extern int kn01_intr();
void kn01_enable_intr __P ((u_int slotno,
int (*handler) __P ((intr_arg_t sc)),
intr_arg_t sc, int onoff));
@@ -183,28 +174,59 @@ void kn01_enable_intr __P ((u_int slotno,
# include <pmax/pmax/kn230var.h> /* kn230_establish_intr(), kn230_intr() */
#endif
-#ifdef DS5000_240
-int kn03_intr();
-#endif
+/*
+ * Interrupt-blocking functions defined in locore. These names aren't used
+ * directly except here and in interrupt handlers.
+ */
+
+/* Block out one hardware interrupt-enable bit. */
+extern int Mach_spl0 __P((void)), Mach_spl1 __P((void));
+extern int Mach_spl2 __P((void)), Mach_spl3 __P((void));
+
+/* Block out nested interrupt-enable bits. */
+extern int cpu_spl0 __P((void)), cpu_spl1 __P((void));
+extern int cpu_spl2 __P((void)), cpu_spl3 __P((void));
+extern int splhigh __P((void));
+
+/*
+ * Instead, we declare the standard splXXX names as function pointers,
+ * and initialie them to point to the above functions to match
+ * the way a specific motherboard is wired up.
+ */
+int (*Mach_splbio) __P((void)) = splhigh;
+int (*Mach_splnet)__P((void)) = splhigh;
+int (*Mach_spltty)__P((void)) = splhigh;
+int (*Mach_splimp)__P((void)) = splhigh;
+int (*Mach_splclock)__P((void)) = splhigh;
+int (*Mach_splstatclock)__P((void)) = splhigh;
-extern int Mach_spl0(), Mach_spl1(), Mach_spl2(), Mach_spl3(), splhigh();
-int (*Mach_splbio)() = splhigh;
-int (*Mach_splnet)() = splhigh;
-int (*Mach_spltty)() = splhigh;
-int (*Mach_splimp)() = splhigh;
-int (*Mach_splclock)() = splhigh;
-int (*Mach_splstatclock)() = splhigh;
extern volatile struct chiptime *Mach_clock_addr;
u_long kmin_tc3_imask, xine_tc3_imask;
+int savectx __P((struct user *up)); /* XXX save state b4 crash*/
+
+
+tc_option_t tc_slot_info[TC_MAX_LOGICAL_SLOTS];
+
+
+/*
+ * Local functions.
+ */
+#ifdef DS5000_240 /* XXX */
+static void asic_init __P((int isa_maxine));
+#endif
+extern int atoi __P((const char *cp));
+int initcpu __P((void));
#ifdef DS5000_240
-u_long kn03_tc3_imask;
-extern u_long latched_cycle_cnt;
+static u_long clkread __P((void)); /* get usec-resolution clock */
#endif
+void dumpsys __P((void)); /* do a dump */
+
+/* initialize bss, etc. from kernel start, before main() is called. */
+extern void
+mach_init __P((int argc, char *argv[], u_int code,
+ const struct callback *cv));
-tc_option_t tc_slot_info[TC_MAX_LOGICAL_SLOTS];
-static void asic_init();
-extern void RemconsInit();
#ifdef DS5000_200
void kn02_enable_intr __P ((u_int slotno,
@@ -223,6 +245,9 @@ void xine_enable_intr __P ((u_int slotno, int (*handler) (intr_arg_t sc),
#endif /*DS5000_25*/
#ifdef DS5000_240
+u_long kn03_tc3_imask;
+extern u_long latched_cycle_cnt;
+void kn03_tc_reset __P((void)); /* XXX unused? */
void kn03_enable_intr __P ((u_int slotno, int (*handler) (intr_arg_t sc),
intr_arg_t sc, int onoff));
#endif /*DS5000_240*/
@@ -235,6 +260,11 @@ volatile u_int *Mach_reset_addr;
void prom_halt __P((int, char *)) __attribute__((__noreturn__));
+#ifdef DEBUG
+/* stacktrace code violates prototypes to get callee's registers */
+extern void stacktrace __P((void)); /*XXX*/
+#endif
+
/*
* safepri is a safe priority for sleep to set for a spin-wait
@@ -245,6 +275,15 @@ int safepri = PSL_LOWIPL;
struct user *proc0paddr;
struct proc nullproc; /* for use by swtch_exit() */
+
+/*
+ * XXX locore callback-vector setup should be done via mips_vector_init()
+ * using CPU-family information, but that doesn't work yet, so for now we
+ * explicitly call the mips1 setup function.
+ */
+extern void mips1_vector_init __P((void));
+
+
/*
* Do all the stuff that locore normally does before calling main().
* Process arguments passed to us by the prom monitor.
@@ -263,8 +302,6 @@ mach_init(argc, argv, code, cv)
register caddr_t v;
caddr_t start;
extern char edata[], end[];
- extern char MachUTLBMiss[], MachUTLBMissEnd[];
- extern char mips_R2000_exception[], mips_R2000_exceptionEnd[];
/* clear the BSS segment */
v = (caddr_t)mips_round_page(end);
@@ -387,7 +424,8 @@ mach_init(argc, argv, code, cv)
i = (*cv->_getsysid)();
cp = "";
} else {
- if (cp = (*callv->_getenv)("systype"))
+ cp = (*callv->_getenv)("systype");
+ if (cp)
i = atoi(cp);
else {
cp = "";
@@ -418,12 +456,13 @@ mach_init(argc, argv, code, cv)
*/
mips_hardware_intr = kn01_intr;
tc_enable_interrupt = kn01_enable_intr; /*XXX*/
- Mach_splbio = Mach_spl0;
- Mach_splnet = Mach_spl1;
- Mach_spltty = Mach_spl2;
+ Mach_splbio = cpu_spl0;
+ Mach_splnet = cpu_spl1;
+ Mach_spltty = cpu_spl2;
Mach_splimp = splhigh; /*XXX Mach_spl1(), if not for malloc()*/
- Mach_splclock = Mach_spl3;
- Mach_splstatclock = Mach_spl3;
+ Mach_splclock = cpu_spl3;
+ Mach_splstatclock = cpu_spl3;
+
Mach_clock_addr = (volatile struct chiptime *)
MACH_PHYS_TO_UNCACHED(KN01_SYS_CLOCK);
strcpy(cpu_model, "3100");
@@ -475,8 +514,8 @@ mach_init(argc, argv, code, cv)
Mach_splnet = Mach_spl0;
Mach_spltty = Mach_spl0;
Mach_splimp = Mach_spl0;
- Mach_splclock = Mach_spl1;
- Mach_splstatclock = Mach_spl1;
+ Mach_splclock = cpu_spl1;
+ Mach_splstatclock = cpu_spl1;
Mach_clock_addr = (volatile struct chiptime *)
MACH_PHYS_TO_UNCACHED(KN02_SYS_CLOCK);
@@ -552,12 +591,24 @@ mach_init(argc, argv, code, cv)
ioasic_base = MACH_PHYS_TO_UNCACHED(XINE_SYS_ASIC);
mips_hardware_intr = xine_intr;
tc_enable_interrupt = xine_enable_intr;
+
+ /* On the MAXINE ioasic interrupts at level 3. */
Mach_splbio = Mach_spl3;
Mach_splnet = Mach_spl3;
Mach_spltty = Mach_spl3;
Mach_splimp = Mach_spl3;
- Mach_splclock = Mach_spl1;
- Mach_splstatclock = Mach_spl1;
+
+ /*
+ * Note priority inversion of ioasic and clock:
+ * clock interrupts are at hw priority 1, and when blocking
+ * clock interrups we we must block hw priority 3
+ * (bio,net,tty) also.
+ *
+ * XXX hw priority 2 is used for memory errors, we
+ * should not disable memory errors during clock interrupts!
+ */
+ Mach_splclock = cpu_spl3;
+ Mach_splstatclock = cpu_spl3;
Mach_clock_addr = (volatile struct chiptime *)
MACH_PHYS_TO_UNCACHED(XINE_SYS_CLOCK);
@@ -591,13 +642,16 @@ mach_init(argc, argv, code, cv)
/*
* Reset interrupts, clear any errors from newconf probes
*/
-
Mach_splbio = Mach_spl0;
Mach_splnet = Mach_spl0;
Mach_spltty = Mach_spl0;
- Mach_splimp = Mach_spl0;
- Mach_splclock = Mach_spl1;
- Mach_splstatclock = Mach_spl1;
+ Mach_splimp = Mach_spl0; /* XXX */
+ /*
+ * Clock interrupts at hw priority 1 must block bio,net,tty
+ * at hw priority 0.
+ */
+ Mach_splclock = cpu_spl1;
+ Mach_splstatclock = cpu_spl1;
Mach_clock_addr = (volatile struct chiptime *)
MACH_PHYS_TO_UNCACHED(KN03_SYS_CLOCK);
@@ -774,7 +828,6 @@ mach_init(argc, argv, code, cv)
* Initialize the virtual memory system.
*/
pmap_bootstrap((vm_offset_t)v);
-
}
@@ -787,7 +840,6 @@ void
cpu_startup()
{
register unsigned i;
- register caddr_t v;
int base, residual;
vm_offset_t minaddr, maxaddr;
vm_size_t size;
@@ -853,12 +905,8 @@ cpu_startup()
VM_PHYS_SIZE, TRUE);
/*
- * Finally, allocate mbuf pool. Since mclrefcnt is an off-size
- * we use the more space efficient malloc in place of kmem_alloc.
+ * Finally, allocate mbuf cluster submap.
*/
- mclrefcnt = (char *)malloc(NMBCLUSTERS+CLBYTES/MCLBYTES,
- M_MBUF, M_NOWAIT);
- bzero(mclrefcnt, NMBCLUSTERS+CLBYTES/MCLBYTES);
mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr,
VM_MBUF_SIZE, FALSE);
/*
@@ -872,7 +920,7 @@ cpu_startup()
#ifdef DEBUG
pmapdebug = opmapdebug;
#endif
- printf("avail mem = %d\n", ptoa(cnt.v_free_count));
+ printf("avail mem = %ld\n", ptoa(cnt.v_free_count));
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
@@ -892,9 +940,11 @@ cpu_startup()
configure();
}
+
/*
* machine dependent system variables.
*/
+int
cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int *name;
u_int namelen;
@@ -919,6 +969,7 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
/* NOTREACHED */
}
+
/*
* Set registers on exec.
* Clear all registers except sp, pc, and t9.
@@ -940,7 +991,7 @@ setregs(p, pack, stack, retval)
p->p_md.md_regs[PC] = pack->ep_entry & ~3;
p->p_md.md_regs[T9] = pack->ep_entry & ~3; /* abicall requirement */
p->p_md.md_regs[PS] = PSL_USERSET;
- p->p_md.md_flags & ~MDP_FPUSED;
+ p->p_md.md_flags &= ~MDP_FPUSED;
if (machFPCurProcPtr == p)
machFPCurProcPtr = (struct proc *)0;
}
@@ -1009,8 +1060,8 @@ sendsig(catcher, sig, mask, code, type, val)
(void)grow(p, (unsigned)fp);
#ifdef DEBUG
if ((sigdebug & SDB_FOLLOW) ||
- (sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
- printf("sendsig(%d): sig %d ssp %x usp %x scp %x\n",
+ ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid))
+ printf("sendsig(%d): sig %d ssp %p usp %p scp %p\n",
p->p_pid, sig, &oonstack, fp, &fp->sf_sc);
#endif
/*
@@ -1074,7 +1125,7 @@ bail:
regs[RA] = (int)PS_STRINGS - (esigcode - sigcode);
#ifdef DEBUG
if ((sigdebug & SDB_FOLLOW) ||
- (sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
+ ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid))
printf("sendsig(%d): sig %d returns\n",
p->p_pid, sig);
#endif
@@ -1108,7 +1159,7 @@ sys_sigreturn(p, v, retval)
scp = SCARG(uap, sigcntxp);
#ifdef DEBUG
if (sigdebug & SDB_FOLLOW)
- printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp);
+ printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
#endif
regs = p->p_md.md_regs;
/*
@@ -1119,7 +1170,7 @@ sys_sigreturn(p, v, retval)
if (error || ksc.sc_regs[ZERO] != 0xACEDBADE) {
#ifdef DEBUG
if (!(sigdebug & SDB_FOLLOW))
- printf("sigreturn: pid %d, scp %x\n", p->p_pid, scp);
+ printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
printf(" old sp %x ra %x pc %x\n",
regs[SP], regs[RA], regs[PC]);
printf(" new sp %x ra %x pc %x err %d z %x\n",
@@ -1149,7 +1200,7 @@ sys_sigreturn(p, v, retval)
}
int waittime = -1;
-struct pcb dumppcb;
+struct user dumppcb; /* Actually, struct pcb would do. */
/*
@@ -1191,7 +1242,7 @@ dumpsys()
int error;
/* Save registers. */
- savectx(&dumppcb, 0);
+ savectx(&dumppcb);
msgbufmapped = 0;
if (dumpdev == NODEV)
@@ -1204,7 +1255,7 @@ dumpsys()
dumpconf();
if (dumplo < 0)
return;
- printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo);
+ printf("\ndumping to dev %x, offset %ld\n", dumpdev, dumplo);
printf("dump ");
/*
* XXX
@@ -1256,11 +1307,13 @@ prom_halt(howto, bootstr)
(*callv->_rex)('b');
}
} else if (howto & RB_HALT) {
- volatile void (*f)() = (volatile void (*)())DEC_PROM_REINIT;
+ volatile void (*f) __P((void)) =
+ (volatile void (*) __P((void))) DEC_PROM_REINIT;
(*f)(); /* jump back to prom monitor */
} else {
- volatile void (*f)() = (volatile void (*)())DEC_PROM_AUTOBOOT;
+ volatile void (*f) __P((void)) =
+ (volatile void (*) __P((void)))DEC_PROM_AUTOBOOT;
(*f)(); /* jump back to prom monitor and do 'auto' cmd */
}
@@ -1276,7 +1329,7 @@ boot(howto)
/* take a snap shot before clobbering any registers */
if (curproc)
- savectx(curproc->p_addr, 0);
+ savectx(curproc->p_addr);
#ifdef DEBUG
if (panicstr)
@@ -1324,10 +1377,11 @@ boot(howto)
#endif
dumpsys();
+haltsys:
+
/* run any shutdown hooks */
doshutdownhooks();
-haltsys:
/* Finally, halt/reboot the system. */
printf("%s\n\n", howto & RB_HALT ? "halted." : "rebooting...");
@@ -1423,8 +1477,6 @@ microtime(tvp)
{
int s = splclock();
static struct timeval lasttime;
- register long usec;
-
*tvp = time;
tvp->tv_usec += clkread();
@@ -1447,7 +1499,7 @@ int
initcpu()
{
register volatile struct chiptime *c;
- int i;
+ int i = 0;
#if defined(DS5000_200) || defined(DS5000_25) || defined(DS5000_100) || \
defined(DS5000_240)
@@ -1496,7 +1548,7 @@ initcpu()
*/
int
atoi(s)
- char *s;
+ const char *s;
{
int c;
unsigned base = 10, d;
@@ -1684,7 +1736,7 @@ kmin_enable_intr(slotno, handler, sc, on)
}
#if defined(DEBUG) || defined(DIAGNOSTIC)
- printf("3MIN: imask %x, %sabling slot %d, sc %x addr 0x%x\n",
+ printf("3MIN: imask %lx, %sabling slot %d, sc %p handler %p\n",
kmin_tc3_imask, (on? "en" : "dis"), slotno, sc, handler);
#endif
@@ -1888,6 +1940,7 @@ done:
#endif /* DS5000_240 */
+#ifdef DS5000_240 /* XXX */
/*
* Initialize the I/O asic
*/
@@ -1905,3 +1958,4 @@ asic_init(isa_maxine)
decoder = (volatile u_int *) IOASIC_REG_SCSI_DECODE(ioasic_base);
(*decoder) = 0x00000000e;
}
+#endif /* DS5000_240 XXX */
diff --git a/sys/arch/pmax/pmax/mem.c b/sys/arch/pmax/pmax/mem.c
index c1d99888c86..b41fb945532 100644
--- a/sys/arch/pmax/pmax/mem.c
+++ b/sys/arch/pmax/pmax/mem.c
@@ -52,6 +52,7 @@
#include <sys/malloc.h>
#include <sys/msgbuf.h>
+#include <pmax/conf.h>
#include <machine/cpu.h>
#include <vm/vm.h>
@@ -61,9 +62,10 @@ caddr_t zeropage;
/*ARGSUSED*/
int
-mmopen(dev, flag, mode)
+mmopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
+ struct proc *p;
{
return (0);
@@ -71,9 +73,10 @@ mmopen(dev, flag, mode)
/*ARGSUSED*/
int
-mmclose(dev, flag, mode)
+mmclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
+ struct proc *p;
{
return (0);
@@ -86,7 +89,7 @@ mmrw(dev, uio, flags)
struct uio *uio;
int flags;
{
- register vm_offset_t o, v;
+ register vm_offset_t v;
register int c;
register struct iovec *iov;
int error = 0;
diff --git a/sys/arch/pmax/pmax/pmap.c b/sys/arch/pmax/pmax/pmap.c
index 46b0b1e95c8..5bcb7e0882f 100644
--- a/sys/arch/pmax/pmax/pmap.c
+++ b/sys/arch/pmax/pmax/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.13 1996/10/13 03:39:53 christos Exp $ */
+/* $NetBSD: pmap.c,v 1.17 1997/05/26 23:02:11 jonathan Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -98,7 +98,6 @@ typedef struct pv_entry {
} *pv_entry_t;
pv_entry_t pv_table; /* array of entries, one per page */
-extern void pmap_remove_pv();
#define pa_index(pa) atop((pa) - first_phys_addr)
#define pa_to_pvh(pa) (&pv_table[pa_index(pa)])
@@ -153,7 +152,7 @@ vm_offset_t avail_end; /* PA of last available physical page */
vm_size_t mem_size; /* memory size in bytes */
vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss)*/
vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */
-int pmaxpagesperpage; /* PAGE_SIZE / NBPG */
+int mipspagesperpage; /* PAGE_SIZE / NBPG */
#ifdef ATTR
char *pmap_attributes; /* reference and modify bits */
#endif
@@ -163,6 +162,13 @@ int tlbpid_cnt = 2; /* next available TLB PID */
pt_entry_t *Sysmap; /* kernel pte table */
u_int Sysmapsize; /* number of pte's in Sysmap */
+
+/* Forward function declarations */
+void pmap_remove_pv __P((pmap_t pmap, vm_offset_t va, vm_offset_t pa));
+int pmap_alloc_tlbpid __P((register struct proc *p));
+void pmap_zero_page __P((vm_offset_t phys));
+
+
/*
* Bootstrap the system enough to run with virtual memory.
* firstaddr is the first unused kseg0 address (not page aligned).
@@ -215,7 +221,7 @@ pmap_bootstrap(firstaddr)
virtual_avail = VM_MIN_KERNEL_ADDRESS;
virtual_end = VM_MIN_KERNEL_ADDRESS + Sysmapsize * NBPG;
/* XXX need to decide how to set cnt.v_page_size */
- pmaxpagesperpage = 1;
+ mipspagesperpage = 1;
simple_lock_init(&pmap_kernel()->pm_lock);
pmap_kernel()->pm_count = 1;
@@ -262,7 +268,7 @@ pmap_init(phys_start, phys_end)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_INIT))
- printf("pmap_init(%x, %x)\n", phys_start, phys_end);
+ printf("pmap_init(%lx, %lx)\n", phys_start, phys_end);
#endif
}
@@ -286,7 +292,7 @@ pmap_create(size)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
- printf("pmap_create(%x)\n", size);
+ printf("pmap_create(%lx)\n", size);
#endif
/*
* Software use map does not need a pmap
@@ -320,7 +326,7 @@ pmap_pinit(pmap)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
- printf("pmap_pinit(%x)\n", pmap);
+ printf("pmap_pinit(%p)\n", pmap);
#endif
simple_lock_init(&pmap->pm_lock);
pmap->pm_count = 1;
@@ -333,13 +339,12 @@ pmap_pinit(pmap)
} else {
register struct segtab *stp;
vm_page_t mem;
- void pmap_zero_page();
mem = vm_page_alloc1();
pmap_zero_page(VM_PAGE_TO_PHYS(mem));
pmap->pm_segtab = stp = (struct segtab *)
MACH_PHYS_TO_CACHED(VM_PAGE_TO_PHYS(mem));
- i = pmaxpagesperpage * (NBPG / sizeof(struct segtab));
+ i = mipspagesperpage * (NBPG / sizeof(struct segtab));
s = splimp();
while (--i != 0) {
stp++;
@@ -353,7 +358,7 @@ pmap_pinit(pmap)
if (pmap->pm_segtab->seg_tab[i] != 0)
panic("pmap_pinit: pm_segtab != 0");
#endif
- if (pmap == &vmspace0.vm_pmap) {
+ if (pmap == vmspace0.vm_map.pmap) {
/*
* The initial process has already been allocated a TLBPID
* in mach_init().
@@ -380,7 +385,7 @@ pmap_destroy(pmap)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
- printf("pmap_destroy(%x)\n", pmap);
+ printf("pmap_destroy(%p)\n", pmap);
#endif
if (pmap == NULL)
return;
@@ -406,7 +411,7 @@ pmap_release(pmap)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
- printf("pmap_release(%x)\n", pmap);
+ printf("pmap_release(%p)\n", pmap);
#endif
if (pmap->pm_segtab) {
@@ -450,7 +455,7 @@ pmap_reference(pmap)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_reference(%x)\n", pmap);
+ printf("pmap_reference(%p)\n", pmap);
#endif
if (pmap != NULL) {
simple_lock(&pmap->pm_lock);
@@ -476,7 +481,7 @@ pmap_remove(pmap, sva, eva)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT))
- printf("pmap_remove(%x, %x, %x)\n", pmap, sva, eva);
+ printf("pmap_remove(%p, %lx, %lx)\n", pmap, sva, eva);
remove_stats.calls++;
#endif
if (pmap == NULL)
@@ -576,8 +581,8 @@ pmap_page_protect(pa, prot)
#ifdef DEBUG
if ((pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) ||
- prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE))
- printf("pmap_page_protect(%x, %x)\n", pa, prot);
+ (prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE)))
+ printf("pmap_page_protect(%lx, %x)\n", pa, prot);
#endif
if (!IS_VM_PHYSADDR(pa))
return;
@@ -642,7 +647,8 @@ pmap_protect(pmap, sva, eva, prot)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT))
- printf("pmap_protect(%x, %x, %x, %x)\n", pmap, sva, eva, prot);
+ printf("pmap_protect(%p, %lx, %lx, %x)\n",
+ pmap, sva, eva, prot);
#endif
if (pmap == NULL)
return;
@@ -814,12 +820,12 @@ pmap_enter(pmap, va, pa, prot, wired)
{
register pt_entry_t *pte;
register u_int npte;
- register int i, j;
+ register int i;
vm_page_t mem;
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
- printf("pmap_enter(%x, %x, %x, %x, %x)\n",
+ printf("pmap_enter(%p, %lx, %lx, %x, %x)\n",
pmap, va, pa, prot, wired);
#endif
#ifdef DIAGNOSTIC
@@ -880,7 +886,7 @@ pmap_enter(pmap, va, pa, prot, wired)
s = splimp();
#ifdef DEBUG
if (pmapdebug & PDB_ENTER)
- printf("pmap_enter: pv %x: was %x/%x/%x\n",
+ printf("pmap_enter: pv %p: was %lx/%p/%p\n",
pv, pv->pv_va, pv->pv_pmap, pv->pv_next);
#endif
if (pv->pv_pmap == NULL) {
@@ -889,7 +895,7 @@ pmap_enter(pmap, va, pa, prot, wired)
*/
#ifdef DEBUG
if (pmapdebug & PDB_PVENTRY)
- printf("pmap_enter: first pv: pmap %x va %x\n",
+ printf("pmap_enter: first pv: pmap %p va %lx\n",
pmap, va);
enter_stats.firstpv++;
#endif
@@ -930,7 +936,7 @@ pmap_enter(pmap, va, pa, prot, wired)
}
#ifdef DEBUG
if (pmapdebug & PDB_PVENTRY)
- printf("pmap_enter: new pv: pmap %x va %x\n",
+ printf("pmap_enter: new pv: pmap %p va %lx\n",
pmap, va);
#endif
/* can this cause us to recurse forever? */
@@ -975,10 +981,10 @@ pmap_enter(pmap, va, pa, prot, wired)
pte = kvtopte(va);
npte |= pa | PG_V | PG_G;
if (wired) {
- pmap->pm_stats.wired_count += pmaxpagesperpage;
+ pmap->pm_stats.wired_count += mipspagesperpage;
npte |= PG_WIRED;
}
- i = pmaxpagesperpage;
+ i = mipspagesperpage;
do {
if (!(pte->pt_entry & PG_V)) {
pmap->pm_stats.resident_count++;
@@ -1015,7 +1021,7 @@ pmap_enter(pmap, va, pa, prot, wired)
*/
npte |= pa | PG_V;
if (wired) {
- pmap->pm_stats.wired_count += pmaxpagesperpage;
+ pmap->pm_stats.wired_count += mipspagesperpage;
npte |= PG_WIRED;
}
#ifdef DEBUG
@@ -1026,7 +1032,7 @@ pmap_enter(pmap, va, pa, prot, wired)
printf("\n");
}
#endif
- i = pmaxpagesperpage;
+ i = mipspagesperpage;
do {
pte->pt_entry = npte;
if (pmap->pm_tlbgen == tlbpid_gen)
@@ -1057,7 +1063,7 @@ pmap_change_wiring(pmap, va, wired)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_WIRING))
- printf("pmap_change_wiring(%x, %x, %x)\n", pmap, va, wired);
+ printf("pmap_change_wiring(%p, %lx, %x)\n", pmap, va, wired);
#endif
if (pmap == NULL)
return;
@@ -1080,7 +1086,7 @@ pmap_change_wiring(pmap, va, wired)
pte += (va >> PGSHIFT) & (NPTEPG - 1);
}
- i = pmaxpagesperpage;
+ i = mipspagesperpage;
if (!(pte->pt_entry & PG_WIRED) && p)
pmap->pm_stats.wired_count += i;
else if ((pte->pt_entry & PG_WIRED) && !p)
@@ -1107,7 +1113,7 @@ pmap_extract(pmap, va)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_extract(%x, %x) -> ", pmap, va);
+ printf("pmap_extract(%p, %lx) -> ", pmap, va);
#endif
if (!pmap->pm_segtab) {
@@ -1131,7 +1137,7 @@ pmap_extract(pmap, va)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_extract: pa %x\n", pa);
+ printf("pmap_extract: pa %lx\n", pa);
#endif
return (pa);
}
@@ -1154,7 +1160,7 @@ pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_copy(%x, %x, %x, %x, %x)\n",
+ printf("pmap_copy(%p, %p, %lx, %lx, %lx)\n",
dst_pmap, src_pmap, dst_addr, len, src_addr);
#endif
}
@@ -1195,7 +1201,7 @@ pmap_collect(pmap)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_collect(%x)\n", pmap);
+ printf("pmap_collect(%p)\n", pmap);
#endif
}
@@ -1211,10 +1217,11 @@ pmap_zero_page(phys)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_zero_page(%x)\n", phys);
+ printf("pmap_zero_page(%lx)\n", phys);
#endif
p = (int *)MACH_PHYS_TO_CACHED(phys);
end = p + PAGE_SIZE / sizeof(int);
+ /* XXX blkclr()? */
do {
p[0] = 0;
p[1] = 0;
@@ -1237,7 +1244,7 @@ pmap_copy_page(src, dst)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_copy_page(%x, %x)\n", src, dst);
+ printf("pmap_copy_page(%lx, %lx)\n", src, dst);
#endif
s = (int *)MACH_PHYS_TO_CACHED(src);
d = (int *)MACH_PHYS_TO_CACHED(dst);
@@ -1279,7 +1286,7 @@ pmap_pageable(pmap, sva, eva, pageable)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_pageable(%x, %x, %x, %x)\n",
+ printf("pmap_pageable(%p, %lx, %lx, %x)\n",
pmap, sva, eva, pageable);
#endif
}
@@ -1294,7 +1301,7 @@ pmap_clear_modify(pa)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_clear_modify(%x)\n", pa);
+ printf("pmap_clear_modify(%lx)\n", pa);
#endif
#ifdef ATTR
pmap_attributes[atop(pa)] &= ~PMAP_ATTR_MOD;
@@ -1313,7 +1320,7 @@ pmap_clear_reference(pa)
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
- printf("pmap_clear_reference(%x)\n", pa);
+ printf("pmap_clear_reference(%lx)\n", pa);
#endif
#ifdef ATTR
pmap_attributes[atop(pa)] &= ~PMAP_ATTR_REF;
@@ -1386,7 +1393,7 @@ pmap_alloc_tlbpid(p)
register pmap_t pmap;
register int id;
- pmap = &p->p_vmspace->vm_pmap;
+ pmap = p->p_vmspace->vm_map.pmap;
if (pmap->pm_tlbgen != tlbpid_gen) {
id = tlbpid_cnt;
if (id == VMMACH_NUM_PIDS) {
@@ -1409,7 +1416,7 @@ pmap_alloc_tlbpid(p)
curproc->p_pid, curproc->p_comm);
else
printf("pmap_alloc_tlbpid: curproc <none> ");
- printf("segtab %x tlbpid %d pid %d '%s'\n",
+ printf("segtab %p tlbpid %d pid %d '%s'\n",
pmap->pm_segtab, id, p->p_pid, p->p_comm);
}
#endif
@@ -1429,7 +1436,7 @@ pmap_remove_pv(pmap, va, pa)
#ifdef DEBUG
if (pmapdebug & (PDB_FOLLOW|PDB_PVENTRY))
- printf("pmap_remove_pv(%x, %x, %x)\n", pmap, va, pa);
+ printf("pmap_remove_pv(%p, %lx, %lx)\n", pmap, va, pa);
#endif
/*
* Remove page from the PV table (raise IPL since we
diff --git a/sys/arch/pmax/pmax/pmax_trap.c b/sys/arch/pmax/pmax/pmax_trap.c
index e6300d3bc53..86968c3d611 100644
--- a/sys/arch/pmax/pmax/pmax_trap.c
+++ b/sys/arch/pmax/pmax/pmax_trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmax_trap.c,v 1.39 1996/10/13 03:39:54 christos Exp $ */
+/* $NetBSD: pmax_trap.c,v 1.44 1997/05/31 20:33:35 mhitch Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -84,13 +84,13 @@
#include <net/if.h>
#include <netinet/if_ether.h>
-struct ifnet; struct arpcom;
+struct ifnet; struct ethercom;
#include <dev/ic/am7990var.h> /* Lance interrupt for kn01 */
#include "asc.h"
#include "sii.h"
#include "le_pmax.h"
-#include "dc.h"
+#include "dc_ds.h"
#include <sys/cdefs.h>
#include <sys/syslog.h>
@@ -110,7 +110,10 @@ struct proc *machFPCurProcPtr; /* pointer to last proc to use FP */
+#ifdef DS3100
static void pmax_errintr __P((void));
+#endif
+
static void kn02_errintr __P((void)), kn02ba_errintr __P((void));
#ifdef DS5000_240
@@ -175,7 +178,7 @@ int leintr __P((void *));
#if NSII > 0
int siiintr __P((void *));
#endif
-#if NDC > 0
+#if NDC_DS > 0
int dcintr __P((void *));
#endif
@@ -204,11 +207,12 @@ kn01_intr(mask, pc, statusReg, causeReg)
hardclock(&cf);
intrcnt[HARDCLOCK]++;
- /* keep clock interrupts enabled */
+ /* keep clock interrupts enabled when we return */
causeReg &= ~MACH_INT_MASK_3;
}
- /* Re-enable clock interrupts ASAP*/
- splx(MACH_INT_MASK_3 | MACH_SR_INT_ENA_CUR);
+
+ /* If clock interrupts were enabled, re-enable them ASAP. */
+ splx(MACH_SR_INT_ENA_CUR | (statusReg & MACH_INT_MASK_3));
#if NSII > 0
if (mask & MACH_INT_MASK_0) {
@@ -230,12 +234,12 @@ kn01_intr(mask, pc, statusReg, causeReg)
}
#endif /* NLE_PMAX */
-#if NDC > 0
+#if NDC_DS > 0
if (mask & MACH_INT_MASK_2) {
dcintr(dc_cd.cd_devs[0]);
intrcnt[SERIAL0_INTR]++;
}
-#endif /* NDC */
+#endif /* NDC_DS */
if (mask & MACH_INT_MASK_4) {
pmax_errintr();
@@ -282,11 +286,13 @@ kn02_intr(mask, pc, statusReg, causeReg)
hardclock(&cf);
intrcnt[HARDCLOCK]++;
- /* keep clock interrupts enabled */
+ /* keep clock interrupts enabled when we return */
causeReg &= ~MACH_INT_MASK_1;
}
- /* Re-enable clock interrupts */
- splx(MACH_INT_MASK_1 | MACH_SR_INT_ENA_CUR);
+
+ /* If clock interrups were enabled, re-enable them ASAP. */
+ splx(MACH_SR_INT_ENA_CUR | (statusReg & MACH_INT_MASK_1));
+
if (mask & MACH_INT_MASK_0) {
static int intr_map[8] = { SLOT0_INTR, SLOT1_INTR, SLOT2_INTR,
/* these two bits reserved */
@@ -476,10 +482,12 @@ xine_intr(mask, pc, statusReg, causeReg)
cf.sr = statusReg;
hardclock(&cf);
intrcnt[HARDCLOCK]++;
+ /* keep clock interrupts enabled when we return */
causeReg &= ~MACH_INT_MASK_1;
}
- /* reenable clock interrupts */
- splx(MACH_INT_MASK_1 | MACH_SR_INT_ENA_CUR);
+
+ /* If clock interrups were enabled, re-enable them ASAP. */
+ splx(MACH_SR_INT_ENA_CUR | (statusReg & MACH_INT_MASK_1));
if (mask & MACH_INT_MASK_3) {
intr = *intrp;
@@ -616,10 +624,12 @@ kn03_intr(mask, pc, statusReg, causeReg)
hardclock(&cf);
intrcnt[HARDCLOCK]++;
old_buscycle = latched_cycle_cnt - old_buscycle;
+ /* keep clock interrupts enabled when we return */
causeReg &= ~MACH_INT_MASK_1;
}
- /* reenable clock interrupts */
- splx(MACH_INT_MASK_1 | MACH_SR_INT_ENA_CUR);
+
+ /* If clock interrups were enabled, re-enable them ASAP. */
+ splx(MACH_SR_INT_ENA_CUR | (statusReg & MACH_INT_MASK_1));
/*
* Check for late clock interrupts (allow 10% slop). Be careful
diff --git a/sys/arch/pmax/pmax/process_machdep.c b/sys/arch/pmax/pmax/process_machdep.c
index ef3ba42520a..a9124f6e224 100644
--- a/sys/arch/pmax/pmax/process_machdep.c
+++ b/sys/arch/pmax/pmax/process_machdep.c
@@ -102,9 +102,9 @@ int
process_sstep(p, sstep)
struct proc *p;
{
- /* XXX correct semantics: sstep once or forevermore? */
+ /* XXX what are the correct semantics: sstep once, or forevermore? */
if(sstep)
- cpu_singlestep(p);
+ mips_singlestep(p);
return (0);
}
diff --git a/sys/arch/pmax/pmax/trap.c b/sys/arch/pmax/pmax/trap.c
index 88ba03e83dc..e59dfc99cc3 100644
--- a/sys/arch/pmax/pmax/trap.c
+++ b/sys/arch/pmax/pmax/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.50 1996/10/13 21:37:49 jonathan Exp $ */
+/* $NetBSD: trap.c,v 1.55 1997/05/25 10:01:38 jonathan Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -346,6 +346,8 @@ extern void MachSwitchFPState __P((struct proc *from, struct user *to));
/* only called by locore */
extern u_int trap __P((u_int status, u_int cause, u_int vaddr, u_int pc,
int args));
+extern void interrupt __P((u_int status, u_int cause, u_int pc));
+extern void softintr __P((unsigned statusReg, unsigned pc));
#ifdef DEBUG /* stack trace code, also useful to DDB one day */
@@ -1044,7 +1046,7 @@ interrupt(statusReg, causeReg, pc /* XXX what, args */ )
/* process network interrupt if we trapped or will very soon */
/* XXX fixme: operator precedence botch? */
if ((mask & MACH_SOFT_INT_MASK_1) ||
- netisr && (statusReg & MACH_SOFT_INT_MASK_1)) {
+ (netisr && (statusReg & MACH_SOFT_INT_MASK_1))) {
clearsoftnet();
cnt.v_soft++;
intrcnt[SOFTNET_INTR]++;
@@ -1325,7 +1327,7 @@ MachEmulateBranch(regsPtr, instPC, fpcCSR, allowNonBranch)
* resuming execution, and then restoring the old instruction.
*/
int
-cpu_singlestep(p)
+mips_singlestep(p)
register struct proc *p;
{
register unsigned va;
diff --git a/sys/arch/pmax/pmax/trap.h b/sys/arch/pmax/pmax/trap.h
index 6637cb863df..b6176ed2d34 100644
--- a/sys/arch/pmax/pmax/trap.h
+++ b/sys/arch/pmax/pmax/trap.h
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.h,v 1.1 1995/08/28 20:01:34 jonathan Exp $ */
+/* $NetBSD: trap.h,v 1.2 1997/05/25 05:01:51 jonathan Exp $ */
/*
* Copyright (c) 1995, Jonathan Stone
@@ -33,7 +33,7 @@
/*
* Functions defined in trap.c, used in machdep.c and locore
*/
-extern int pmax_intr __P((u_int mask, u_int pc, u_int statusReg,
+extern int kn01_intr __P((u_int mask, u_int pc, u_int statusReg,
u_int causeReg));
extern int kmin_intr __P((u_int mask, u_int pc, u_int statusReg,
u_int causeReg));
@@ -43,7 +43,7 @@ extern int xine_intr __P((u_int mask, u_int pc, u_int statusReg,
extern int kn02_intr __P((u_int mask, u_int pc, u_int statusReg,
u_int causeReg));
-extern int (*pmax_hardware_intr) __P((u_int mask, u_int pc, u_int statusReg,
+extern int (*mips_hardware_intr) __P((u_int mask, u_int pc, u_int statusReg,
u_int causeReg));
#ifdef DS5000_240
extern int kn03_intr __P((u_int mask, u_int pc, u_int statusReg,
diff --git a/sys/arch/pmax/pmax/vm_machdep.c b/sys/arch/pmax/pmax/vm_machdep.c
index 3a211a943a0..2e95d9fd75f 100644
--- a/sys/arch/pmax/pmax/vm_machdep.c
+++ b/sys/arch/pmax/pmax/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.13 1996/10/13 03:39:57 christos Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.15 1997/05/25 10:16:17 jonathan Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -67,6 +67,8 @@ extern int copykstack __P((struct user *up));
extern void MachSaveCurFPState __P((struct proc *p));
extern int switch_exit __P((void)); /* XXX never returns? */
+extern vm_offset_t kvtophys __P((vm_offset_t kva)); /* XXX */
+
/*
* Finish a fork operation, with process p2 nearly set up.
* Copy and update the kernel stack and pcb, making the child
@@ -114,7 +116,7 @@ cpu_fork(p1, p2)
*/
p2->p_addr->u_pcb = p1->p_addr->u_pcb;
/* cache segtab for ULTBMiss() */
- p2->p_addr->u_pcb.pcb_segtab = (void *)p2->p_vmspace->vm_pmap.pm_segtab;
+ p2->p_addr->u_pcb.pcb_segtab = (void *)p2->p_vmspace->vm_map.pmap->pm_segtab;
/*
* Arrange for a non-local goto when the new process
@@ -346,7 +348,8 @@ vunmapbuf(bp, len)
* The first two are so cheap they could just be macros. The last two
* overlap, so we must check for UADDR pages first.
*
- * XXX the u-area mappng should all change anyway.
+ * XXX the double-mapped u-area holding the current process's kernel stack
+ * and u-area at a fixed address should be fixed.
*/
vm_offset_t
kvtophys(vm_offset_t kva)
diff --git a/sys/arch/pmax/tc/asic.c b/sys/arch/pmax/tc/asic.c
index 28771c00e55..7cb367b7dae 100644
--- a/sys/arch/pmax/tc/asic.c
+++ b/sys/arch/pmax/tc/asic.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asic.c,v 1.15 1996/10/13 03:39:58 christos Exp $ */
+/* $NetBSD: asic.c,v 1.16 1997/05/24 09:30:27 jonathan Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -113,7 +113,7 @@ struct asic_slot *asic_slots;
#ifdef IOASIC_DEBUG
#define IOASIC_DPRINTF(x) printf x
#else
-#define IOASIC_DPRINTF(x) (void) x
+#define IOASIC_DPRINTF(x) do { if (0) printf x ; } while (0)
#endif
int
diff --git a/sys/arch/pmax/tc/scc.c b/sys/arch/pmax/tc/scc.c
index 2c656655873..79252ac3c1b 100644
--- a/sys/arch/pmax/tc/scc.c
+++ b/sys/arch/pmax/tc/scc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: scc.c,v 1.18 1996/10/16 05:04:51 jonathan Exp $ */
+/* $NetBSD: scc.c,v 1.22 1997/05/25 10:28:22 jonathan Exp $ */
/*
* Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -66,8 +66,6 @@
*/
-#include "scc.h"
-#if NSCC > 0
/*
* Intel 82530 dual usart chip driver. Supports the serial port(s) on the
* Personal DECstation 5000/xx and DECstation 5000/1xx, plus the keyboard
@@ -124,6 +122,8 @@
#include <machine/conf.h>
+#include "rasterconsole.h"
+
extern void ttrstrt __P((void *));
#ifdef alpha
@@ -136,8 +136,10 @@ extern void ttrstrt __P((void *));
* support from the tty drivers. This is ugly and broken and won't
* compile on Alphas.
*/
-#ifdef pmax
+#if defined (pmax)
+#if NRASTERCONSOLE > 0
#define HAVE_RCONS
+#endif
extern int pending_remcons;
#endif
@@ -315,6 +317,7 @@ static struct consdev scccons = {
NULL, NULL, sccGetc, sccPutc, sccPollc, NODEV, 0
};
void scc_consinit __P((dev_t dev, scc_regmap_t *sccaddr));
+void scc_oconsinit __P((struct scc_softc *sc, dev_t dev));
/*
@@ -416,8 +419,12 @@ sccmatch(parent, cfdata, aux)
(strncmp(d->iada_modname, "scc", TC_ROM_LLEN)!= 0))
return (0);
- /* XXX MATCH CFLOC */
- if (cf->cf_unit >= NSCC)
+ /*
+ * Check user-specified offset against the ioasic offset.
+ * Allow it to be wildcarded.
+ */
+ if (cf->cf_loc[0] != -1 &&
+ cf->cf_loc[0] != d->iada_offset)
return (0);
/* Get the address, and check it for validity. */
@@ -510,10 +517,12 @@ sccattach(parent, self, aux)
* For a remote console, wait a while for previous output to
* complete.
*/
-#ifdef HAVE_RCONS
+#ifdef pmax
if (CONSOLE_ON_UNIT(unit) && (cn_tab->cn_pri == CN_REMOTE))
DELAY(10000);
-#else
+#endif
+
+#ifdef alpha
if ((cputype == ST_DEC_3000_500 && sc->sc_dv.dv_unit == 1) ||
(cputype == ST_DEC_3000_300 && sc->sc_dv.dv_unit == 0))
DELAY(10000);
@@ -557,8 +566,10 @@ sccattach(parent, self, aux)
* on kn03, maybe kmin?
* And what about maxine?
*/
- if (cn_tab->cn_dev == unit && cputype != DS_MAXINE)
+ if (cn_tab->cn_dev == unit && cputype != DS_MAXINE) {
+ printf ("\n");
return;
+ }
/*
* If we are using the PROM serial-console routines
@@ -576,7 +587,7 @@ sccattach(parent, self, aux)
printf(" (In sccattach: cn_dev = 0x%x)", cn_tab->cn_dev);
printf(" (Unit = %d)", unit);
- printf(": console");
+ printf(": console\n");
pending_remcons = 0;
/*
* XXX We should support configurations where the PROM
@@ -1448,14 +1459,12 @@ scc_modem_intr(dev)
* Is it related to console handling?
*/
#ifndef alpha
-#ifdef notyet /*XXX -does this help pmax console? */
if (car) {
/* carrier present */
if (!(tp->t_state & TS_CARR_ON))
(void)(*linesw[tp->t_line].l_modem)(tp, 1);
} else if (tp->t_state & TS_CARR_ON)
(void)(*linesw[tp->t_line].l_modem)(tp, 0);
-#endif /*notyet*/
#endif /* !alpha */
splx(s);
}
@@ -1603,4 +1612,3 @@ rr(msg, regs)
r0, r1, r2, r10, r15);
}
#endif /* SCC_DEBUG */
-#endif /* NSCC */
diff --git a/sys/arch/pmax/tc/tc_subr.c b/sys/arch/pmax/tc/tc_subr.c
index 22241ed5a5c..8cb7487cae0 100644
--- a/sys/arch/pmax/tc/tc_subr.c
+++ b/sys/arch/pmax/tc/tc_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tc_subr.c,v 1.9 1996/10/13 03:40:03 christos Exp $ */
+/* $NetBSD: tc_subr.c,v 1.10 1997/05/24 09:17:24 jonathan Exp $ */
/*
* Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -14,17 +14,12 @@
*/
#include <sys/param.h>
+#include <sys/systm.h> /* printf() */
#include <sys/device.h>
#include <dev/cons.h>
#include <dev/tc/tcvar.h>
#include <machine/autoconf.h>
-
-/* Which TC framebuffers have drivers, for configuring a console device. */
-#include <cfb.h>
-#include <mfb.h>
-#include <sfb.h>
-
extern int pmax_boardtype;
@@ -64,6 +59,20 @@ static int tc_consprobeslot __P((tc_addr_t slotaddr));
#include <pmax/pmax/turbochannel.h>
+#include <machine/fbio.h>
+#include <machine/fbvar.h>
+#include <pmax/dev/cfbvar.h>
+#include <pmax/dev/mfbvar.h>
+#include <pmax/dev/sfbvar.h>
+#include <pmax/dev/xcfbvar.h>
+
+
+/* Which TC framebuffers have drivers, for configuring a console device. */
+#include "cfb.h"
+#include "mfb.h"
+#include "sfb.h"
+
+
/*#include <pmax/pmax/nameglue.h>*/
#define KV(x) ((tc_addr_t)MACH_PHYS_TO_UNCACHED(x))
@@ -389,7 +398,6 @@ tc_consprobeslot(tc_slotaddr)
char name[20];
void *slotaddr = (void *) tc_slotaddr;
- struct tcbus_attach_args * sc_desc;
if (tc_badaddr(slotaddr))
return (0);
@@ -445,7 +453,7 @@ tc_ds_intr_establish(dev, cookie, level, handler, val)
/* Never tested on these processors */
if (cputype == DS_3MIN || cputype == DS_MAXINE)
- printf("tc_enable %s sc %x slot %d\n",
+ printf("tc_enable %s sc %x slot %p\n",
dev->dv_xname, (int)val, cookie);
#ifdef DIAGNOSTIC
@@ -507,5 +515,5 @@ tc_ds_ioasic_iointr (framep, vec)
void * framep;
int vec;
{
- printf("bogus interrupt handler fp %x vec %d\n", framep, vec);
+ printf("bogus interrupt handler fp %p vec %d\n", framep, vec);
}