summaryrefslogtreecommitdiff
path: root/sys/arch/pmax/include
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-15 21:13:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-15 21:13:29 +0000
commitc7944dc0d2be35242202bdad3b511d6b6e60cf3a (patch)
tree49728a73374c694c8937e8c1903dabf1e19ec820 /sys/arch/pmax/include
parent9923345416a4c9f9c668f0ca1c8b259113aac9e7 (diff)
sync to netbsd; for graichen
Diffstat (limited to 'sys/arch/pmax/include')
-rw-r--r--sys/arch/pmax/include/ansi.h75
-rw-r--r--sys/arch/pmax/include/autoconf.h49
-rw-r--r--sys/arch/pmax/include/bsd-aout.h32
-rw-r--r--sys/arch/pmax/include/cdefs.h46
-rw-r--r--sys/arch/pmax/include/conf.h35
-rw-r--r--sys/arch/pmax/include/cpu.h156
-rw-r--r--sys/arch/pmax/include/ecoff.h47
-rw-r--r--sys/arch/pmax/include/elf.h138
-rw-r--r--sys/arch/pmax/include/endian.h95
-rw-r--r--sys/arch/pmax/include/exec.h49
-rw-r--r--sys/arch/pmax/include/float.h81
-rw-r--r--sys/arch/pmax/include/ieeefp.h19
-rw-r--r--sys/arch/pmax/include/kdbparam.h75
-rw-r--r--sys/arch/pmax/include/limits.h99
-rw-r--r--sys/arch/pmax/include/locore.h18
-rw-r--r--sys/arch/pmax/include/machAsmDefs.h183
-rw-r--r--sys/arch/pmax/include/machConst.h389
-rw-r--r--sys/arch/pmax/include/mips_opcode.h192
-rw-r--r--sys/arch/pmax/include/param.h80
-rw-r--r--sys/arch/pmax/include/pcb.h63
-rw-r--r--sys/arch/pmax/include/pmap.h107
-rw-r--r--sys/arch/pmax/include/proc.h54
-rw-r--r--sys/arch/pmax/include/profile.h80
-rw-r--r--sys/arch/pmax/include/pte.h8
-rw-r--r--sys/arch/pmax/include/ptrace.h51
-rw-r--r--sys/arch/pmax/include/reg.h63
-rw-r--r--sys/arch/pmax/include/regdef.h74
-rw-r--r--sys/arch/pmax/include/regnum.h146
-rw-r--r--sys/arch/pmax/include/reloc.h75
-rw-r--r--sys/arch/pmax/include/setjmp.h8
-rw-r--r--sys/arch/pmax/include/signal.h67
-rw-r--r--sys/arch/pmax/include/stdarg.h57
-rw-r--r--sys/arch/pmax/include/tc_machdep.h39
-rw-r--r--sys/arch/pmax/include/trap.h65
-rw-r--r--sys/arch/pmax/include/types.h82
-rw-r--r--sys/arch/pmax/include/varargs.h62
-rw-r--r--sys/arch/pmax/include/vmparam.h241
37 files changed, 535 insertions, 2665 deletions
diff --git a/sys/arch/pmax/include/ansi.h b/sys/arch/pmax/include/ansi.h
index 1b329b0d39c..607e3ce3021 100644
--- a/sys/arch/pmax/include/ansi.h
+++ b/sys/arch/pmax/include/ansi.h
@@ -1,74 +1,3 @@
-/* $NetBSD: ansi.h,v 1.5 1994/10/26 21:09:33 cgd Exp $ */
+/* $NetBSD: ansi.h,v 1.7 1996/03/19 11:00:16 jonathan Exp $ */
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)ansi.h 8.2 (Berkeley) 1/4/94
- */
-
-#ifndef _ANSI_H_
-#define _ANSI_H_
-
-/*
- * Types which are fundamental to the implementation and may appear in
- * more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ unsigned long /* clock() */
-#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
-#define _BSD_SIZE_T_ unsigned int /* sizeof() */
-#define _BSD_SSIZE_T_ int /* byte count or error */
-#define _BSD_TIME_T_ long /* time() */
-#define _BSD_VA_LIST_ char * /* va_list */
-
-/*
- * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you
- * lose a bit of ANSI conformance, but your programs will still work.
- *
- * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t
- * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
- * defined for ctype.h.
- */
-#define _BSD_WCHAR_T_ int /* wchar_t */
-#define _BSD_RUNE_T_ int /* rune_t */
-
-#endif /* _ANSI_H_ */
+#include <mips/ansi.h>
diff --git a/sys/arch/pmax/include/autoconf.h b/sys/arch/pmax/include/autoconf.h
index 7f5c589393e..59c3eaa6791 100644
--- a/sys/arch/pmax/include/autoconf.h
+++ b/sys/arch/pmax/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.h,v 1.3 1996/01/11 05:57:04 jonathan Exp $ */
+/* $NetBSD: autoconf.h,v 1.6.4.1 1996/05/30 04:07:36 mhitch Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -31,50 +31,43 @@
* Machine-dependent structures of autoconfiguration
*/
+#include <machine/tc_machdep.h>
+
struct confargs;
+
/* Handle device interrupt for given unit of a driver */
typedef void* intr_arg_t; /* pointer to some softc */
typedef int (*intr_handler_t) __P((intr_arg_t));
+/*
+ * XXX Establish interrupt on an arbitrary decstation/decsystem bus.
+ */
+extern void
+generic_intr_establish __P(( void * parent, void * cookie,
+ int level,
+ intr_handler_t handler, intr_arg_t arg));
-struct abus {
- struct device *ab_dv; /* back-pointer to device */
- int ab_type; /* bus type (see below) */
- void (*ab_intr_establish) /* bus's set-handler function */
- __P((struct confargs *, intr_handler_t, intr_arg_t));
- void (*ab_intr_disestablish) /* bus's unset-handler function */
- __P((struct confargs *));
- caddr_t (*ab_cvtaddr) /* convert slot/offset to address */
- __P((struct confargs *));
- int (*ab_matchname) /* see if name matches driver */
- __P((struct confargs *, char *));
-};
-
-#define BUS_MAIN 1 /* mainbus */
-#define BUS_TC 2 /* TurboChannel */
-#define BUS_ASIC 3 /* IOCTL ASIC; under TurboChannel */
-#define BUS_TCDS 4 /* TCDS ASIC; under TurboChannel */
-#define KN02_ASIC_NAME "KN02 " /* very special */
+#define KN02_ASIC_NAME "KN02 " /* ROM name in 3max system slot */
-#define BUS_INTR_ESTABLISH(ca, handler, val) \
- (*(ca)->ca_bus->ab_intr_establish)((ca), (handler), (val))
-#define BUS_INTR_DISESTABLISH(ca) \
- (*(ca)->ca_bus->ab_intr_establish)(ca)
-#define BUS_CVTADDR(ca) \
- (*(ca)->ca_bus->ab_cvtaddr)(ca)
-#define BUS_MATCHNAME(ca, name) \
- (*(ca)->ca_bus->ab_matchname)((ca), (name))
+#define INTR_ESTABLISH(parent, cookie, level, handler, val) \
+ generic_intr_establish((parent), (cookie), (level), (handler), (val))
+
+#define BUS_INTR_ESTABLISH(ca, handler, val) \
+ generic_intr_establish( ((struct device*)(val))->dv_parent, \
+ (void*)(ca)->ca_slotpri, 0, (handler), (val))
+
struct confargs {
char *ca_name; /* Device name. */
int ca_slot; /* Device slot (table entry). */
int ca_offset; /* Offset into slot. */
+ tc_addr_t ca_addr; /* Device address. */
int ca_slotpri; /* Device interrupt "priority" */
- struct abus *ca_bus; /* bus device resides on. */
};
+extern caddr_t baseboard_cvtaddr __P((struct confargs *)); /*XXX*/
#ifndef pmax
void set_clockintr __P((void (*)(struct clockframe *)));
diff --git a/sys/arch/pmax/include/bsd-aout.h b/sys/arch/pmax/include/bsd-aout.h
index 5d496ff1d09..1d98a19d7ab 100644
--- a/sys/arch/pmax/include/bsd-aout.h
+++ b/sys/arch/pmax/include/bsd-aout.h
@@ -1,33 +1,7 @@
+/* $NetBSD: bsd-aout.h,v 1.3 1996/03/19 03:06:28 jonathan Exp $ */
+
/* bsd-aout.h
4.4bsd a.out format, for backwards compatibility... */
-#ifndef __MACHINE_BSD_AOUT_H__
-#define __MACHINE_BSD_AOUT_H__
-#define BSD_OMAGIC 0407 /* old impure format */
-#define BSD_NMAGIC 0410 /* read-only text */
-#define BSD_ZMAGIC 0413 /* demand load format */
-
-struct bsd_aouthdr {
-#if BYTE_ORDER == BIG_ENDIAN
- u_short a_mid; /* machine ID */
- u_short a_magic; /* magic number */
-#else
- u_short a_magic; /* magic number */
- u_short a_mid; /* machine ID */
-#endif
-
- u_long a_text; /* text segment size */
- u_long a_data; /* initialized data size */
- u_long a_bss; /* uninitialized data size */
- u_long a_syms; /* symbol table size */
- u_long a_entry; /* entry point */
- u_long a_trsize; /* text relocation size */
- u_long a_drsize; /* data relocation size */
-};
-
-#ifndef _KERNEL
-#define _AOUT_INCLUDE_
-#include <nlist.h>
-#endif /* _KERNEL */
-#endif /* __MACHINE_BSD_AOUT_H__ */
+#include <mips/bsd-aout.h>
diff --git a/sys/arch/pmax/include/cdefs.h b/sys/arch/pmax/include/cdefs.h
index 47499b695ea..ece6d966740 100644
--- a/sys/arch/pmax/include/cdefs.h
+++ b/sys/arch/pmax/include/cdefs.h
@@ -1,45 +1,3 @@
-/* $NetBSD: cdefs.h,v 1.4 1995/12/15 01:17:04 jonathan Exp $ */
+/* $NetBSD: cdefs.h,v 1.5 1996/03/19 04:39:03 jonathan Exp $ */
-/*
- * Copyright (c) 1995 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#ifndef _MACHINE_CDEFS_H_
-#define _MACHINE_CDEFS_H_
-
-#define _C_LABEL(x) _STRING(x)
-
-#define __indr_references(sym,msg) /* nothing */
-
-#if defined __GNUC__ && defined __STDC__
-#define __warn_references(sym, msg) \
- static const char __evoke_link_warning_##sym[] \
- __attribute__ ((section (".gnu.warning." #sym))) = msg;
-#else
-#define __warn_references(sym,msg) /* nothing */
-#endif
-
-#endif /* !_MACHINE_CDEFS_H_ */
+#include <mips/cdefs.h>
diff --git a/sys/arch/pmax/include/conf.h b/sys/arch/pmax/include/conf.h
new file mode 100644
index 00000000000..e854da965a1
--- /dev/null
+++ b/sys/arch/pmax/include/conf.h
@@ -0,0 +1,35 @@
+/* $NetBSD: conf.h,v 1.2 1996/04/14 00:56:59 jonathan Exp $ */
+
+
+/*
+ * Copyright 1996 The Board of Trustees of The Leland Stanford
+ * Junior University. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies. Stanford University
+ * makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without
+ * express or implied warranty.
+ *
+ * This file contributed by Jonathan Stone.
+ */
+
+#define mmread mmrw
+#define mmwrite mmrw
+cdev_decl(mm);
+
+
+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 */
+cdev_decl(rz);
+
+bdev_decl(tz); /* antique 4.4bsd/pmax SCSI tape driver */
+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 */
diff --git a/sys/arch/pmax/include/cpu.h b/sys/arch/pmax/include/cpu.h
index 80909d2a29b..a185964ac80 100644
--- a/sys/arch/pmax/include/cpu.h
+++ b/sys/arch/pmax/include/cpu.h
@@ -1,158 +1,16 @@
-/* $NetBSD: cpu.h,v 1.12 1995/06/28 02:56:01 cgd Exp $ */
+/* $NetBSD: cpu.h,v 1.15 1996/05/19 01:28:47 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell and Rick Macklem.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)cpu.h 8.4 (Berkeley) 1/4/94
- */
+#include <mips/cpu.h>
+#include <mips/cpuregs.h> /* XXX */
-#ifndef _CPU_H_
-#define _CPU_H_
+#define CLKF_USERMODE(framep) CLKF_USERMODE_R3K(framep)
+#define CLKF_BASEPRI(framep) CLKF_BASEPRI_R3K(framep)
-#include <machine/machConst.h>
-
-/*
- * Exported definitions unique to pmax/mips cpu support.
- */
-
-/*
- * definitions of cpu-dependent requirements
- * referenced in generic code
- */
-#define cpu_wait(p) /* nothing */
-#define cpu_set_init_frame(p, fp) /* nothing */
-#define cpu_swapout(p) panic("cpu_swapout: can't get here");
-
-/*
- * Arguments to hardclock and gatherstats encapsulate the previous
- * machine state in an opaque clockframe.
- */
-struct clockframe {
- int pc; /* program counter at time of interrupt */
- int sr; /* status register at time of interrupt */
-};
-
-#define CLKF_USERMODE(framep) ((framep)->sr & MACH_SR_KU_PREV)
-#define CLKF_BASEPRI(framep) \
- ((~(framep)->sr & (MACH_INT_MASK | MACH_SR_INT_ENA_PREV)) == 0)
-#define CLKF_PC(framep) ((framep)->pc)
-#define CLKF_INTR(framep) (0)
-
-/*
- * Preempt the current process if in interrupt from user mode,
- * or after the current trap/syscall if in system mode.
- */
-#define need_resched() { want_resched = 1; aston(); }
-
-/*
- * Give a profiling tick to the current process when the user profiling
- * buffer pages are invalid. On the PMAX, request an ast to send us
- * through trap, marking the proc as needing a profiling tick.
- */
-#define need_proftick(p) { (p)->p_flag |= P_OWEUPC; aston(); }
-
-/*
- * Notify the current process (p) that it has a signal pending,
- * process as soon as possible.
- */
-#define signotify(p) aston()
-
-#define aston() (astpending = 1)
-
-int astpending; /* need to trap before returning to user mode */
-int want_resched; /* resched() was called */
-
-/*
- * CPU identification, from PRID register.
- */
-union cpuprid {
- int cpuprid;
- struct {
-#if BYTE_ORDER == BIG_ENDIAN
- u_int pad1:16; /* reserved */
- u_int cp_imp:8; /* implementation identifier */
- u_int cp_majrev:4; /* major revision identifier */
- u_int cp_minrev:4; /* minor revision identifier */
-#else
- u_int cp_minrev:4; /* minor revision identifier */
- u_int cp_majrev:4; /* major revision identifier */
- u_int cp_imp:8; /* implementation identifier */
- u_int pad1:16; /* reserved */
-#endif
- } cpu;
-};
-
-/*
- * CTL_MACHDEP definitions.
- */
-#define CPU_CONSDEV 1 /* dev_t: console terminal device */
-#define CPU_MAXID 2 /* number of valid machdep ids */
-
-#define CTL_MACHDEP_NAMES { \
- { 0, 0 }, \
- { "console_device", CTLTYPE_STRUCT }, \
-}
-
-/*
- * MIPS CPU types (cp_imp).
- */
-#define MIPS_R2000 0x01
-#define MIPS_R3000 0x02
-#define MIPS_R6000 0x03
-#define MIPS_R4000 0x04
-#define MIPS_R6000A 0x06
-
-/*
- * MIPS FPU types
- */
-#define MIPS_R2010 0x02
-#define MIPS_R3010 0x03
-#define MIPS_R6010 0x04
-#define MIPS_R4010 0x05
#ifdef _KERNEL
-union cpuprid cpu;
-union cpuprid fpu;
+union cpuprid cpu_id;
+union cpuprid fpu_id;
u_int machDataCacheSize;
u_int machInstCacheSize;
extern struct intr_tab intr_tab[];
#endif
-
-/*
- * Enable realtime clock (always enabled).
- */
-#define enablertclock()
-
-#endif /* _CPU_H_ */
diff --git a/sys/arch/pmax/include/ecoff.h b/sys/arch/pmax/include/ecoff.h
index c0f30e17077..91631b47cf9 100644
--- a/sys/arch/pmax/include/ecoff.h
+++ b/sys/arch/pmax/include/ecoff.h
@@ -1,46 +1,3 @@
-/* $NetBSD: ecoff.h,v 1.4 1995/06/16 02:07:33 mellon Exp $ */
+/* $NetBSD: ecoff.h,v 1.5 1996/03/19 03:17:24 jonathan Exp $ */
-/*
- * Copyright (c) 1994 Adam Glass
- * 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 Adam Glass.
- * 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 Adam Glass ``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 Adam Glass 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.
- */
-
-#define ECOFF_LDPGSZ 4096
-
-#define ECOFF_PAD
-
-#define ECOFF_MACHDEP \
- u_long ea_gprmask; \
- u_long ea_cprmask[4]; \
- u_long ea_gp_value
-
-#define ECOFF_MAGIC_MIPSEL 0x0162
-#define ECOFF_BADMAG(ex) ((ex)->ef_magic != ECOFF_MAGIC_MIPSEL)
-
-#define ECOFF_SEGMENT_ALIGNMENT(eap) ((eap)->ea_vstamp < 23 ? 8 : 16)
+#include <mips/ecoff.h>
diff --git a/sys/arch/pmax/include/elf.h b/sys/arch/pmax/include/elf.h
index 5cb8b03421d..ab305c5df17 100644
--- a/sys/arch/pmax/include/elf.h
+++ b/sys/arch/pmax/include/elf.h
@@ -1,137 +1,3 @@
-/* $NetBSD: elf.h,v 1.2 1995/03/28 18:19:14 jtc Exp $ */
+/* $NetBSD: elf.h,v 1.3 1996/03/19 03:06:41 jonathan Exp $ */
-/*
- * Copyright (c) 1994 Ted Lemon
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#ifndef __MACHINE_ELF_H__
-#define __MACHINE_ELF_H__
-
-/* ELF executable header... */
-struct ehdr {
- char elf_magic [4]; /* Elf magic number... */
- unsigned long magic [3]; /* Magic number... */
- unsigned short type; /* Object file type... */
- unsigned short machine; /* Machine ID... */
- unsigned long version; /* File format version... */
- unsigned long entry; /* Entry point... */
- unsigned long phoff; /* Program header table offset... */
- unsigned long shoff; /* Section header table offset... */
- unsigned long flags; /* Processor-specific flags... */
- unsigned short ehsize; /* Elf header size in bytes... */
- unsigned short phsize; /* Program header size... */
- unsigned short phcount; /* Program header count... */
- unsigned short shsize; /* Section header size... */
- unsigned short shcount; /* Section header count... */
- unsigned short shstrndx; /* Section header string table index... */
-};
-
-/* Program header... */
-struct phdr {
- unsigned long type; /* Segment type... */
- unsigned long offset; /* File offset... */
- unsigned long vaddr; /* Virtual address... */
- unsigned long paddr; /* Physical address... */
- unsigned long filesz; /* Size of segment in file... */
- unsigned long memsz; /* Size of segment in memory... */
- unsigned long flags; /* Segment flags... */
- unsigned long align; /* Alighment, file and memory... */
-};
-
-/* Section header... */
-struct shdr {
- unsigned long name; /* Offset into string table of section name */
- unsigned long type; /* Type of section... */
- unsigned long flags; /* Section flags... */
- unsigned long addr; /* Section virtual address at execution... */
- unsigned long offset; /* Section file offset... */
- unsigned long size; /* Section size... */
- unsigned long link; /* Link to another section... */
- unsigned long info; /* Additional section info... */
- unsigned long align; /* Section alignment... */
- unsigned long esize; /* Entry size if section holds table... */
-};
-
-/* Symbol table entry... */
-struct sym {
- unsigned long name; /* Index into strtab of symbol name. */
- unsigned long value; /* Section offset, virt addr or common align. */
- unsigned long size; /* Size of object referenced. */
- unsigned type : 4; /* Symbol type (e.g., function, data)... */
- unsigned binding : 4; /* Symbol binding (e.g., global, local)... */
- unsigned char other; /* Unused. */
- unsigned short shndx; /* Section containing symbol. */
-};
-
-/* Values for program header type field */
-
-#define PT_NULL 0 /* Program header table entry unused */
-#define PT_LOAD 1 /* Loadable program segment */
-#define PT_DYNAMIC 2 /* Dynamic linking information */
-#define PT_INTERP 3 /* Program interpreter */
-#define PT_NOTE 4 /* Auxiliary information */
-#define PT_SHLIB 5 /* Reserved, unspecified semantics */
-#define PT_PHDR 6 /* Entry for header table itself */
-#define PT_LOPROC 0x70000000 /* Processor-specific */
-#define PT_HIPROC 0x7FFFFFFF /* Processor-specific */
-#define PT_MIPS_REGINFO PT_LOPROC /* Mips reginfo section... */
-
-/* Program segment permissions, in program header flags field */
-
-#define PF_X (1 << 0) /* Segment is executable */
-#define PF_W (1 << 1) /* Segment is writable */
-#define PF_R (1 << 2) /* Segment is readable */
-#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
-
-/* Reserved section indices... */
-#define SHN_UNDEF 0
-#define SHN_ABS 0xfff1
-#define SHN_COMMON 0xfff2
-#define SHN_MIPS_ACOMMON 0xfff0
-
-/* Symbol bindings... */
-#define STB_LOCAL 0
-#define STB_GLOBAL 1
-#define STB_WEAK 2
-
-/* Symbol types... */
-#define STT_NOTYPE 0
-#define STT_OBJECT 1
-#define STT_FUNC 2
-#define STT_SECTION 3
-#define STT_FILE 4
-
-#define ELF_HDR_SIZE (sizeof (struct ehdr))
-#ifdef _KERNEL
-int pmax_elf_makecmds __P((struct proc *, struct exec_package *));
-#endif /* _KERNEL */
-#endif /* __MACHINE_ELF_H__ */
+#include <mips/elf.h>
diff --git a/sys/arch/pmax/include/endian.h b/sys/arch/pmax/include/endian.h
index 3aeb69fc3ca..60f1fef7fca 100644
--- a/sys/arch/pmax/include/endian.h
+++ b/sys/arch/pmax/include/endian.h
@@ -1,94 +1,3 @@
-/* $NetBSD: endian.h,v 1.4 1994/10/26 21:09:38 cgd Exp $ */
+/* $NetBSD: endian.h,v 1.5 1996/03/19 03:06:50 jonathan Exp $ */
-/*
- * Copyright (c) 1987, 1991, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)endian.h 8.1 (Berkeley) 6/11/93
- */
-
-#ifndef _ENDIAN_H_
-#define _ENDIAN_H_
-
-/*
- * Define _NOQUAD if the compiler does NOT support 64-bit integers.
- */
-/* #define _NOQUAD */
-
-/*
- * Define the order of 32-bit words in 64-bit words.
- */
-#define _QUAD_HIGHWORD 1
-#define _QUAD_LOWWORD 0
-
-#ifndef _POSIX_SOURCE
-/*
- * Definitions for byte order, according to byte significance from low
- * address to high.
- */
-#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
-#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
-
-#define BYTE_ORDER LITTLE_ENDIAN
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-unsigned long htonl __P((unsigned long));
-unsigned short htons __P((unsigned short));
-unsigned long ntohl __P((unsigned long));
-unsigned short ntohs __P((unsigned short));
-__END_DECLS
-
-/*
- * Macros for network/external number representation conversion.
- */
-#if BYTE_ORDER == BIG_ENDIAN && !defined(lint)
-#define ntohl(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define htons(x) (x)
-
-#define NTOHL(x) (x)
-#define NTOHS(x) (x)
-#define HTONL(x) (x)
-#define HTONS(x) (x)
-
-#else
-
-#define NTOHL(x) (x) = ntohl((u_long)x)
-#define NTOHS(x) (x) = ntohs((u_short)x)
-#define HTONL(x) (x) = htonl((u_long)x)
-#define HTONS(x) (x) = htons((u_short)x)
-#endif
-#endif /* ! _POSIX_SOURCE */
-#endif /* !_ENDIAN_H_ */
+#include <mips/endian.h>
diff --git a/sys/arch/pmax/include/exec.h b/sys/arch/pmax/include/exec.h
index 8e25259e2d9..bf90c5ce358 100644
--- a/sys/arch/pmax/include/exec.h
+++ b/sys/arch/pmax/include/exec.h
@@ -1,48 +1,3 @@
-/* $NetBSD: exec.h,v 1.5 1994/10/26 21:09:39 cgd Exp $ */
+/* $NetBSD: exec.h,v 1.6 1996/03/19 03:07:02 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)exec.h 8.1 (Berkeley) 6/10/93
- */
-
-#define __LDPGSZ 4096
-
-#define ELF_TARG_CLASS ELFCLASS32
-#define ELF_TARG_DATA ELFDATA2LSB
-#define ELF_TARG_MACH EM_MIPS
-
-#define DO_AOUT /* support a.out */
-#define DO_ELF /* support ELF */
-#define DO_ECOFF /* support ecoff */
-
-#include <machine/reloc.h>
+#include <mips/exec.h>
diff --git a/sys/arch/pmax/include/float.h b/sys/arch/pmax/include/float.h
index 2c172c75763..5c78fe23f21 100644
--- a/sys/arch/pmax/include/float.h
+++ b/sys/arch/pmax/include/float.h
@@ -1,80 +1,3 @@
-/* $NetBSD: float.h,v 1.7 1995/06/20 20:45:50 jtc Exp $ */
+/* $NetBSD: float.h,v 1.9 1996/03/19 03:07:19 jonathan Exp $ */
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)float.h 8.1 (Berkeley) 6/10/93
- */
-
-#ifndef _PMAX_FLOAT_H_
-#define _PMAX_FLOAT_H_
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-extern int __flt_rounds();
-__END_DECLS
-
-#define FLT_RADIX 2 /* b */
-#define FLT_ROUNDS __flt_rounds()
-
-#define FLT_MANT_DIG 24 /* p */
-#define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */
-#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */
-#define FLT_MIN_EXP -125 /* emin */
-#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */
-#define FLT_MIN_10_EXP -37 /* ceil(log10(b**(emin-1))) */
-#define FLT_MAX_EXP 128 /* emax */
-#define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */
-#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */
-
-#define DBL_MANT_DIG 53
-#define DBL_EPSILON 2.2204460492503131E-16
-#define DBL_DIG 15
-#define DBL_MIN_EXP -1021
-#define DBL_MIN 2.225073858507201E-308
-#define DBL_MIN_10_EXP -307
-#define DBL_MAX_EXP 1024
-#define DBL_MAX 1.797693134862316E+308
-#define DBL_MAX_10_EXP 308
-
-#define LDBL_MANT_DIG DBL_MANT_DIG
-#define LDBL_EPSILON DBL_EPSILON
-#define LDBL_DIG DBL_DIG
-#define LDBL_MIN_EXP DBL_MIN_EXP
-#define LDBL_MIN DBL_MIN
-#define LDBL_MIN_10_EXP DBL_MIN_10_EXP
-#define LDBL_MAX_EXP DBL_MAX_EXP
-#define LDBL_MAX DBL_MAX
-#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
-
-#endif /* _PMAX_FLOAT_H_ */
+#include <mips/float.h>
diff --git a/sys/arch/pmax/include/ieeefp.h b/sys/arch/pmax/include/ieeefp.h
index f69318d9d0c..51bdb4564a5 100644
--- a/sys/arch/pmax/include/ieeefp.h
+++ b/sys/arch/pmax/include/ieeefp.h
@@ -3,21 +3,4 @@
* Public domain.
*/
-#ifndef _PMAX_IEEEFP_H_
-#define _PMAX_IEEEFP_H_
-
-typedef int fp_except;
-#define FP_X_IMP 0x01 /* imprecise (loss of precision) */
-#define FP_X_UFL 0x02 /* underflow exception */
-#define FP_X_OFL 0x04 /* overflow exception */
-#define FP_X_DZ 0x08 /* divide-by-zero exception */
-#define FP_X_INV 0x10 /* invalid operation exception */
-
-typedef enum {
- FP_RN=0, /* round to nearest representable number */
- FP_RZ=1, /* round to zero (truncate) */
- FP_RP=2, /* round toward positive infinity */
- FP_RM=3 /* round toward negative infinity */
-} fp_rnd;
-
-#endif /* _PMAX_IEEEFP_H_ */
+#include <mips/ieeefp.h>
diff --git a/sys/arch/pmax/include/kdbparam.h b/sys/arch/pmax/include/kdbparam.h
index 9104c87aa3c..320bf53e779 100644
--- a/sys/arch/pmax/include/kdbparam.h
+++ b/sys/arch/pmax/include/kdbparam.h
@@ -1,74 +1,3 @@
-/* $NetBSD: kdbparam.h,v 1.4 1994/10/26 21:09:42 cgd Exp $ */
+/* $NetBSD: kdbparam.h,v 1.5 1996/03/19 04:39:08 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)kdbparam.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * Machine dependent definitions for kdb.
- */
-
-#if BYTE_ORDER == LITTLE_ENDIAN
-#define kdbshorten(w) ((w) & 0xFFFF)
-#define kdbbyte(w) ((w) & 0xFF)
-#define kdbitol(a,b) ((long)(((b) << 16) | ((a) & 0xFFFF)))
-#define kdbbtol(a) ((long)(a))
-#endif
-
-#define LPRMODE "%R"
-#define OFFMODE "+%R"
-
-#define SETBP(ins) MACH_BREAK_BRKPT
-
-/* return the program counter value modified if we are in a delay slot */
-#define kdbgetpc(pcb) (kdbvar[kdbvarchk('t')] < 0 ? \
- (pcb).pcb_regs[34] + 4 : (pcb).pcb_regs[34])
-#define kdbishiddenreg(p) ((p) >= &kdbreglist[33])
-#define kdbisbreak(type) (((type) & MACH_CR_EXC_CODE) == 0x24)
-
-/* check for address wrap around */
-#define kdbaddrwrap(addr,newaddr) (((addr)^(newaddr)) >> 31)
-
-/* declare machine dependent routines defined in kadb.c */
-void kdbprinttrap __P((unsigned, unsigned));
-void kdbsetsstep __P((void));
-void kdbclrsstep __P((void));
-void kdbreadc __P((char *));
-void kdbwrite __P((char *, int));
-void kdbprintins __P((int, long));
-void kdbstacktrace __P((int));
-char *kdbmalloc __P((int));
+#include <mips/kdbparam.h>
diff --git a/sys/arch/pmax/include/limits.h b/sys/arch/pmax/include/limits.h
index 6f2c0243f28..0d0f743ff27 100644
--- a/sys/arch/pmax/include/limits.h
+++ b/sys/arch/pmax/include/limits.h
@@ -1,100 +1,7 @@
-/* $NetBSD: limits.h,v 1.8 1995/03/28 18:19:16 jtc Exp $ */
+/* $NetBSD: limits.h,v 1.10 1996/03/19 03:09:03 jonathan Exp $ */
-/*
- * Copyright (c) 1988, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)limits.h 8.3 (Berkeley) 1/4/94
- */
-
-#define CHAR_BIT 8 /* number of bits in a char */
-#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
+#include <mips/limits.h>
#ifdef _KERNEL
-#define CLK_TCK 60 /* ticks per second */
-#endif
-
-/*
- * According to ANSI (section 2.2.4.2), the values below must be usable by
- * #if preprocessing directives. Additionally, the expression must have the
- * same type as would an expression that is an object of the corresponding
- * type converted according to the integral promotions. The subtraction for
- * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
- * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
- * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values
- * are written as hex so that GCC will be quiet about large integer constants.
- */
-#define SCHAR_MAX 127 /* min value for a signed char */
-#define SCHAR_MIN (-128) /* max value for a signed char */
-
-#define UCHAR_MAX 255 /* max value for an unsigned char */
-#define CHAR_MAX 127 /* max value for a char */
-#define CHAR_MIN (-128) /* min value for a char */
-
-#define USHRT_MAX 65535 /* max value for an unsigned short */
-#define SHRT_MAX 32767 /* max value for a short */
-#define SHRT_MIN (-32768) /* min value for a short */
-
-#define UINT_MAX 0xffffffff /* max value for an unsigned int */
-#define INT_MAX 2147483647 /* max value for an int */
-#define INT_MIN (-2147483647-1) /* min value for an int */
-
-#define ULONG_MAX 0xffffffff /* max value for an unsigned long */
-#define LONG_MAX 2147483647 /* max value for a long */
-#define LONG_MIN (-2147483647-1) /* min value for a long */
-
-#if !defined(_ANSI_SOURCE)
-#define SSIZE_MAX INT_MAX /* max value for a ssize_t */
-
-#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
-#define SIZE_T_MAX UINT_MAX /* max value for a size_t */
-
-/* GCC requires that quad constants be written as expressions. */
-#define UQUAD_MAX ((u_quad_t)0-1) /* max value for a uquad_t */
- /* max value for a quad_t */
-#define QUAD_MAX ((quad_t)(UQUAD_MAX >> 1))
-#define QUAD_MIN (-QUAD_MAX-1) /* min value for a quad_t */
-
-#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
-#endif /* !_ANSI_SOURCE */
-
-#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
-#define LONG_BIT 32
-#define WORD_BIT 32
-
-#define DBL_DIG 15
-#define DBL_MAX 1.797693134862316E+308
-#define DBL_MIN 2.225073858507201E-308
-
-#define FLT_DIG 6
-#define FLT_MAX 3.40282347E+38F
-#define FLT_MIN 1.17549435E-38F
+#define CLK_TCK 60 /* ticks per second */
#endif
diff --git a/sys/arch/pmax/include/locore.h b/sys/arch/pmax/include/locore.h
new file mode 100644
index 00000000000..c837262a72d
--- /dev/null
+++ b/sys/arch/pmax/include/locore.h
@@ -0,0 +1,18 @@
+/* $NetBSD: locore.h,v 1.2 1996/05/20 23:49:11 jonathan Exp $ */
+
+/*
+ * Copyright 1996 The Board of Trustees of The Leland Stanford
+ * Junior University. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies. Stanford University
+ * makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without
+ * express or implied warranty.
+ *
+ * This file contributed by Jonathan Stone
+ */
+
+#include <mips/locore.h>
diff --git a/sys/arch/pmax/include/machAsmDefs.h b/sys/arch/pmax/include/machAsmDefs.h
index 6d44b22979d..8f6c09b0a18 100644
--- a/sys/arch/pmax/include/machAsmDefs.h
+++ b/sys/arch/pmax/include/machAsmDefs.h
@@ -1,182 +1,3 @@
-/* $NetBSD: machAsmDefs.h,v 1.7 1995/01/18 06:38:57 mellon Exp $ */
+/* $NetBSD: machAsmDefs.h,v 1.8 1996/03/25 02:55:18 jonathan Exp $ */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)machAsmDefs.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * machAsmDefs.h --
- *
- * Macros used when writing assembler programs.
- *
- * Copyright (C) 1989 Digital Equipment Corporation.
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies.
- * Digital Equipment Corporation makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAsmDefs.h,
- * v 1.2 89/08/15 18:28:24 rab Exp SPRITE (DECWRL)
- */
-
-#ifndef _MACHASMDEFS
-#define _MACHASMDEFS
-
-#include <machine/regdef.h>
-
-/*
- * Define -pg profile entry code.
- */
-#if defined(GPROF) || defined(PROF)
-#define MCOUNT .set noreorder; \
- .set noat; \
- move $1,$31; \
- jal _mcount; \
- subu sp,sp,8; \
- .set reorder; \
- .set at;
-#else
-#define MCOUNT
-#endif
-
-#ifdef __NO_LEADING_UNDERSCORES__
-# define _C_LABEL(x) x
-#else
-# ifdef __STDC__
-# define _C_LABEL(x) _ ## x
-# else
-# define _C_LABEL(x) _/**/x
-# endif
-#endif
-
-/*
- * LEAF(x)
- *
- * Declare a leaf routine.
- */
-#define LEAF(x) \
- .globl _C_LABEL(x); \
- .ent _C_LABEL(x), 0; \
-_C_LABEL(x): ; \
- .frame sp, 0, ra; \
- MCOUNT
-
-/*
- * NLEAF(x)
- *
- * Declare a non-profiled leaf routine.
- */
-#define NLEAF(x) \
- .globl _C_LABEL(x); \
- .ent _C_LABEL(x), 0; \
-_C_LABEL(x): ; \
- .frame sp, 0, ra
-
-/*
- * ALEAF -- declare alternate entry to a leaf routine.
- */
-#ifdef USE_AENT
-#define AENT(x) \
- .aent x, 0
-#else
-#define AENT(x)
-#endif
-#define ALEAF(x) \
- .globl _C_LABEL(x); \
- AENT (_C_LABEL(x)) \
-_C_LABEL(x):
-
-/*
- * NON_LEAF(x)
- *
- * Declare a non-leaf routine (a routine that makes other C calls).
- */
-#define NON_LEAF(x, fsize, retpc) \
- .globl _C_LABEL(x); \
- .ent _C_LABEL(x), 0; \
-_C_LABEL(x): ; \
- .frame sp, fsize, retpc; \
- MCOUNT
-
-/*
- * NNON_LEAF(x)
- *
- * Declare a non-profiled non-leaf routine
- * (a routine that makes other C calls).
- */
-#define NNON_LEAF(x, fsize, retpc) \
- .globl _C_LABEL(x); \
- .ent _C_LABEL(x), 0; \
-_C_LABEL(x): ; \
- .frame sp, fsize, retpc
-
-/*
- * END(x)
- *
- * Mark end of a procedure.
- */
-#define END(x) \
- .end _C_LABEL(x)
-
-#define STAND_FRAME_SIZE 24
-#define STAND_RA_OFFSET 20
-
-/*
- * Macros to panic and printf from assembly language.
- */
-#define PANIC(msg) \
- la a0, 9f; \
- jal _C_LABEL(panic); \
- MSG(msg)
-
-#define PRINTF(msg) \
- la a0, 9f; \
- jal _C_LABEL(printf); \
- MSG(msg)
-
-#define MSG(msg) \
- .rdata; \
-9: .asciiz msg; \
- .text
-
-#define ASMSTR(str) \
- .asciiz str; \
- .align 2
-
-#endif /* _MACHASMDEFS */
+#include <mips/asm.h>
diff --git a/sys/arch/pmax/include/machConst.h b/sys/arch/pmax/include/machConst.h
index e2e83c8d06b..eda5e7897af 100644
--- a/sys/arch/pmax/include/machConst.h
+++ b/sys/arch/pmax/include/machConst.h
@@ -1,4 +1,4 @@
-/* $NetBSD: machConst.h,v 1.4 1994/10/26 21:09:45 cgd Exp $ */
+/* $NetBSD: machConst.h,v 1.5 1996/03/28 11:34:05 jonathan Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -72,27 +72,102 @@
#define MACH_UNCACHED_TO_PHYS(x) ((unsigned)(x) & 0x1fffffff)
#define MACH_PHYS_TO_UNCACHED(x) ((unsigned)(x) | MACH_UNCACHED_MEMORY_ADDR)
+/* Map virtual address to index in r4k virtually-indexed cache */
+#define MIPS_R4K_VA_TO_CINDEX(x) \
+ ((unsigned)(x) & 0xffffff | MACH_CACHED_MEMORY_ADDR)
+
+/* XXX compatibility with Pica port */
+#define MACH_VA_TO_CINDEX(x) MIPS_R4K_VA_TO_CINDEX(x)
+
+
+/*
+ * XXX
+ * Port-specific constants:
+ * Kernel virtual address at which kernel is loaded, and
+ * Kernel virtual address for user page table entries
+ * (i.e., the address for the context register).
+ */
+#ifdef pmax
#define MACH_CODE_START 0x80030000
+#define VMMACH_PTE_BASE 0xFFC00000
+#endif /* pmax */
+
+#ifdef pica
+#define MACH_CODE_START 0x80080000
+#define VMMACH_PTE_BASE 0xFF800000
+#endif /* pica */
+
+
/*
* The bits in the cause register.
*
+ * Bits common to r3000 and r4000:
+ *
* MACH_CR_BR_DELAY Exception happened in branch delay slot.
* MACH_CR_COP_ERR Coprocessor error.
- * Interrupt pending bits defined below.
+ * MACH_CR_IP Interrupt pending bits defined below.
+ * (same meaning as in CAUSE register).
* MACH_CR_EXC_CODE The exception type (see exception codes below).
+ *
+ * Differences:
+ * r3k has 4 bits of execption type, r4k has 5 bits.
*/
#define MACH_CR_BR_DELAY 0x80000000
#define MACH_CR_COP_ERR 0x30000000
-#define MACH_CR_EXC_CODE 0x0000003C
+#define MIPS_3K_CR_EXC_CODE 0x0000003C
+#define MIPS_4K_CR_EXC_CODE 0x0000007C
+#define MACH_CR_IP 0x0000FF00
#define MACH_CR_EXC_CODE_SHIFT 2
+#ifdef pmax /* XXX not used any more, only to satisfy regression tests */
+#define MACH_CR_EXC_CODE MIPS_3K_CR_EXC_CODE
+#endif /* pmax */
+#ifdef pica
+#define MACH_CR_EXC_CODE MIPS_4K_CR_EXC_CODE
+#endif /* pica */
+
+
/*
* The bits in the status register. All bits are active when set to 1.
*
+ * R3000 status register fields:
* MACH_SR_CO_USABILITY Control the usability of the four coprocessors.
* MACH_SR_BOOT_EXC_VEC Use alternate exception vectors.
* MACH_SR_TLB_SHUTDOWN TLB disabled.
+ *
+ * MIPS_SR_INT_IE Master (current) interrupt enable bit.
+ *
+ * Differences:
+ * r3k has cache control is via frobbing SR register bits, whereas the
+ * r4k cache control is via explicit instructions.
+ * r3k has a 3-entry stack of kernel/user bits, whereas the
+ * r4k has kernel/supervisor/user.
+ */
+#define MACH_SR_COP_USABILITY 0xf0000000
+#define MACH_SR_COP_0_BIT 0x10000000
+#define MACH_SR_COP_1_BIT 0x20000000
+
+ /* r4k and r3k differences, see below */
+
+#define MACH_SR_BOOT_EXC_VEC 0x00400000
+#define MACH_SR_TLB_SHUTDOWN 0x00200000
+
+ /* r4k and r3k differences, see below */
+
+#define MIPS_SR_INT_IE 0x00000001
+/*#define MACH_SR_MBZ 0x0f8000c0*/ /* Never used, true for r3k */
+/*#define MACH_SR_INT_MASK 0x0000ff00*/
+
+#define MACH_SR_INT_ENAB MIPS_SR_INT_IE /* backwards compatibility */
+#define MACH_SR_INT_ENA_CUR MIPS_SR_INT_IE /* backwards compatibility */
+
+
+
+/*
+ * The R2000/R3000-specific status register bit definitions.
+ * all bits are active when set to 1.
+ *
* MACH_SR_PARITY_ERR Parity error.
* MACH_SR_CACHE_MISS Most recent D-cache load resulted in a miss.
* MACH_SR_PARITY_ZERO Zero replaces outgoing parity bits.
@@ -104,60 +179,173 @@
* MACH_SR_KU_PREV Previous kernel/user mode bit. 1 => user mode.
* MACH_SR_INT_ENA_PREV Previous interrupt enable bit.
* MACH_SR_KU_CUR Current kernel/user mode bit. 1 => user mode.
- * MACH_SR_INT_ENA_CUR Current interrupt enable bit.
*/
-#define MACH_SR_COP_USABILITY 0xf0000000
-#define MACH_SR_COP_0_BIT 0x10000000
-#define MACH_SR_COP_1_BIT 0x20000000
-#define MACH_SR_BOOT_EXC_VEC 0x00400000
-#define MACH_SR_TLB_SHUTDOWN 0x00200000
-#define MACH_SR_PARITY_ERR 0x00100000
-#define MACH_SR_CACHE_MISS 0x00080000
-#define MACH_SR_PARITY_ZERO 0x00040000
-#define MACH_SR_SWAP_CACHES 0x00020000
-#define MACH_SR_ISOL_CACHES 0x00010000
-#define MACH_SR_KU_OLD 0x00000020
-#define MACH_SR_INT_ENA_OLD 0x00000010
-#define MACH_SR_KU_PREV 0x00000008
-#define MACH_SR_INT_ENA_PREV 0x00000004
-#define MACH_SR_KU_CUR 0x00000002
-#define MACH_SR_INT_ENA_CUR 0x00000001
-#define MACH_SR_MBZ 0x0f8000c0
+
+#define MIPS_3K_PARITY_ERR 0x00100000
+#define MIPS_3K_CACHE_MISS 0x00080000
+#define MIPS_3K_PARITY_ZERO 0x00040000
+#define MIPS_3K_SWAP_CACHES 0x00020000
+#define MIPS_3K_ISOL_CACHES 0x00010000
+
+#define MIPS_3K_SR_KU_OLD 0x00000020 /* 2nd stacked KU/IE*/
+#define MIPS_3K_SR_INT_ENA_OLD 0x00000010 /* 2nd stacked KU/IE*/
+#define MIPS_3K_SR_KU_PREV 0x00000008 /* 1st stacked KU/IE*/
+#define MIPS_3K_SR_INT_ENA_PREV 0x00000004 /* 1st stacked KU/IE*/
+#define MIPS_3K_SR_KU_CUR 0x00000002 /* current KU */
+
+/* backwards compatibility */
+#define MACH_SR_PARITY_ERR MIPS_3K_PARITY_ERR
+#define MACH_SR_CACHE_MISS MIPS_3K_CACHE_MISS
+#define MACH_SR_PARITY_ZERO MIPS_3K_PARITY_ZERO
+#define MACH_SR_SWAP_CACHES MIPS_3K_SWAP_CACHES
+#define MACH_SR_ISOL_CACHES MIPS_3K_ISOL_CACHES
+
+#define MACH_SR_KU_OLD MIPS_3K_SR_KU_OLD
+#define MACH_SR_INT_ENA_OLD MIPS_3K_SR_INT_ENA_OLD
+#define MACH_SR_KU_PREV MIPS_3K_SR_KU_PREV
+#define MACH_SR_KU_CUR MIPS_3K_SR_KU_CUR
+#define MACH_SR_INT_ENA_PREV MIPS_3K_SR_INT_ENA_PREV
+
+
+/*
+ * R4000 status register bit definitons,
+ * where different from r2000/r3000.
+ */
+#define MIPS_4K_SR_RP 0x08000000
+#define MIPS_4K_SR_FR_32 0x04000000
+#define MIPS_4K_SR_RE 0x02000000
+
+#define MIPS_4K_SR_SOFT_RESET 0x00100000
+#define MIPS_4K_SR_DIAG_CH 0x00040000
+#define MIPS_4K_SR_DIAG_CE 0x00020000
+#define MIPS_4K_SR_DIAG_PE 0x00010000
+#define MIPS_4K_SR_KX 0x00000080
+#define MIPS_4K_SR_SX 0x00000040
+#define MIPS_4K_SR_UX 0x00000020
+#define MIPS_4K_SR_KSU_MASK 0x00000018
+#define MIPS_4K_SR_KSU_USER 0x00000010
+#define MIPS_4K_SR_KSU_SUPER 0x00000008
+#define MIPS_4K_SR_KSU_KERNEL 0x00000000
+#define MIPS_4K_SR_ERL 0x00000004
+#define MIPS_4K_SR_EXL 0x00000002
+
+/* backwards compatibility with names used in Pica port */
+#define MACH_SR_RP MIPS_4K_SR_RP
+#define MACH_SR_FR_32 MIPS_4K_SR_FR_32
+#define MACH_SR_RE MIPS_4K_SR_RE
+
+#define MACH_SR_SOFT_RESET MIPS_4K_SR_SOFT_RESET
+#define MACH_SR_DIAG_CH MIPS_4K_SR_DIAG_CH
+#define MACH_SR_DIAG_CE MIPS_4K_SR_DIAG_CE
+#define MACH_SR_DIAG_PE MIPS_4K_SR_DIAG_PE
+#define MACH_SR_KX MIPS_4K_SR_KX
+#define MACH_SR_SX MIPS_4K_SR_SX
+#define MACH_SR_UX MIPS_4K_SR_UX
+
+#define MACH_SR_KSU_MASK MIPS_4K_SR_KSU_MASK
+#define MACH_SR_KSU_USER MIPS_4K_SR_KSU_USER
+#define MACH_SR_KSU_SUPER MIPS_4K_SR_KSU_SUPER
+#define MACH_SR_KSU_KERNEL MIPS_4K_SR_KSU_KERNEL
+#define MACH_SR_ERL MIPS_4K_SR_ERL
+#define MACH_SR_EXL MIPS_4K_SR_EXL
+
/*
* The interrupt masks.
* If a bit in the mask is 1 then the interrupt is enabled (or pending).
*/
-#define MACH_INT_MASK 0xff00
+#define MIPS_INT_MASK 0xff00
#define MACH_INT_MASK_5 0x8000
#define MACH_INT_MASK_4 0x4000
#define MACH_INT_MASK_3 0x2000
#define MACH_INT_MASK_2 0x1000
#define MACH_INT_MASK_1 0x0800
#define MACH_INT_MASK_0 0x0400
-#define MACH_HARD_INT_MASK 0xfc00
+#define MIPS_HARD_INT_MASK 0xfc00
#define MACH_SOFT_INT_MASK_1 0x0200
#define MACH_SOFT_INT_MASK_0 0x0100
+#ifdef pmax
+#define MACH_INT_MASK MIPS_INT_MASK
+#define MACH_HARD_INT_MASK MIPS_HARD_INT_MASK
+#endif
+
+/* r4000 has on-chip timer at INT_MASK_5 */
+#ifdef pica
+#define MACH_INT_MASK (MIPS_INT_MASK & ~MACH_INT_MASK_5)
+#define MACH_HARD_INT_MASK (MIPS_HARD_INT_MASK & ~MACH_INT_MASK_5)
+#endif
+
+
+
/*
* The bits in the context register.
*/
-#define MACH_CNTXT_PTE_BASE 0xFFE00000
-#define MACH_CNTXT_BAD_VPN 0x001FFFFC
+#define MIPS_3K_CNTXT_PTE_BASE 0xFFE00000
+#define MIPS_3K_CNTXT_BAD_VPN 0x001FFFFC
+
+#define MIPS_4K_CNTXT_PTE_BASE 0xFF800000
+#define MIPS_4K_CNTXT_BAD_VPN2 0x007FFFF0
+
+/*
+ * Backwards compatbility -- XXX more thought
+ */
+#ifdef pmax
+#define MACH_CNTXT_PTE_BASE MIPS_3K_CNTXT_PTE_BASE
+#define MACH_CNTXT_BAD_VPN MIPS_3K_CNTXT_BAD_VPN
+#endif /* pmax */
+
+#ifdef pica
+#define MACH_CNTXT_PTE_BASE MIPS_4K_CNTXT_PTE_BASE
+#define MACH_CNTXT_BAD_VPN2 MIPS_4K_CNTXT_BAD_VPN2
+#endif /* pica */
+
+
/*
* Location of exception vectors.
+ *
+ * Common vectors: reset and UTLB miss.
*/
#define MACH_RESET_EXC_VEC 0xBFC00000
#define MACH_UTLB_MISS_EXC_VEC 0x80000000
-#define MACH_GEN_EXC_VEC 0x80000080
+
+/*
+ * R3000 general exception vector (everything else)
+ */
+#define MIPS_3K_GEN_EXC_VEC 0x80000080
+
+/*
+ * R4000 MIPS-III exception vectors
+ */
+#define MIPS_4K_XTLB_MISS_EXC_VEC 0x80000080
+#define MIPS_4K_CACHE_ERR_EXC_VEC 0x80000100
+#define MIPS_4K_GEN_EXC_VEC 0x80000180
+
+/*
+ * Backwards compatbility -- XXX more thought
+ */
+#ifdef pmax
+#define MACH_GEN_EXC_VEC MIPS_3K_GEN_EXC_VEC
+#endif /* pmax */
+
+#ifdef pica
+#define MACH_GEN_EXC_VEC MIPS_4K_GEN_EXC_VEC
+#define MACH_TLB_MISS_EXC_VEC MACH_UTLB_MISS_EXC_VEC /* locore compat */
+#define MACH_XTLB_MISS_EXC_VEC MIPS_4K_XTLB_MISS_EXC_VEC
+#define MACH_CACHE_ERR_EXC_VEC MIPS_4K_CACHE_ERR_EXC_VEC
+#endif /* pica */
+
+
/*
* Coprocessor 0 registers:
*
* MACH_COP_0_TLB_INDEX TLB index.
* MACH_COP_0_TLB_RANDOM TLB random.
- * MACH_COP_0_TLB_LOW TLB entry low.
+ * MACH_COP_0_TLB_LOW r3k TLB entry low.
+ * MACH_COP_0_TLB_LO0 r4k TLB entry low.
+ * MACH_COP_0_TLB_LO1 r4k TLB entry low, extended.
* MACH_COP_0_TLB_CONTEXT TLB context.
* MACH_COP_0_BAD_VADDR Bad virtual address.
* MACH_COP_0_TLB_HI TLB entry high.
@@ -168,8 +356,10 @@
*/
#define MACH_COP_0_TLB_INDEX $0
#define MACH_COP_0_TLB_RANDOM $1
-#define MACH_COP_0_TLB_LOW $2
+ /* Name and meaning of TLB bits for $2 differ on r3k and r4k. */
+
#define MACH_COP_0_TLB_CONTEXT $4
+ /* $5 and $6 new with MIPS-III */
#define MACH_COP_0_BAD_VADDR $8
#define MACH_COP_0_TLB_HI $10
#define MACH_COP_0_STATUS_REG $12
@@ -177,6 +367,30 @@
#define MACH_COP_0_EXC_PC $14
#define MACH_COP_0_PRID $15
+
+/* r3k-specific */
+#define MACH_COP_0_TLB_LOW $2
+
+/* MIPS-III additions */
+#define MACH_COP_0_TLB_LO0 $2
+#define MACH_COP_0_TLB_LO1 $3
+
+#define MACH_COP_0_TLB_PG_MASK $5
+#define MACH_COP_0_TLB_WIRED $6
+
+#define MACH_COP_0_CONFIG $16
+#define MACH_COP_0_LLADDR $17
+#define MACH_COP_0_WATCH_LO $18
+#define MACH_COP_0_WATCH_HI $19
+#define MACH_COP_0_TLB_XCONTEXT $20
+#define MACH_COP_0_ECC $26
+#define MACH_COP_0_CACHE_ERR $27
+#define MACH_COP_0_TAG_LO $28
+#define MACH_COP_0_TAG_HI $29
+#define MACH_COP_0_ERROR_PC $30
+
+
+
/*
* Values for the code field in a break instruction.
*/
@@ -186,12 +400,15 @@
#define MACH_BREAK_KDB_VAL 512
#define MACH_BREAK_SSTEP_VAL 513
#define MACH_BREAK_BRKPT_VAL 514
+#define MACH_BREAK_SOVER_VAL 515
#define MACH_BREAK_KDB (MACH_BREAK_INSTR | \
(MACH_BREAK_KDB_VAL << MACH_BREAK_VAL_SHIFT))
#define MACH_BREAK_SSTEP (MACH_BREAK_INSTR | \
(MACH_BREAK_SSTEP_VAL << MACH_BREAK_VAL_SHIFT))
#define MACH_BREAK_BRKPT (MACH_BREAK_INSTR | \
(MACH_BREAK_BRKPT_VAL << MACH_BREAK_VAL_SHIFT))
+#define MACH_BREAK_SOVER (MACH_BREAK_INSTR | \
+ (MACH_BREAK_SOVER_VAL << MACH_BREAK_VAL_SHIFT))
/*
* Mininum and maximum cache sizes.
@@ -233,7 +450,10 @@
#define MACH_FPC_EXCEPTION_INVALID 0x00010000
#define MACH_FPC_EXCEPTION_UNIMPL 0x00020000
#define MACH_FPC_COND_BIT 0x00800000
-#define MACH_FPC_MBZ_BITS 0xff7c0000
+#define MACH_FPC_FLUSH_BIT 0x01000000 /* r4k, MBZ on r3k */
+#define MIPS_3K_FPC_MBZ_BITS 0xff7c0000
+#define MIPS_4K_FPC_MBZ_BITS 0xfe7c0000
+
/*
* Constants to determine if have a floating point instruction.
@@ -241,40 +461,117 @@
#define MACH_OPCODE_SHIFT 26
#define MACH_OPCODE_C1 0x11
+
+
/*
* The low part of the TLB entry.
*/
-#define VMMACH_TLB_PF_NUM 0xfffff000
-#define VMMACH_TLB_NON_CACHEABLE_BIT 0x00000800
-#define VMMACH_TLB_MOD_BIT 0x00000400
-#define VMMACH_TLB_VALID_BIT 0x00000200
-#define VMMACH_TLB_GLOBAL_BIT 0x00000100
+#define VMMACH_MIPS_3K_TLB_PHYS_PAGE_SHIFT 12
+#define VMMACH_MIPS_3K_TLB_PF_NUM 0xfffff000
+#define VMMACH_MIPS_3K_TLB_NON_CACHEABLE_BIT 0x00000800
+#define VMMACH_MIPS_3K_TLB_MOD_BIT 0x00000400
+#define VMMACH_MIPS_3K_TLB_VALID_BIT 0x00000200
+#define VMMACH_MIPS_3K_TLB_GLOBAL_BIT 0x00000100
+
+#define VMMACH_MIPS_4K_TLB_PHYS_PAGE_SHIFT 6
+#define VMMACH_MIPS_4K_TLB_PF_NUM 0x3fffffc0
+#define VMMACH_MIPS_4K_TLB_ATTR_MASK 0x00000038
+#define VMMACH_MIPS_4K_TLB_MOD_BIT 0x00000004
+#define VMMACH_MIPS_4K_TLB_VALID_BIT 0x00000002
+#define VMMACH_MIPS_4K_TLB_GLOBAL_BIT 0x00000001
+
+
+#ifdef pmax /* XXX */
+#define VMMACH_TLB_PHYS_PAGE_SHIFT VMMACH_MIPS_3K_TLB_PHYS_PAGE_SHIFT
+#define VMMACH_TLB_PF_NUM VMMACH_MIPS_3K_TLB_PF_NUM
+#define VMMACH_TLB_NON_CACHEABLE_BIT VMMACH_MIPS_3K_TLB_NON_CACHEABLE_BIT
+#define VMMACH_TLB_MOD_BIT VMMACH_MIPS_3K_TLB_MOD_BIT
+#define VMMACH_TLB_VALID_BIT VMMACH_MIPS_3K_TLB_VALID_BIT
+#define VMMACH_TLB_GLOBAL_BIT VMMACH_MIPS_3K_TLB_GLOBAL_BIT
+#endif /* pmax */
+
+#ifdef pica /* XXX */
+#define VMMACH_TLB_PHYS_PAGE_SHIFT VMMACH_MIPS_4K_TLB_PHYS_PAGE_SHIFT
+#define VMMACH_TLB_PF_NUM VMMACH_MIPS_4K_TLB_PF_NUM
+#define VMMACH_TLB_ATTR_MASK VMMACH_MIPS_4K_TLB_ATTR_MASK
+#define VMMACH_TLB_MOD_BIT VMMACH_MIPS_4K_TLB_MOD_BIT
+#define VMMACH_TLB_VALID_BIT VMMACH_MIPS_4K_TLB_VALID_BIT
+#define VMMACH_TLB_GLOBAL_BIT VMMACH_MIPS_4K_TLB_GLOBAL_BIT
+#endif /* pica */
+
-#define VMMACH_TLB_PHYS_PAGE_SHIFT 12
/*
* The high part of the TLB entry.
*/
-#define VMMACH_TLB_VIRT_PAGE_NUM 0xfffff000
-#define VMMACH_TLB_PID 0x00000fc0
-#define VMMACH_TLB_PID_SHIFT 6
-#define VMMACH_TLB_VIRT_PAGE_SHIFT 12
+#define VMMACH_TLB_VIRT_PAGE_SHIFT 12
+
+#define VMMACH_TLB_MIPS_3K_VIRT_PAGE_NUM 0xfffff000
+#define VMMACH_TLB_MIPS_3K_PID 0x00000fc0
+#define VMMACH_TLB_MIPS_3K_PID_SHIFT 6
+#define VMMACH_TLB_MIPS_4K_VIRT_PAGE_NUM 0xffffe000
+#define VMMACH_TLB_MIPS_4K_PID 0x000000ff
+#define VMMACH_TLB_MIPS_4K_PID_SHIFT 0
+
+/* XXX needs more thought */
/*
- * The shift to put the index in the right spot.
+ * backwards XXX needs more thought, should support runtime decisions.
+ */
+
+#ifdef pmax
+#define VMMACH_TLB_VIRT_PAGE_NUM VMMACH_TLB_MIPS_3K_VIRT_PAGE_NUM
+#define VMMACH_TLB_PID VMMACH_TLB_MIPS_3K_PID
+#define VMMACH_TLB_PID_SHIFT VMMACH_TLB_MIPS_3K_PID_SHIFT
+#endif
+
+#ifdef pica
+#define VMMACH_TLB_VIRT_PAGE_NUM VMMACH_TLB_MIPS_4K_VIRT_PAGE_NUM
+#define VMMACH_TLB_PID VMMACH_TLB_MIPS_4K_PID
+#define VMMACH_TLB_PID_SHIFT VMMACH_TLB_MIPS_4K_PID_SHIFT
+#endif
+
+/*
+ * r3000: shift count to put the index in the right spot.
+ * (zero on r4000?)
*/
#define VMMACH_TLB_INDEX_SHIFT 8
+
/*
* The number of TLB entries and the first one that write random hits.
*/
-#define VMMACH_NUM_TLB_ENTRIES 64
-#define VMMACH_FIRST_RAND_ENTRY 8
+#define VMMACH_MIPS_3K_NUM_TLB_ENTRIES 64
+#define VMMACH_MIPS_3K_FIRST_RAND_ENTRY 8
+
+#define VMMACH_MIPS_4K_NUM_TLB_ENTRIES 48
+#define VMMACH_MIPS_4K_WIRED_ENTRIES 8
+
+/* compatibility with existing locore -- XXX more thought */
+#ifdef pmax
+#define VMMACH_NUM_TLB_ENTRIES VMMACH_MIPS_3K_NUM_TLB_ENTRIES
+#define VMMACH_FIRST_RAND_ENTRY VMMACH_MIPS_3K_FIRST_RAND_ENTRY
+#endif /* pmax */
+
+#ifdef pica
+#define VMMACH_NUM_TLB_ENTRIES VMMACH_MIPS_4K_NUM_TLB_ENTRIES
+#define VMMACH_WIRED_ENTRIES VMMACH_MIPS_4K_WIRED_ENTRIES
+#endif /* pica */
+
/*
* The number of process id entries.
*/
-#define VMMACH_NUM_PIDS 64
+#define VMMACH_MIPS_3K_NUM_PIDS 64
+#define VMMACH_MIPS_4K_NUM_PIDS 256
+
+#ifdef pmax
+#define VMMACH_NUM_PIDS VMMACH_MIPS_3K_NUM_PIDS
+#endif /* pmax */
+#ifdef pica
+#define VMMACH_NUM_PIDS VMMACH_MIPS_4K_NUM_PIDS
+#endif /* pica */
+
/*
* TLB probe return codes.
@@ -284,10 +581,4 @@
#define VMMACH_TLB_FOUND_WITH_PATCH 2
#define VMMACH_TLB_PROBE_ERROR 3
-/*
- * Kernel virtual address for user page table entries
- * (i.e., the address for the context register).
- */
-#define VMMACH_PTE_BASE 0xFFC00000
-
#endif /* _MACHCONST */
diff --git a/sys/arch/pmax/include/mips_opcode.h b/sys/arch/pmax/include/mips_opcode.h
index ae4612a9865..44b968860db 100644
--- a/sys/arch/pmax/include/mips_opcode.h
+++ b/sys/arch/pmax/include/mips_opcode.h
@@ -1,196 +1,8 @@
-/* $NetBSD: mips_opcode.h,v 1.4 1994/10/26 21:09:46 cgd Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)mips_opcode.h 8.1 (Berkeley) 6/10/93
- */
+/* $NetBSD: mips_opcode.h,v 1.6 1996/03/23 19:10:06 jonathan Exp $ */
/*
* Define the instruction formats and opcode values for the
* MIPS instruction set.
*/
-/*
- * Define the instruction formats.
- */
-typedef union {
- unsigned word;
-
-#if BYTE_ORDER == LITTLE_ENDIAN
- struct {
- unsigned imm: 16;
- unsigned rt: 5;
- unsigned rs: 5;
- unsigned op: 6;
- } IType;
-
- struct {
- unsigned target: 26;
- unsigned op: 6;
- } JType;
-
- struct {
- unsigned func: 6;
- unsigned shamt: 5;
- unsigned rd: 5;
- unsigned rt: 5;
- unsigned rs: 5;
- unsigned op: 6;
- } RType;
-
- struct {
- unsigned func: 6;
- unsigned fd: 5;
- unsigned fs: 5;
- unsigned ft: 5;
- unsigned fmt: 4;
- unsigned : 1; /* always '1' */
- unsigned op: 6; /* always '0x11' */
- } FRType;
-#endif
-} InstFmt;
-
-/*
- * Values for the 'op' field.
- */
-#define OP_SPECIAL 000
-#define OP_BCOND 001
-#define OP_J 002
-#define OP_JAL 003
-#define OP_BEQ 004
-#define OP_BNE 005
-#define OP_BLEZ 006
-#define OP_BGTZ 007
-
-#define OP_ADDI 010
-#define OP_ADDIU 011
-#define OP_SLTI 012
-#define OP_SLTIU 013
-#define OP_ANDI 014
-#define OP_ORI 015
-#define OP_XORI 016
-#define OP_LUI 017
-
-#define OP_COP0 020
-#define OP_COP1 021
-#define OP_COP2 022
-#define OP_COP3 023
-
-#define OP_LB 040
-#define OP_LH 041
-#define OP_LWL 042
-#define OP_LW 043
-#define OP_LBU 044
-#define OP_LHU 045
-#define OP_LWR 046
-
-#define OP_SB 050
-#define OP_SH 051
-#define OP_SWL 052
-#define OP_SW 053
-#define OP_SWR 056
-
-#define OP_LWC0 060
-#define OP_LWC1 061
-#define OP_LWC2 062
-#define OP_LWC3 063
-
-#define OP_SWC0 070
-#define OP_SWC1 071
-#define OP_SWC2 072
-#define OP_SWC3 073
-
-/*
- * Values for the 'func' field when 'op' == OP_SPECIAL.
- */
-#define OP_SLL 000
-#define OP_SRL 002
-#define OP_SRA 003
-#define OP_SLLV 004
-#define OP_SRLV 006
-#define OP_SRAV 007
-
-#define OP_JR 010
-#define OP_JALR 011
-#define OP_SYSCALL 014
-#define OP_BREAK 015
-
-#define OP_MFHI 020
-#define OP_MTHI 021
-#define OP_MFLO 022
-#define OP_MTLO 023
-
-#define OP_MULT 030
-#define OP_MULTU 031
-#define OP_DIV 032
-#define OP_DIVU 033
-
-#define OP_ADD 040
-#define OP_ADDU 041
-#define OP_SUB 042
-#define OP_SUBU 043
-#define OP_AND 044
-#define OP_OR 045
-#define OP_XOR 046
-#define OP_NOR 047
-
-#define OP_SLT 052
-#define OP_SLTU 053
-
-/*
- * Values for the 'func' field when 'op' == OP_BCOND.
- */
-#define OP_BLTZ 000
-#define OP_BGEZ 001
-#define OP_BLTZAL 020
-#define OP_BGEZAL 021
-
-/*
- * Values for the 'rs' field when 'op' == OP_COPz.
- */
-#define OP_MF 000
-#define OP_MT 004
-#define OP_BCx 010
-#define OP_BCy 014
-#define OP_CF 002
-#define OP_CT 006
-
-/*
- * Values for the 'rt' field when 'op' == OP_COPz.
- */
-#define COPz_BC_TF_MASK 0x01
-#define COPz_BC_TRUE 0x01
-#define COPz_BC_FALSE 0x00
+#include <mips/mips_opcode.h>
diff --git a/sys/arch/pmax/include/param.h b/sys/arch/pmax/include/param.h
index 5e8c41ea55a..69e3cbff851 100644
--- a/sys/arch/pmax/include/param.h
+++ b/sys/arch/pmax/include/param.h
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.12 1995/07/23 20:11:55 jonathan Exp $ */
+/* $NetBSD: param.h,v 1.17 1996/05/20 10:50:52 jonathan Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -43,28 +43,20 @@
*/
/*
- * Machine dependent constants for DEC Station 3100.
+ * Machine-dependent constants (VM, etc) common across MIPS cpus
*/
-#define MACHINE "pmax"
-#define MACHINE_ARCH "mips"
-#define MID_MACHINE MID_PMAX
+
+#include <mips/mips_param.h>
/*
- * Round p (pointer or byte index) up to a correctly-aligned value for all
- * data types (int, long, ...). The result is u_int and must be cast to
- * any desired pointer type.
+ * Machine dependent constants for DEC Station 3100.
*/
-#define ALIGNBYTES 7
-#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
-
-#define NBPG 4096 /* bytes/page */
-#define PGOFSET (NBPG-1) /* byte offset into page */
-#define PGSHIFT 12 /* LOG2(NBPG) */
-#define NPTEPG (NBPG/4)
-#define NBSEG 0x400000 /* bytes/segment */
-#define SEGOFSET (NBSEG-1) /* byte offset into segment */
-#define SEGSHIFT 22 /* LOG2(NBSEG) */
+#define _MACHINE pmax
+#define MACHINE "pmax"
+#define _MACHINE_ARCH mips
+#define MACHINE_ARCH "mips"
+#define MID_MACHINE MID_PMAX
#define KERNBASE 0x80000000 /* start of kernel virtual */
#define KERNTEXTOFF 0x80030000 /* start of kernel text for kvm_mkdb */
@@ -101,59 +93,15 @@
#define MCLOFSET (MCLBYTES - 1)
#ifndef NMBCLUSTERS
#ifdef GATEWAY
-#define NMBCLUSTERS 512 /* map size, max cluster allocation */
+#define NMBCLUSTERS 2048 /* map size, max cluster allocation */
#else
-#define NMBCLUSTERS 256 /* map size, max cluster allocation */
+#define NMBCLUSTERS 1024 /* map size, max cluster allocation */
#endif
#endif
-/*
- * Size of kernel malloc arena in CLBYTES-sized logical pages
- */
-#ifndef NKMEMCLUSTERS
-#define NKMEMCLUSTERS (512*1024/CLBYTES)
-#endif
-
-/* pages ("clicks") (4096 bytes) to disk blocks */
-#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
-#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))
-
-/* pages to bytes */
-#define ctob(x) ((x) << PGSHIFT)
-#define btoc(x) (((x) + PGOFSET) >> PGSHIFT)
-
-/* bytes to disk blocks */
-#define btodb(x) ((x) >> DEV_BSHIFT)
-#define dbtob(x) ((x) << DEV_BSHIFT)
-
-/*
- * Map a ``block device block'' to a file system block.
- * This should be device dependent, and should use the bsize
- * field from the disk label.
- * For now though just use DEV_BSIZE.
- */
-#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
-
-/*
- * Mach derived conversion macros
- */
-#define pmax_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
-#define pmax_trunc_page(x) ((unsigned)(x) & ~(NBPG-1))
-#define pmax_btop(x) ((unsigned)(x) >> PGSHIFT)
-#define pmax_ptob(x) ((unsigned)(x) << PGSHIFT)
-
#ifdef _KERNEL
-#ifndef LOCORE
-extern int (*Mach_splnet) __P((void)), (*Mach_splbio) __P((void)),
- (*Mach_splimp) __P((void)), (*Mach_spltty) __P((void)),
- (*Mach_splclock) __P((void)), (*Mach_splstatclock) __P((void));
-#define splnet() ((*Mach_splnet)())
-#define splbio() ((*Mach_splbio)())
-#define splimp() ((*Mach_splimp)())
-#define spltty() ((*Mach_spltty)())
-#define splclock() ((*Mach_splclock)())
-#define splstatclock() ((*Mach_splstatclock)())
-extern int cpuspeed;
+#ifndef _LOCORE
+extern int cpuspeed;
#define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); }
#endif
#endif /* !_KERNEL */
diff --git a/sys/arch/pmax/include/pcb.h b/sys/arch/pmax/include/pcb.h
index 9f59b6f35ef..8de6211784c 100644
--- a/sys/arch/pmax/include/pcb.h
+++ b/sys/arch/pmax/include/pcb.h
@@ -1,62 +1,3 @@
-/* $NetBSD: pcb.h,v 1.5 1995/01/18 06:39:43 mellon Exp $ */
+/* $NetBSD: pcb.h,v 1.7 1996/03/19 03:07:49 jonathan Exp $ */
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * from: Utah Hdr: pcb.h 1.13 89/04/23
- *
- * @(#)pcb.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * PMAX process control block
- */
-struct pcb
-{
- int pcb_regs[71]; /* saved CPU and floating point registers */
- label_t pcb_context; /* kernel context for resume */
- int pcb_onfault; /* for copyin/copyout faults */
- void *pcb_segtab; /* copy of pmap pm_segtab */
-};
-
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. For the PMAX, there is nothing to add.
- */
-struct md_coredump {
- long md_pad[8];
-};
+#include <mips/pcb.h>
diff --git a/sys/arch/pmax/include/pmap.h b/sys/arch/pmax/include/pmap.h
index 392b00aff3a..fba34a17110 100644
--- a/sys/arch/pmax/include/pmap.h
+++ b/sys/arch/pmax/include/pmap.h
@@ -1,105 +1,6 @@
-/* $NetBSD: pmap.h,v 1.8 1995/04/12 01:55:35 mellon Exp $ */
+/* $NetBSD: pmap.h,v 1.10 1996/03/19 04:39:05 jonathan Exp $ */
-/*
- * Copyright (c) 1987 Carnegie-Mellon University
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)pmap.h 8.1 (Berkeley) 6/10/93
- */
+#include <mips/pmap.h>
-#ifndef _PMAP_MACHINE_
-#define _PMAP_MACHINE_
-
-/*
- * The user address space is 2Gb (0x0 - 0x80000000).
- * User programs are laid out in memory as follows:
- * address
- * USRTEXT 0x00001000
- * USRDATA USRTEXT + text_size
- * USRSTACK 0x7FFFFFFF
- *
- * The user address space is mapped using a two level structure where
- * virtual address bits 30..22 are used to index into a segment table which
- * points to a page worth of PTEs (4096 page can hold 1024 PTEs).
- * Bits 21..12 are then used to index a PTE which describes a page within
- * a segment.
- *
- * The wired entries in the TLB will contain the following:
- * 0-1 (UPAGES) for curproc user struct and kernel stack.
- *
- * Note: The kernel doesn't use the same data structures as user programs.
- * All the PTE entries are stored in a single array in Sysmap which is
- * dynamically allocated at boot time.
- */
-
-#define pmax_trunc_seg(x) ((vm_offset_t)(x) & ~SEGOFSET)
-#define pmax_round_seg(x) (((vm_offset_t)(x) + SEGOFSET) & ~SEGOFSET)
-#define pmap_segmap(m, v) ((m)->pm_segtab->seg_tab[((v) >> SEGSHIFT)])
-
-#define PMAP_SEGTABSIZE 512
-
-union pt_entry;
-
-struct segtab {
- union pt_entry *seg_tab[PMAP_SEGTABSIZE];
-};
-
-/*
- * Machine dependent pmap structure.
- */
-typedef struct pmap {
- int pm_count; /* pmap reference count */
- simple_lock_data_t pm_lock; /* lock on pmap */
- struct pmap_statistics pm_stats; /* pmap statistics */
- int pm_tlbpid; /* address space tag */
- u_int pm_tlbgen; /* TLB PID generation number */
- struct segtab *pm_segtab; /* pointers to pages of PTEs */
-} *pmap_t;
-
-/*
- * Defines for pmap_attributes[phys_mach_page];
- */
-#define PMAP_ATTR_MOD 0x01 /* page has been modified */
-#define PMAP_ATTR_REF 0x02 /* page has been referenced */
-
-#ifdef _KERNEL
-char *pmap_attributes; /* reference and modify bits */
-struct pmap kernel_pmap_store;
-
-#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
-#define pmap_kernel() (&kernel_pmap_store)
-#endif /* _KERNEL */
-
-#endif /* _PMAP_MACHINE_ */
+#define pmax_trunc_seg(a) mips_trunc_seg(a)
+#define pmax_round_seg(a) mips_round_seg(a)
diff --git a/sys/arch/pmax/include/proc.h b/sys/arch/pmax/include/proc.h
index 202d9562314..b722ad6088b 100644
--- a/sys/arch/pmax/include/proc.h
+++ b/sys/arch/pmax/include/proc.h
@@ -1,53 +1,3 @@
-/* $NetBSD: proc.h,v 1.4 1994/10/26 21:09:52 cgd Exp $ */
+/* $NetBSD: proc.h,v 1.5 1996/03/19 03:08:08 jonathan Exp $ */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)proc.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * Machine-dependent part of the proc structure for DEC Station.
- */
-struct mdproc {
- int *md_regs; /* registers on current frame */
- int md_flags; /* machine-dependent flags */
- int md_upte[UPAGES]; /* ptes for mapping u page */
- int md_ss_addr; /* single step address for ptrace */
- int md_ss_instr; /* single step instruction for ptrace */
-};
-
-/* md_flags */
-#define MDP_FPUSED 0x0001 /* floating point coprocessor used */
+#include <mips/proc.h>
diff --git a/sys/arch/pmax/include/profile.h b/sys/arch/pmax/include/profile.h
index 661183549e8..2a57a4d45c2 100644
--- a/sys/arch/pmax/include/profile.h
+++ b/sys/arch/pmax/include/profile.h
@@ -1,79 +1,3 @@
-/* $NetBSD: profile.h,v 1.6 1995/05/31 00:25:06 jonathan Exp $ */
+/* $NetBSD: profile.h,v 1.7 1996/03/19 03:08:27 jonathan Exp $ */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)profile.h 8.1 (Berkeley) 6/10/93
- */
-
-#define _MCOUNT_DECL static void __mcount
-
-#define MCOUNT \
- __asm(".globl _mcount;" \
- "_mcount:;" \
- ".set noreorder;" \
- ".set noat;" \
- "sw $4,8($29);" \
- "sw $5,12($29);" \
- "sw $6,16($29);" \
- "sw $7,20($29);" \
- "sw $1,0($29);" \
- "sw $31,4($29);" \
- "move $5,$31;" \
- "jal ___mcount;" \
- "move $4,$1;" \
- "lw $4,8($29);" \
- "lw $5,12($29);" \
- "lw $6,16($29);" \
- "lw $7,20($29);" \
- "lw $31,4($29);" \
- "lw $1,0($29);" \
- "addu $29,$29,8;" \
- "j $31;" \
- "move $31,$1;" \
- ".set reorder;" \
- ".set at");
-
-#ifdef _KERNEL
-/*
- * The following two macros do splhigh and splx respectively.
- * They have to be defined this way because these are real
- * functions on the PMAX, and we do not want to invoke mcount
- * recursively.
- */
-#define MCOUNT_ENTER s = _splhigh()
-
-#define MCOUNT_EXIT _splx(s)
-#endif /* _KERNEL */
+#include <mips/profile.h>
diff --git a/sys/arch/pmax/include/pte.h b/sys/arch/pmax/include/pte.h
index 9a0e4e9fa9e..599f0265a8c 100644
--- a/sys/arch/pmax/include/pte.h
+++ b/sys/arch/pmax/include/pte.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.5 1995/03/28 18:19:26 jtc Exp $ */
+/* $NetBSD: pte.h,v 1.6 1996/02/01 22:32:15 mycroft Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -46,7 +46,7 @@
* R2000 hardware page table entry
*/
-#ifndef LOCORE
+#ifndef _LOCORE
struct pte {
#if BYTE_ORDER == BIG_ENDIAN
unsigned int pg_pfnum:20, /* HW: core page frame number or 0 */
@@ -76,7 +76,7 @@ typedef union pt_entry {
unsigned int pt_entry; /* for copying, etc. */
struct pte pt_pte; /* for getting to bits by name */
} pt_entry_t; /* Mach page table entry */
-#endif /* LOCORE */
+#endif /* _LOCORE */
#define PT_ENTRY_NULL ((pt_entry_t *) 0)
@@ -93,7 +93,7 @@ typedef union pt_entry {
#define PG_SHIFT 12
#define PG_PFNUM(x) (((x) & PG_FRAME) >> PG_SHIFT)
-#if defined(_KERNEL) && !defined(LOCORE)
+#if defined(_KERNEL) && !defined(_LOCORE)
/*
* Kernel virtual address to page table entry and visa versa.
*/
diff --git a/sys/arch/pmax/include/ptrace.h b/sys/arch/pmax/include/ptrace.h
index f3ce907933e..fbf8a1aac7d 100644
--- a/sys/arch/pmax/include/ptrace.h
+++ b/sys/arch/pmax/include/ptrace.h
@@ -1,50 +1,3 @@
-/* $NetBSD: ptrace.h,v 1.6 1995/12/21 09:28:36 jonathan Exp $ */
+/* $NetBSD: ptrace.h,v 1.7 1996/03/19 04:39:01 jonathan Exp $ */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)ptrace.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * Mips-dependent ptrace definitions.
- *
- */
-
-/*#define PT_STEP (PT_FIRSTMACH + 0)*/
-#define PT_GETREGS (PT_FIRSTMACH + 1)
-#define PT_SETREGS (PT_FIRSTMACH + 2)
-
-#ifdef notyet
-#define PT_GETFPREGS (PT_FIRSTMACH + 3)
-#define PT_SETFPREGS (PT_FIRSTMACH + 4)
-#endif
+#include <mips/ptrace.h>
diff --git a/sys/arch/pmax/include/reg.h b/sys/arch/pmax/include/reg.h
index f91820dc359..dd0ab28e08e 100644
--- a/sys/arch/pmax/include/reg.h
+++ b/sys/arch/pmax/include/reg.h
@@ -1,62 +1,3 @@
-/* $NetBSD: reg.h,v 1.6 1995/12/20 02:00:27 jonathan Exp $ */
+/* $NetBSD: reg.h,v 1.7 1996/03/19 03:08:36 jonathan Exp $ */
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * from: Utah Hdr: reg.h 1.1 90/07/09
- *
- * @(#)reg.h 8.2 (Berkeley) 1/11/94
- */
-
-#ifndef _MACHINE_REG_H_
-#define _MACHINE_REG_H_
-/*
- * Location of the users' stored
- * registers relative to ZERO.
- * Usage is p->p_regs[XX].
- *
- * must be visible to assembly code.
- */
-#include <machine/regnum.h>
-
-/*
- * Register set accessible via /proc/$pid/reg
- */
-struct reg {
- int r_regs[71]; /* numbered as above */
-};
-#endif /*_MACHINE_REG_H_*/
+#include <mips/reg.h>
diff --git a/sys/arch/pmax/include/regdef.h b/sys/arch/pmax/include/regdef.h
index 46216b57d00..848ddfab9d6 100644
--- a/sys/arch/pmax/include/regdef.h
+++ b/sys/arch/pmax/include/regdef.h
@@ -1,73 +1,3 @@
-/* $NetBSD: regdef.h,v 1.4 1994/10/26 21:09:58 cgd Exp $ */
+/* $NetBSD: regdef.h,v 1.5 1996/03/19 03:08:41 jonathan Exp $ */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell. This file is derived from the MIPS RISC
- * Architecture book by Gerry Kane.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)regdef.h 8.1 (Berkeley) 6/10/93
- */
-
-#define zero $0 /* always zero */
-#define AT $at /* assembler temp */
-#define v0 $2 /* return value */
-#define v1 $3
-#define a0 $4 /* argument registers */
-#define a1 $5
-#define a2 $6
-#define a3 $7
-#define t0 $8 /* temp registers (not saved across subroutine calls) */
-#define t1 $9
-#define t2 $10
-#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
-#define s0 $16 /* saved across subroutine calls (callee saved) */
-#define s1 $17
-#define s2 $18
-#define s3 $19
-#define s4 $20
-#define s5 $21
-#define s6 $22
-#define s7 $23
-#define t8 $24 /* two more temp registers */
-#define t9 $25
-#define k0 $26 /* kernel temporary */
-#define k1 $27
-#define gp $28 /* global pointer */
-#define sp $29 /* stack pointer */
-#define s8 $30 /* one more callee saved */
-#define ra $31 /* return address */
+#include <mips/regdef.h>
diff --git a/sys/arch/pmax/include/regnum.h b/sys/arch/pmax/include/regnum.h
index fe92e582eeb..f62b9ce04e5 100644
--- a/sys/arch/pmax/include/regnum.h
+++ b/sys/arch/pmax/include/regnum.h
@@ -1,145 +1,3 @@
-/* $NetBSD: regnum.h,v 1.1 1995/12/20 02:00:28 jonathan Exp $ */
+/* $NetBSD: regnum.h,v 1.3 1996/03/20 09:49:30 jonathan Exp $ */
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * from: Utah Hdr: reg.h 1.1 90/07/09
- *
- * @(#)reg.h 8.2 (Berkeley) 1/11/94
- */
-
-/*
- * Location of the users' stored
- * registers relative to ZERO.
- * Usage is p->p_regs[XX].
- */
-#define ZERO 0
-#define AST 1
-#define V0 2
-#define V1 3
-#define A0 4
-#define A1 5
-#define A2 6
-#define A3 7
-#define T0 8
-#define T1 9
-#define T2 10
-#define T3 11
-#define T4 12
-#define T5 13
-#define T6 14
-#define T7 15
-#define S0 16
-#define S1 17
-#define S2 18
-#define S3 19
-#define S4 20
-#define S5 21
-#define S6 22
-#define S7 23
-#define T8 24
-#define T9 25
-#define K0 26
-#define K1 27
-#define GP 28
-#define SP 29
-#define S8 30
-#define RA 31
-#define SR 32
-#define PS SR /* alias for SR */
-#define MULLO 33
-#define MULHI 34
-#define BADVADDR 35
-#define CAUSE 36
-#define PC 37
-
-#define FPBASE 38
-#define F0 (FPBASE+0)
-#define F1 (FPBASE+1)
-#define F2 (FPBASE+2)
-#define F3 (FPBASE+3)
-#define F4 (FPBASE+4)
-#define F5 (FPBASE+5)
-#define F6 (FPBASE+6)
-#define F7 (FPBASE+7)
-#define F8 (FPBASE+8)
-#define F9 (FPBASE+9)
-#define F10 (FPBASE+10)
-#define F11 (FPBASE+11)
-#define F12 (FPBASE+12)
-#define F13 (FPBASE+13)
-#define F14 (FPBASE+14)
-#define F15 (FPBASE+15)
-#define F16 (FPBASE+16)
-#define F17 (FPBASE+17)
-#define F18 (FPBASE+18)
-#define F19 (FPBASE+19)
-#define F20 (FPBASE+20)
-#define F21 (FPBASE+21)
-#define F22 (FPBASE+22)
-#define F23 (FPBASE+23)
-#define F24 (FPBASE+24)
-#define F25 (FPBASE+25)
-#define F26 (FPBASE+26)
-#define F27 (FPBASE+27)
-#define F28 (FPBASE+28)
-#define F29 (FPBASE+29)
-#define F30 (FPBASE+30)
-#define F31 (FPBASE+31)
-#define FSR (FPBASE+32)
-
-#ifdef IPCREG
-#define NIPCREG (FSR + 1)
-int ipcreg[NIPCREG] = {
- ZERO, AST, V0, V1, A0, A1, A2, A3, T0, T1, T2, T3, T4, T5, T6, T7,
- S0, S1, S2, S3, S4, S5, S6, S7, T8, T9, K0, K1, GP, SP, S8, RA,
- SR, MULLO, MULHI, BADVADDR, CAUSE, PC,
- F0, F1, F2, F3, F4, F5, F6, F7,
- F8, F9, F10, F11, F12, F13, F14, F15,
- F16, F17, F18, F19, F20, F21, F22, F23,
- F24, F25, F26, F27, F28, F29, F30, F31, FSR,
-};
-#endif
-
-#ifdef LANGUAGE_C
-/*
- * Register set accessible via /proc/$pid/reg
- */
-struct reg {
- int r_regs[71]; /* numbered as above */
-};
-#endif /* LANGUAGE_C */
+#include <mips/regnum.h>
diff --git a/sys/arch/pmax/include/reloc.h b/sys/arch/pmax/include/reloc.h
index f81a086fdc1..a352fe1ec87 100644
--- a/sys/arch/pmax/include/reloc.h
+++ b/sys/arch/pmax/include/reloc.h
@@ -1,74 +1,5 @@
-/* $NetBSD: reloc.h,v 1.4 1994/10/26 21:09:59 cgd Exp $ */
+/* $NetBSD: reloc.h,v 1.6 1996/03/20 09:49:29 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)reloc.h 8.1 (Berkeley) 6/10/93
- *
- * from: Header: reloc.h,v 1.6 92/06/20 09:59:37 torek Exp
- */
+#include <mips/reloc.h>
-/*
- * MIPS relocation types.
- */
-enum reloc_type {
- MIPS_RELOC_32, /* 32-bit absolute */
- MIPS_RELOC_JMP, /* 26-bit absolute << 2 | high 4 bits of pc */
- MIPS_RELOC_WDISP16, /* 16-bit signed pc-relative << 2 */
- MIPS_RELOC_HI16, /* 16-bit absolute << 16 */
- MIPS_RELOC_HI16_S, /* 16-bit absolute << 16 (+1 if needed) */
- MIPS_RELOC_LO16, /* 16-bit absolute */
-};
-
-/*
- * MIPS relocation info.
- *
- * Symbol-relative relocation is done by:
- * 1. start with the value r_addend,
- * 2. locate the appropriate symbol and if defined, add symbol value,
- * 3. if pc relative, subtract pc,
- * 4. if the reloc_type is MIPS_RELOC_HI16_S and the result bit 15 is set,
- * add 0x00010000,
- * 5. shift down 2 or 16 if necessary.
- * The resulting value is then to be stuffed into the appropriate bits
- * in the object (the low 16, or the low 26 bits).
- */
-struct reloc_info_pmax {
- u_long r_address; /* relocation addr (offset in segment) */
- u_int r_index:24, /* segment (r_extern==0) or symbol index */
- r_extern:1, /* if set, r_index is symbol index */
- :2; /* unused */
- enum reloc_type r_type:5; /* relocation type, from above */
- long r_addend; /* value to add to symbol value */
-};
-
-#define relocation_info reloc_info_pmax
+#define relocation_info_pmax reloc_info_mips
diff --git a/sys/arch/pmax/include/setjmp.h b/sys/arch/pmax/include/setjmp.h
index c50d15c79b5..bcfa694662a 100644
--- a/sys/arch/pmax/include/setjmp.h
+++ b/sys/arch/pmax/include/setjmp.h
@@ -1,7 +1,3 @@
-/* $NetBSD: setjmp.h,v 1.1 1994/12/20 10:37:05 cgd Exp $ */
+/* $NetBSD: setjmp.h,v 1.2 1996/03/19 03:08:46 jonathan Exp $ */
-/*
- * machine/setjmp.h: machine dependent setjmp-related information.
- */
-
-#define _JBLEN 83 /* size, in longs, of a jmp_buf */
+#include <mips/setjmp.h>
diff --git a/sys/arch/pmax/include/signal.h b/sys/arch/pmax/include/signal.h
index ea997dc33a8..350de4fbf11 100644
--- a/sys/arch/pmax/include/signal.h
+++ b/sys/arch/pmax/include/signal.h
@@ -1,66 +1,3 @@
-/* $NetBSD: signal.h,v 1.6 1995/01/18 06:42:01 mellon Exp $ */
+/* $NetBSD: signal.h,v 1.8 1996/03/19 04:39:07 jonathan Exp $ */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)signal.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * Machine-dependent signal definitions
- */
-
-typedef int sig_atomic_t;
-
-#ifndef _ANSI_SOURCE
-/*
- * Information pushed on stack when a signal is delivered.
- * This is used by the kernel to restore state following
- * execution of the signal handler. It is also made available
- * to the handler to allow it to restore state properly if
- * a non-standard exit is performed.
- */
-struct sigcontext {
- int sc_onstack; /* sigstack state to restore */
- int sc_mask; /* signal mask to restore */
- int sc_pc; /* pc at time of signal */
- int sc_regs[32]; /* processor regs 0 to 31 */
- int mullo, mulhi; /* mullo and mulhi registers... */
- int sc_fpused; /* fp has been used */
- int sc_fpregs[33]; /* fp regs 0 to 31 and csr */
- int sc_fpc_eir; /* floating point exception instruction reg */
-};
-
-#endif /* !_ANSI_SOURCE */
+#include <mips/signal.h>
diff --git a/sys/arch/pmax/include/stdarg.h b/sys/arch/pmax/include/stdarg.h
index c9a644c1ef8..2bb98006638 100644
--- a/sys/arch/pmax/include/stdarg.h
+++ b/sys/arch/pmax/include/stdarg.h
@@ -1,56 +1,3 @@
-/* $NetBSD: stdarg.h,v 1.10 1995/12/25 23:15:35 mycroft Exp $ */
+/* $NetBSD: stdarg.h,v 1.12 1996/03/19 03:08:51 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)stdarg.h 8.1 (Berkeley) 6/10/93
- */
-
-#ifndef _PMAX_STDARG_H_
-#define _PMAX_STDARG_H_
-
-#include <machine/ansi.h>
-
-typedef _BSD_VA_LIST_ va_list;
-
-#define __va_size(type) \
- (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
-
-#define va_start(ap, last) \
- ((ap) = (va_list)&(last) + __va_size(last))
-
-#define va_arg(ap, type) \
- (*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
-
-#define va_end(ap) ((void)0)
-
-#endif /* !_PMAX_STDARG_H_ */
+#include <mips/stdarg.h>
diff --git a/sys/arch/pmax/include/tc_machdep.h b/sys/arch/pmax/include/tc_machdep.h
index 7768aebd269..44e620ea4a2 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.1 1995/12/28 08:42:17 jonathan Exp $ */
+/* $NetBSD: tc_machdep.h,v 1.3.4.1 1996/05/30 04:07:39 mhitch Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -60,6 +60,8 @@
#ifndef __MACHINE_TC_MACHDEP_H__
#define __MACHINE_TC_MACHDEP_H__
+#include <mips/cpuregs.h> /* defines MACH_PHYS_TO_UNCACHED */
+
typedef int32_t tc_addr_t;
typedef int32_t tc_offset_t;
@@ -74,11 +76,36 @@ typedef int32_t tc_offset_t;
#define tc_badaddr(tcaddr) \
badaddr((void *)(tcaddr), sizeof (u_int32_t))
-
-#define TC_DENSE_TO_SPARSE(addr) \
- (addr)
+#define TC_DENSE_TO_SPARSE(addr) (addr)
-#define TC_PHYS_TO_UNCACHED(addr) \
- (addr)
+#define TC_PHYS_TO_UNCACHED(addr) MACH_PHYS_TO_UNCACHED(addr)
+
+
+/*
+ * Use the following macros to compare device names on a pmax, as
+ * the autoconfig structs are in a state of flux.
+ */
+struct confargs;
+
+#define TC_BUS_MATCHNAME(ta, name) \
+ (strncmp( (ta)->ta_modname, (name), TC_ROM_LLEN+1) == 0)
+
+/*
+ * Port-specific declarations:
+ * Declarations "private" sys/dev/tc/tc.c MI functions used to search
+ * for potential TC-option console devices (framebuffers),
+ */
+int tc_checkslot __P((tc_addr_t slotbase, char *namep));
+
+/*
+ * And declarations for the MD function used to search for and configure
+ * a TC framebuffer as system console, and to configure the TC bus
+ * (the last is a hack).
+ */
+
+extern int tc_findconsole __P((int preferred_slot));
+extern void config_tcbus __P((struct device *parent, int cputype,
+ int printfn __P((void*, char*)) ));
+
#endif /* __MACHINE_TC_MACHDEP_H__*/
diff --git a/sys/arch/pmax/include/trap.h b/sys/arch/pmax/include/trap.h
index 72dc62edfdd..0ae8075953b 100644
--- a/sys/arch/pmax/include/trap.h
+++ b/sys/arch/pmax/include/trap.h
@@ -1,64 +1,3 @@
-/* $NetBSD: trap.h,v 1.4 1994/10/26 21:10:04 cgd Exp $ */
+/* $NetBSD: trap.h,v 1.7 1996/03/24 08:17:06 jonathan Exp $ */
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * from: Utah Hdr: trap.h 1.1 90/07/09
- *
- * @(#)trap.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * Trap codes
- * also known in trap.c for name strings
- */
-
-#define T_INT 0 /* Interrupt pending */
-#define T_TLB_MOD 1 /* TLB modified fault */
-#define T_TLB_LD_MISS 2 /* TLB miss on load or ifetch */
-#define T_TLB_ST_MISS 3 /* TLB miss on a store */
-#define T_ADDR_ERR_LD 4 /* Address error on a load or ifetch */
-#define T_ADDR_ERR_ST 5 /* Address error on a store */
-#define T_BUS_ERR_IFETCH 6 /* Bus error on an ifetch */
-#define T_BUS_ERR_LD_ST 7 /* Bus error on a load or store */
-#define T_SYSCALL 8 /* System call */
-#define T_BREAK 9 /* Breakpoint */
-#define T_RES_INST 10 /* Reserved instruction exception */
-#define T_COP_UNUSABLE 11 /* Coprocessor unusable */
-#define T_OVFLOW 12 /* Arithmetic overflow */
-
-#define T_USER 0x10 /* user-mode flag or'ed with type */
+#include <mips/trap.h>
diff --git a/sys/arch/pmax/include/types.h b/sys/arch/pmax/include/types.h
index 828a01acacb..f35e61528d2 100644
--- a/sys/arch/pmax/include/types.h
+++ b/sys/arch/pmax/include/types.h
@@ -1,81 +1,3 @@
-/* $NetBSD: types.h,v 1.11 1995/12/09 04:41:47 mycroft Exp $ */
+/* $NetBSD: types.h,v 1.12 1996/03/19 05:18:26 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)types.h 8.3 (Berkeley) 1/5/94
- */
-
-#ifndef _MACHTYPES_H_
-#define _MACHTYPES_H_
-
-#include <sys/cdefs.h>
-
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-typedef struct _physadr {
- int r[1];
-} *physadr;
-
-typedef struct label_t {
- int val[12];
-} label_t;
-#endif
-
-typedef unsigned long vm_offset_t;
-typedef unsigned long vm_size_t;
-
-/*
- * Basic integral types. Omit the typedef if
- * not possible for a machine/compiler combination.
- */
-#define __BIT_TYPES_DEFINED__
-typedef __signed char int8_t;
-typedef unsigned char u_int8_t;
-typedef short int16_t;
-typedef unsigned short u_int16_t;
-typedef int int32_t;
-typedef unsigned int u_int32_t;
-/* LONGLONG */
-typedef long long int64_t;
-/* LONGLONG */
-typedef unsigned long long u_int64_t;
-
-typedef int32_t register_t;
-
-#define __BDEVSW_DUMP_OLD_TYPE
-#define __SWAP_BROKEN
-#define __FORK_BRAINDAMAGE
-
-#endif /* _MACHTYPES_H_ */
+#include <mips/types.h>
diff --git a/sys/arch/pmax/include/varargs.h b/sys/arch/pmax/include/varargs.h
index db59d3d5892..f5427bc90c1 100644
--- a/sys/arch/pmax/include/varargs.h
+++ b/sys/arch/pmax/include/varargs.h
@@ -1,61 +1,3 @@
-/* $NetBSD: varargs.h,v 1.12 1995/12/26 01:16:31 mycroft Exp $ */
+/* $NetBSD: varargs.h,v 1.14 1996/03/20 09:49:31 jonathan Exp $ */
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)varargs.h 8.2 (Berkeley) 3/22/94
- */
-
-#ifndef _PMAX_VARARGS_H_
-#define _PMAX_VARARGS_H_
-
-#include <machine/stdarg.h>
-
-#if __GNUC__ == 1
-#define __va_ellipsis
-#else
-#define __va_ellipsis ...
-#endif
-
-#define va_alist __builtin_va_alist
-#define va_dcl long __builtin_va_alist; __va_ellipsis
-
-#undef va_start
-#define va_start(ap) \
- ((ap) = (va_list)&__builtin_va_alist)
-
-#endif /* !_PMAX_VARARGS_H_ */
+#include <mips/varargs.h>
diff --git a/sys/arch/pmax/include/vmparam.h b/sys/arch/pmax/include/vmparam.h
index 6215614fcf1..aa4e5cbc9f1 100644
--- a/sys/arch/pmax/include/vmparam.h
+++ b/sys/arch/pmax/include/vmparam.h
@@ -1,241 +1,6 @@
-/* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */
+/* $NetBSD: vmparam.h,v 1.6 1996/03/19 03:08:56 jonathan Exp $ */
-/*
- * Copyright (c) 1988 University of Utah.
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and Ralph Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * from: Utah Hdr: vmparam.h 1.16 91/01/18
- *
- * @(#)vmparam.h 8.2 (Berkeley) 4/22/94
- */
-
-/*
- * Machine dependent constants for DEC Station 3100.
- */
-/*
- * USRTEXT is the start of the user text/data space, while USRSTACK
- * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are
- * the number of pages from the beginning of the P0 region to the
- * beginning of the text and from the beginning of the P1 region to the
- * beginning of the stack respectively.
- */
-#define USRTEXT 0x00001000
-#define USRSTACK 0x80000000 /* Start of user stack */
-#define BTOPUSRSTACK 0x80000 /* btop(USRSTACK) */
-#define LOWPAGES 0x00001
-#define HIGHPAGES 0
-
-/*
- * Virtual memory related constants, all in bytes
- */
-#ifndef MAXTSIZ
-#define MAXTSIZ (24*1024*1024) /* max text size */
-#endif
-#ifndef DFLDSIZ
-#define DFLDSIZ (32*1024*1024) /* initial data size limit */
-#endif
-#ifndef MAXDSIZ
-#define MAXDSIZ (32*1024*1024) /* max data size */
-#endif
-#ifndef DFLSSIZ
-#define DFLSSIZ (1024*1024) /* initial stack size limit */
-#endif
-#ifndef MAXSSIZ
-#define MAXSSIZ MAXDSIZ /* max stack size */
-#endif
-
-/*
- * Default sizes of swap allocation chunks (see dmap.h).
- * The actual values may be changed in vminit() based on MAXDSIZ.
- * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
- * DMMIN should be at least ctod(1) so that vtod() works.
- * vminit() insures this.
- */
-#define DMMIN 32 /* smallest swap allocation */
-#define DMMAX 4096 /* largest potential swap allocation */
-
-/*
- * Sizes of the system and user portions of the system page table.
- */
-/* SYSPTSIZE IS SILLY; (really number of buffers for I/O) */
-#define SYSPTSIZE 1228
-#define USRPTSIZE 1024
-
-/*
- * PTEs for mapping user space into the kernel for phyio operations.
- * 16 pte's are enough to cover 8 disks * MAXBSIZE.
- */
-#ifndef USRIOSIZE
-#define USRIOSIZE 32
-#endif
-
-/*
- * PTEs for system V style shared memory.
- * This is basically slop for kmempt which we actually allocate (malloc) from.
- */
-#ifndef SHMMAXPGS
-#define SHMMAXPGS 1024 /* 4mb */
-#endif
-
-/*
- * Boundary at which to place first MAPMEM segment if not explicitly
- * specified. Should be a power of two. This allows some slop for
- * the data segment to grow underneath the first mapped segment.
- */
-#define MMSEG 0x200000
-
-/*
- * The size of the clock loop.
- */
-#define LOOPPAGES (maxfree - firstfree)
-
-/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
- * A swapped in process is given a small amount of core without being bothered
- * by the page replacement algorithm. Basically this says that if you are
- * swapped in you deserve some resources. We protect the last SAFERSS
- * pages against paging and will just swap you out rather than paging you.
- * Note that each process has at least UPAGES+CLSIZE pages which are not
- * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
- * number just means a swapped in process is given around 25k bytes.
- * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
- * so we loan each swapped in process memory worth 100$, or just admit
- * that we don't consider it worthwhile and swap it out to disk which costs
- * $30/mb or about $0.75.
- */
-#define SAFERSS 4 /* nominal ``small'' resident set size
- protected against replacement */
-
-/*
- * DISKRPM is used to estimate the number of paging i/o operations
- * which one can expect from a single disk controller.
- */
-#define DISKRPM 60
-
-/*
- * Klustering constants. Klustering is the gathering
- * of pages together for pagein/pageout, while clustering
- * is the treatment of hardware page size as though it were
- * larger than it really is.
- *
- * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
- * units. Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h.
- * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c)
- * unless you like "big push" panics.
- */
-
-#ifdef notdef /* XXX */
-#define KLMAX (4/CLSIZE)
-#define KLSEQL (2/CLSIZE) /* in klust if vadvise(VA_SEQL) */
-#define KLIN (4/CLSIZE) /* default data/stack in klust */
-#define KLTXT (4/CLSIZE) /* default text in klust */
-#define KLOUT (4/CLSIZE)
-#else
-#define KLMAX (1/CLSIZE)
-#define KLSEQL (1/CLSIZE)
-#define KLIN (1/CLSIZE)
-#define KLTXT (1/CLSIZE)
-#define KLOUT (1/CLSIZE)
-#endif
-
-/*
- * KLSDIST is the advance or retard of the fifo reclaim for sequential
- * processes data space.
- */
-#define KLSDIST 3 /* klusters advance/retard for seq. fifo */
-
-/*
- * Paging thresholds (see vm_sched.c).
- * Strategy of 1/19/85:
- * lotsfree is 512k bytes, but at most 1/4 of memory
- * desfree is 200k bytes, but at most 1/8 of memory
- */
-#define LOTSFREE (512 * 1024)
-#define LOTSFREEFRACT 4
-#define DESFREE (200 * 1024)
-#define DESFREEFRACT 8
-
-/*
- * There are two clock hands, initially separated by HANDSPREAD bytes
- * (but at most all of user memory). The amount of time to reclaim
- * a page once the pageout process examines it increases with this
- * distance and decreases as the scan rate rises.
- */
-#define HANDSPREAD (2 * 1024 * 1024)
-
-/*
- * The number of times per second to recompute the desired paging rate
- * and poke the pagedaemon.
- */
-#define RATETOSCHEDPAGING 4
-
-/*
- * Believed threshold (in megabytes) for which interleaved
- * swapping area is desirable.
- */
-#define LOTSOFMEM 2
-
-#define mapin(pte, v, pfnum, prot) \
- (*(int *)(pte) = ((pfnum) << PG_SHIFT) | (prot), MachTLBFlushAddr(v))
-
-/*
- * Mach derived constants
- */
-
-/* user/kernel map constants */
-#define VM_MIN_ADDRESS ((vm_offset_t)0x00000000)
-#define VM_MAXUSER_ADDRESS ((vm_offset_t)0x80000000)
-#define VM_MAX_ADDRESS ((vm_offset_t)0x80000000)
-#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xC0000000)
-#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000)
-
-/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
-#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES)
-#define VM_PHYS_SIZE (USRIOSIZE*CLBYTES)
+#include <mips/vmparam.h>
/* pcb base */
-#define pcbb(p) ((u_int)(p)->p_addr)
+/*#define pcbb(p) ((u_int)(p)->p_addr) */