summaryrefslogtreecommitdiff
path: root/sys/arch/amiga/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amiga/include')
-rw-r--r--sys/arch/amiga/include/ansi.h8
-rw-r--r--sys/arch/amiga/include/asm.h8
-rw-r--r--sys/arch/amiga/include/cdefs.h8
-rw-r--r--sys/arch/amiga/include/cpu.h199
-rw-r--r--sys/arch/amiga/include/cpufunc.h8
-rw-r--r--sys/arch/amiga/include/db_machdep.h8
-rw-r--r--sys/arch/amiga/include/disklabel.h205
-rw-r--r--sys/arch/amiga/include/endian.h8
-rw-r--r--sys/arch/amiga/include/exec.h48
-rw-r--r--sys/arch/amiga/include/float.h8
-rw-r--r--sys/arch/amiga/include/frame.h8
-rw-r--r--sys/arch/amiga/include/ieeefp.h4
-rw-r--r--sys/arch/amiga/include/limits.h8
-rw-r--r--sys/arch/amiga/include/mtpr.h74
-rw-r--r--sys/arch/amiga/include/param.h236
-rw-r--r--sys/arch/amiga/include/pcb.h76
-rw-r--r--sys/arch/amiga/include/pmap.h146
-rw-r--r--sys/arch/amiga/include/proc.h53
-rw-r--r--sys/arch/amiga/include/profile.h8
-rw-r--r--sys/arch/amiga/include/psl.h8
-rw-r--r--sys/arch/amiga/include/pte.h149
-rw-r--r--sys/arch/amiga/include/ptrace.h8
-rw-r--r--sys/arch/amiga/include/reg.h8
-rw-r--r--sys/arch/amiga/include/setjmp.h3
-rw-r--r--sys/arch/amiga/include/signal.h8
-rw-r--r--sys/arch/amiga/include/stdarg.h4
-rw-r--r--sys/arch/amiga/include/trap.h14
-rw-r--r--sys/arch/amiga/include/types.h8
-rw-r--r--sys/arch/amiga/include/varargs.h4
-rw-r--r--sys/arch/amiga/include/vmparam.h167
30 files changed, 1502 insertions, 0 deletions
diff --git a/sys/arch/amiga/include/ansi.h b/sys/arch/amiga/include/ansi.h
new file mode 100644
index 00000000000..d2286176862
--- /dev/null
+++ b/sys/arch/amiga/include/ansi.h
@@ -0,0 +1,8 @@
+/* $NetBSD: ansi.h,v 1.8 1994/10/26 02:05:55 cgd Exp $ */
+
+#ifndef _MACHINE_ANSI_H_
+#define _MACHINE_ANSI_H_
+
+#include <m68k/ansi.h>
+
+#endif
diff --git a/sys/arch/amiga/include/asm.h b/sys/arch/amiga/include/asm.h
new file mode 100644
index 00000000000..3e9ddfbf3b7
--- /dev/null
+++ b/sys/arch/amiga/include/asm.h
@@ -0,0 +1,8 @@
+/* $NetBSD: asm.h,v 1.4 1994/10/26 02:05:57 cgd Exp $ */
+
+#ifndef _MACHINE_ASM_H_
+#define _MACHINE_ASM_H_
+
+#include <m68k/asm.h>
+
+#endif
diff --git a/sys/arch/amiga/include/cdefs.h b/sys/arch/amiga/include/cdefs.h
new file mode 100644
index 00000000000..a3c9c4377d7
--- /dev/null
+++ b/sys/arch/amiga/include/cdefs.h
@@ -0,0 +1,8 @@
+/* $NetBSD: cdefs.h,v 1.1 1995/01/19 01:38:36 jtc Exp $ */
+
+#ifndef _MACHINE_CDEFS_H_
+#define _MACHINE_CDEFS_H_
+
+#include <m68k/cdefs.h>
+
+#endif
diff --git a/sys/arch/amiga/include/cpu.h b/sys/arch/amiga/include/cpu.h
new file mode 100644
index 00000000000..b12ffa1d7dc
--- /dev/null
+++ b/sys/arch/amiga/include/cpu.h
@@ -0,0 +1,199 @@
+/* $NetBSD: cpu.h,v 1.24 1995/08/18 15:28:23 chopps Exp $ */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1982, 1990 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.
+ *
+ * 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: cpu.h 1.16 91/03/25$
+ *
+ * @(#)cpu.h 7.7 (Berkeley) 6/27/91
+ */
+#ifndef _MACHINE_CPU_H_
+#define _MACHINE_CPU_H_
+
+/*
+ * Exported definitions unique to amiga/68k cpu support.
+ */
+
+/*
+ * definitions of cpu-dependent requirements
+ * referenced in generic code
+ */
+#define cpu_swapin(p) /* nothing */
+#define cpu_wait(p) /* nothing */
+#define cpu_setstack(p, ap) (p)->p_md.md_regs[SP] = ap
+#define cpu_swapout(p) /* nothing */
+
+/*
+ * Arguments to hardclock and gatherstats encapsulate the previous
+ * machine state in an opaque clockframe. One the hp300, we use
+ * what the hardware pushes on an interrupt (frame format 0).
+ */
+struct clockframe {
+ u_short sr; /* sr at time of interrupt */
+ u_long pc; /* pc at time of interrupt */
+ u_short vo; /* vector offset (4-word frame) */
+};
+
+#define CLKF_USERMODE(framep) (((framep)->sr & PSL_S) == 0)
+/*#define CLKF_BASEPRI(framep) (((framep)->sr & PSL_IPL) == 0)*/
+#define CLKF_BASEPRI(framep) (0)
+#define CLKF_PC(framep) ((framep)->pc)
+#if 0
+/* We would like to do it this way... */
+#define CLKF_INTR(framep) (((framep)->sr & PSL_M) == 0)
+#else
+/* but until we start using PSL_M, we have to do this instead */
+#define CLKF_INTR(framep) (0) /* XXX */
+#endif
+
+
+/*
+ * 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; setsoftast();}
+
+/*
+ * Give a profiling tick to the current process from the softclock
+ * interrupt. On hp300, request an ast to send us through trap(),
+ * marking the proc as needing a profiling tick.
+ */
+#define profile_tick(p, framep) ((p)->p_flag |= P_OWEUPC, setsoftast())
+#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast())
+
+/*
+ * Notify the current process (p) that it has a signal pending,
+ * process as soon as possible.
+ */
+#define signotify(p) setsoftast()
+
+#define setsoftast() (astpending = 1)
+
+int astpending; /* need trap before returning to user mode */
+int want_resched; /* resched() was called */
+
+/* include support for software interrupts */
+#include <machine/mtpr.h>
+
+/*
+ * The rest of this should probably be moved to ../amiga/amigacpu.h,
+ * although some of it could probably be put into generic 68k headers.
+ */
+
+/* values for machineid (happen to be AFF_* settings of AttnFlags) */
+#define AMIGA_68020 (1L<<1)
+#define AMIGA_68030 (1L<<2)
+#define AMIGA_68040 (1L<<3)
+#define AMIGA_68881 (1L<<4)
+#define AMIGA_68882 (1L<<5)
+#define AMIGA_FPU40 (1L<<6)
+
+/* values for fputype */
+#define FPU_NONE 0
+#define FPU_68881 1
+#define FPU_68882 2
+#define FPU_68040 3
+
+/* values for mmutype (assigned for quick testing) */
+#define MMU_68030 -1 /* 68030 on-chip subset of 68851 */
+#define MMU_68851 1 /* Motorola 68851 */
+#define MMU_68040 -2 /* 68040 on-chip subsubset */
+
+#ifdef _KERNEL
+int machineid, mmutype, fputype;
+#endif
+
+/*
+ * 68851 and 68030 MMU
+ */
+#define PMMU_LVLMASK 0x0007
+#define PMMU_INV 0x0400
+#define PMMU_WP 0x0800
+#define PMMU_ALV 0x1000
+#define PMMU_SO 0x2000
+#define PMMU_LV 0x4000
+#define PMMU_BE 0x8000
+#define PMMU_FAULT (PMMU_WP|PMMU_INV)
+
+/* 680X0 function codes */
+#define FC_USERD 1 /* user data space */
+#define FC_USERP 2 /* user program space */
+#define FC_SUPERD 5 /* supervisor data space */
+#define FC_SUPERP 6 /* supervisor program space */
+#define FC_CPU 7 /* CPU space */
+
+/* fields in the 68020 cache control register */
+#define IC_ENABLE 0x0001 /* enable instruction cache */
+#define IC_FREEZE 0x0002 /* freeze instruction cache */
+#define IC_CE 0x0004 /* clear instruction cache entry */
+#define IC_CLR 0x0008 /* clear entire instruction cache */
+
+/* additional fields in the 68030 cache control register */
+#define IC_BE 0x0010 /* instruction burst enable */
+#define DC_ENABLE 0x0100 /* data cache enable */
+#define DC_FREEZE 0x0200 /* data cache freeze */
+#define DC_CE 0x0400 /* clear data cache entry */
+#define DC_CLR 0x0800 /* clear entire data cache */
+#define DC_BE 0x1000 /* data burst enable */
+#define DC_WA 0x2000 /* write allocate */
+
+/* fields in the 68040 cache control register */
+#define IC40_ENABLE 0x00008000 /* enable instruction cache */
+#define DC40_ENABLE 0x80000000 /* enable data cache */
+
+#define CACHE_ON (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE)
+#define CACHE_OFF (DC_CLR|IC_CLR)
+#define CACHE_CLR (CACHE_ON)
+#define IC_CLEAR (DC_WA|DC_BE|DC_ENABLE|IC_BE|IC_CLR|IC_ENABLE)
+#define DC_CLEAR (DC_WA|DC_BE|DC_CLR|DC_ENABLE|IC_BE|IC_ENABLE)
+
+/* 68040 cache control */
+#define CACHE40_ON (IC40_ENABLE|DC40_ENABLE)
+#define CACHE40_OFF 0x00000000
+
+/*
+ * 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 }, \
+}
+
+#endif /* !_MACHINE_CPU_H_ */
diff --git a/sys/arch/amiga/include/cpufunc.h b/sys/arch/amiga/include/cpufunc.h
new file mode 100644
index 00000000000..04242c01797
--- /dev/null
+++ b/sys/arch/amiga/include/cpufunc.h
@@ -0,0 +1,8 @@
+/* $NetBSD: cpufunc.h,v 1.7 1994/10/26 02:06:02 cgd Exp $ */
+
+/*
+ * Functions to provide access to special cpu instructions.
+ */
+#ifndef _MACHINE_CPUFUNC_H_
+#define _MACHINE_CPUFUNC_H_
+#endif /* !_MACHINE_CPUFUNC_H_ */
diff --git a/sys/arch/amiga/include/db_machdep.h b/sys/arch/amiga/include/db_machdep.h
new file mode 100644
index 00000000000..bd9b4fa03e2
--- /dev/null
+++ b/sys/arch/amiga/include/db_machdep.h
@@ -0,0 +1,8 @@
+/* $NetBSD: db_machdep.h,v 1.4 1994/10/26 02:06:03 cgd Exp $ */
+
+#ifndef _MACHINE_DB_MACHDEP_H_
+#define _MACHINE_DB_MACHDEP_H_
+
+#include <m68k/db_machdep.h>
+
+#endif
diff --git a/sys/arch/amiga/include/disklabel.h b/sys/arch/amiga/include/disklabel.h
new file mode 100644
index 00000000000..bdf472442f3
--- /dev/null
+++ b/sys/arch/amiga/include/disklabel.h
@@ -0,0 +1,205 @@
+/* $NetBSD: disklabel.h,v 1.5 1995/07/04 18:06:47 chopps Exp $ */
+
+/*
+ * Copyright (c) 1994 Christian E. Hopps
+ * 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 Christian E. Hopps.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _MACHINE_DISKLABEL_H_
+#define _MACHINE_DISKLABEL_H_
+
+#define LABELSECTOR 0 /* sector containing label */
+#define LABELOFFSET 64 /* offset of label in sector */
+#define MAXPARTITIONS 16 /* number of partitions */
+#define RAW_PART 2 /* raw partition: xx?c */
+
+/*
+ * describes ados Rigid Disk Blocks
+ * which are used to partition a drive
+ */
+#define RDBNULL ((u_long)0xffffffff)
+
+/*
+ * you will find rdblock somewhere in [0, RDBMAXBLOCKS)
+ */
+#define RDB_MAXBLOCKS 16
+
+struct rdblock {
+ u_long id; /* 'RDSK' */
+ u_long nsumlong; /* number of longs in check sum */
+ u_long chksum; /* simple additive with wrap checksum */
+ u_long hostid; /* scsi target of host */
+ u_long nbytes; /* size of disk blocks */
+ u_long flags;
+ u_long badbhead; /* linked list of badblocks */
+ u_long partbhead; /* linked list of partblocks */
+ u_long fsbhead; /* " " of fsblocks */
+ u_long driveinit;
+ u_long resv1[6]; /* RDBNULL */
+ u_long ncylinders; /* number of cylinders on drive */
+ u_long nsectors; /* number of sectors per track */
+ u_long nheads; /* number of tracks per cylinder */
+ u_long interleave;
+ u_long park; /* only used with st506 i.e. not */
+ u_long resv2[3];
+ u_long wprecomp; /* start cyl for write precomp */
+ u_long reducedwrite; /* start cyl for reduced write current */
+ u_long steprate; /* driver step rate in ?s */
+ u_long resv3[5];
+ u_long rdblowb; /* lowblock of range for rdb's */
+ u_long rdbhighb; /* high block of range for rdb's */
+ u_long lowcyl; /* low cylinder of partition area */
+ u_long highcyl; /* upper cylinder of partition area */
+ u_long secpercyl; /* number of sectors per cylinder */
+ u_long parkseconds; /* zero if no park needed */
+ u_long resv4[2];
+ char diskvendor[8]; /* inquiry stuff */
+ char diskproduct[16]; /* inquiry stuff */
+ char diskrevision[4]; /* inquiry stuff */
+ char contvendor[8]; /* inquiry stuff */
+ char contproduct[16]; /* inquiry stuff */
+ char contrevision[4]; /* inquiry stuff */
+#if never_use_secsize
+ u_long resv5[0];
+#endif
+};
+
+
+#define RDBF_LAST 0x1 /* last drive available */
+#define RDBF_LASTLUN 0x2 /* last LUN available */
+#define RDBF_LASTUNIT 0x4 /* last target available */
+#define RDBF_NORESELECT 0x8 /* do not use reselect */
+#define RDBF_DISKID 0x10 /* disk id is valid ?? */
+#define RDBF_CTRLID 0x20 /* ctrl id is valid ?? */
+#define RDBF_SYNC 0x40 /* drive supports SCSI synchronous mode */
+
+struct ados_environ {
+ u_long tabsize; /* 0: environ table size */
+ u_long sizeblock; /* 1: n long words in a block */
+ u_long secorg; /* 2: not used must be zero */
+ u_long numheads; /* 3: number of surfaces */
+ u_long secperblk; /* 4: must be 1 */
+ u_long secpertrk; /* 5: blocks per track */
+ u_long resvblocks; /* 6: reserved blocks at start */
+ u_long prefac; /* 7: must be 0 */
+ u_long interleave; /* 8: normally 1 */
+ u_long lowcyl; /* 9: low cylinder of partition */
+ u_long highcyl; /* 10: upper cylinder of partition */
+ u_long numbufs; /* 11: ados: number of buffers */
+ u_long membuftype; /* 12: ados: type of bufmem */
+ u_long maxtrans; /* 13: maxtrans the ctrlr supports */
+ u_long mask; /* 14: mask for valid address */
+ u_long bootpri; /* 15: boot priority for autoboot */
+ u_long dostype; /* 16: filesystem type */
+ u_long baud; /* 17: serial handler baud rate */
+ u_long control; /* 18: control word for fs */
+ u_long bootblocks; /* 19: blocks containing boot code */
+ u_long fsize; /* 20: file system block size */
+ u_long frag; /* 21: allowable frags per block */
+ u_long cpg; /* 22: cylinders per group */
+};
+
+struct partblock {
+ u_long id; /* 'PART' */
+ u_long nsumlong; /* number of longs in check sum */
+ u_long chksum; /* simple additive with wrap checksum */
+ u_long hostid; /* scsi target of host */
+ u_long next; /* next in chain */
+ u_long flags; /* see below */
+ u_long resv1[3];
+ u_char partname[32]; /* (BCPL) part name (may not be unique) */
+ u_long resv2[15];
+ struct ados_environ e;
+#if never_use_secsize
+ u_long extra[9]; /* 8 for extra added to environ */
+#endif
+};
+
+#define PBF_BOOTABLE 0x1 /* partition is bootable */
+#define PBF_NOMOUNT 0x2 /* partition should be mounted */
+
+struct badblock {
+ u_long id; /* 'BADB' */
+ u_long nsumlong; /* number of longs in check sum */
+ u_long chksum; /* simple additive with wrap checksum */
+ u_long hostid; /* scsi target of host */
+ u_long next; /* next in chain */
+ u_long resv;
+ struct badblockent {
+ u_long badblock;
+ u_long goodblock;
+ } badtab[0]; /* 61 for secsize == 512 */
+};
+
+struct fsblock {
+ u_long id; /* 'FSHD' */
+ u_long nsumlong; /* number of longs in check sum */
+ u_long chksum; /* simple additive with wrap checksum */
+ u_long hostid; /* scsi target of host */
+ u_long next; /* next in chain */
+ u_long flags;
+ u_long resv1[2];
+ u_long dostype; /* this is a file system for this type */
+ u_long version; /* version of this fs */
+ u_long patchflags; /* describes which functions to replace */
+ u_long type; /* zero */
+ u_long task; /* zero */
+ u_long lock; /* zero */
+ u_long handler; /* zero */
+ u_long stacksize; /* to use when loading handler */
+ u_long priority; /* to run the fs at. */
+ u_long startup; /* zero */
+ u_long lsegblocks; /* linked list of lsegblocks of fs code */
+ u_long globalvec; /* bcpl vector not used mostly */
+#if never_use_secsize
+ u_long resv2[44];
+#endif
+};
+
+struct lsegblock {
+ u_long id; /* 'LSEG' */
+ u_long nsumlong; /* number of longs in check sum */
+ u_long chksum; /* simple additive with wrap checksum */
+ u_long hostid; /* scsi target of host */
+ u_long next; /* next in chain */
+ u_long loaddata[0]; /* load segment data, 123 for secsize == 512 */
+};
+
+#define RDBLOCK_ID 0x5244534b /* 'RDSK' */
+#define PARTBLOCK_ID 0x50415254 /* 'PART' */
+#define BADBLOCK_ID 0x42414442 /* 'BADB' */
+#define FSBLOCK_ID 0x46534844 /* 'FSHD' */
+#define LSEGBLOCK_ID 0x4c534547 /* 'LSEG' */
+
+struct cpu_disklabel {
+ u_long rdblock; /* may be RDBNULL which invalidates */
+ u_long pblist[MAXPARTITIONS]; /* partblock number (RDB list order) */
+ char pbindex[MAXPARTITIONS]; /* index of pblock (partition order) */
+ int valid; /* essential that this is valid */
+};
+
+#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/amiga/include/endian.h b/sys/arch/amiga/include/endian.h
new file mode 100644
index 00000000000..7d109f6a4ac
--- /dev/null
+++ b/sys/arch/amiga/include/endian.h
@@ -0,0 +1,8 @@
+/* $NetBSD: endian.h,v 1.7 1994/10/26 02:06:09 cgd Exp $ */
+
+#ifndef _MACHINE_ENDIAN_H_
+#define _MACHINE_ENDIAN_H_
+
+#include <m68k/endian.h>
+
+#endif
diff --git a/sys/arch/amiga/include/exec.h b/sys/arch/amiga/include/exec.h
new file mode 100644
index 00000000000..5c978fef3e5
--- /dev/null
+++ b/sys/arch/amiga/include/exec.h
@@ -0,0 +1,48 @@
+/* $NetBSD: exec.h,v 1.8 1994/10/26 02:06:11 cgd Exp $ */
+
+/*
+ * Copyright (c) 1993 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _MACHINE_EXEC_H_
+#define _MACHINE_EXEC_H_
+
+#define __LDPGSZ 8192
+
+/* Relocation format. */
+struct relocation_info_m68k {
+ int r_address; /* offset in text or data segment */
+ unsigned int r_symbolnum : 24, /* ordinal number of add symbol */
+ r_pcrel : 1, /* 1 if value should be pc-relative */
+ r_length : 2, /* log base 2 of value's width */
+ r_extern : 1, /* 1 if need to add symbol to value */
+ r_baserel : 1, /* linkage table relative */
+ r_jmptable : 1, /* relocate to jump table */
+ r_relative : 1, /* load address relative */
+ r_copy : 1; /* run time copy */
+};
+#define relocation_info relocation_info_m68k
+
+#endif /* _MACHINE_EXEC_H_ */
diff --git a/sys/arch/amiga/include/float.h b/sys/arch/amiga/include/float.h
new file mode 100644
index 00000000000..c4910de3ce3
--- /dev/null
+++ b/sys/arch/amiga/include/float.h
@@ -0,0 +1,8 @@
+/* $NetBSD: float.h,v 1.8 1994/10/26 02:06:13 cgd Exp $ */
+
+#ifndef _MACHINE_FLOAT_H_
+#define _MACHINE_FLOAT_H_
+
+#include <m68k/float.h>
+
+#endif
diff --git a/sys/arch/amiga/include/frame.h b/sys/arch/amiga/include/frame.h
new file mode 100644
index 00000000000..2a4df888355
--- /dev/null
+++ b/sys/arch/amiga/include/frame.h
@@ -0,0 +1,8 @@
+/* $NetBSD: frame.h,v 1.7 1994/10/26 02:06:15 cgd Exp $ */
+
+#ifndef _MACHINE_FRAME_H_
+#define _MACHINE_FRAME_H_
+
+#include <m68k/frame.h>
+
+#endif
diff --git a/sys/arch/amiga/include/ieeefp.h b/sys/arch/amiga/include/ieeefp.h
new file mode 100644
index 00000000000..1e1bfc2a13d
--- /dev/null
+++ b/sys/arch/amiga/include/ieeefp.h
@@ -0,0 +1,4 @@
+/* $NetBSD: ieeefp.h,v 1.2 1995/04/16 16:47:03 jtc Exp $ */
+
+/* Just use the common m68k definition */
+#include <m68k/ieeefp.h>
diff --git a/sys/arch/amiga/include/limits.h b/sys/arch/amiga/include/limits.h
new file mode 100644
index 00000000000..e88ce065d54
--- /dev/null
+++ b/sys/arch/amiga/include/limits.h
@@ -0,0 +1,8 @@
+/* $NetBSD: limits.h,v 1.8 1994/10/26 02:06:16 cgd Exp $ */
+
+#ifndef _MACHINE_LIMITS_H_
+#define _MACHINE_LIMITS_H_
+
+#include <m68k/limits.h>
+
+#endif
diff --git a/sys/arch/amiga/include/mtpr.h b/sys/arch/amiga/include/mtpr.h
new file mode 100644
index 00000000000..914a48df312
--- /dev/null
+++ b/sys/arch/amiga/include/mtpr.h
@@ -0,0 +1,74 @@
+/* $NetBSD: mtpr.h,v 1.9 1995/03/28 18:15:09 jtc Exp $ */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1990 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.
+ *
+ * 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: mtpr.h 1.1 90/07/09$
+ *
+ * @(#)mtpr.h 7.2 (Berkeley) 11/3/90
+ */
+#ifndef _MACHINE_MPTR_H_
+#define _MACHINE_MPTR_H_
+
+#ifdef _KERNEL
+/*
+ * simulated software interrupt register (extends hardware
+ * SOFTINT bit)
+ */
+
+/*
+ * this makes it pretty machine dependant. Should this go into
+ * <amiga/amiga/mtpr.h> ?
+ */
+#include <amiga/amiga/custom.h>
+
+extern unsigned char ssir;
+
+#define SIR_NET 0x1 /* call netintr */
+#define SIR_CLOCK 0x2 /* call softclock */
+#define SIR_CBACK 0x4 /* walk the sicallback-chain */
+
+#define siroff(x) ssir &= ~(x)
+#define setsoftint() (custom.intreq = INTF_SETCLR|INTF_SOFTINT)
+#define clrsoftint() (custom.intreq = INTF_SOFTINT)
+#define setsoftnet() (ssir |= SIR_NET, setsoftint())
+#define setsoftclock() (ssir |= SIR_CLOCK, setsoftint())
+#define setsoftcback() (ssir |= SIR_CBACK, setsoftint())
+
+#endif /* _KERNEL */
+
+#endif /* !_MACHINE_MPTR_H_ */
diff --git a/sys/arch/amiga/include/param.h b/sys/arch/amiga/include/param.h
new file mode 100644
index 00000000000..f7f5b4f6723
--- /dev/null
+++ b/sys/arch/amiga/include/param.h
@@ -0,0 +1,236 @@
+/* $NetBSD: param.h,v 1.25 1995/08/18 15:28:25 chopps Exp $ */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1982, 1986, 1990 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.
+ *
+ * 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: machparam.h 1.11 89/08/14$
+ *
+ * @(#)param.h 7.8 (Berkeley) 6/28/91
+ */
+#ifndef _MACHINE_PARAM_H_
+#define _MACHINE_PARAM_H_
+
+/*
+ * Machine dependent constants for amiga
+ */
+#define MACHINE "amiga"
+#define MACHINE_ARCH "m68k"
+#define MID_MACHINE MID_M68K
+
+/*
+ * 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.
+ */
+#define ALIGNBYTES (sizeof(int) - 1)
+#define ALIGN(p) (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1))
+
+#define NBPG 8192 /* bytes/page */
+#define PGOFSET (NBPG-1) /* byte offset into page */
+#define PGSHIFT 13 /* LOG2(NBPG) */
+#define NPTEPG (NBPG/(sizeof(u_int)))
+
+#define NBSEG ((mmutype == MMU_68040) ? 32*NBPG : 2048*NBPG) /* bytes/segment */
+#define SEGOFSET (NBSEG-1) /* byte offset into segment */
+#define SEGSHIFT 24 /* LOG2(NBSEG) [68030 value] */
+
+#define KERNBASE 0x0 /* start of kernel virtual */
+#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
+
+#define DEV_BSIZE 512
+#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
+#define BLKDEV_IOSIZE 2048
+#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
+
+#define CLSIZE 1
+#define CLSIZELOG2 0
+
+/* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
+#define SSIZE 1 /* initial stack size/NBPG */
+#define SINCR 1 /* increment of stack/NBPG */
+
+#define UPAGES 2 /* pages of u-area */
+#define USPACE (UPAGES * NBPG)
+
+/*
+ * Constants related to network buffer management.
+ * MCLBYTES must be no larger than CLBYTES (the software page size), and,
+ * on machines that exchange pages of input or output buffers with mbuf
+ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
+ * of the hardware page size.
+ */
+#define MSIZE 128 /* size of an mbuf */
+#define MCLBYTES 1024
+#define MCLSHIFT 10
+#define MCLOFSET (MCLBYTES - 1)
+#ifndef NMBCLUSTERS
+#ifdef GATEWAY
+#define NMBCLUSTERS 512 /* map size, max cluster allocation */
+#else
+#define NMBCLUSTERS 256 /* map size, max cluster allocation */
+#endif
+#endif
+
+/*
+ * Size of kernel malloc arena in CLBYTES-sized logical pages
+ */
+#ifndef NKMEMCLUSTERS
+#define NKMEMCLUSTERS (3072*1024/CLBYTES)
+#endif
+
+#define MAXPARTITIONS 16
+
+/* pages ("clicks") 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 amiga_round_seg(x) ((((unsigned)(x)) + NBSEG - 1) & ~(NBSEG-1))
+#define amiga_trunc_seg(x) ((unsigned)(x) & ~(NBSEG-1))
+#define amiga_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
+#define amiga_trunc_page(x) ((unsigned)(x) & ~(NBPG-1))
+#define amiga_btop(x) ((unsigned)(x) >> PGSHIFT)
+#define amiga_ptob(x) ((unsigned)(x) << PGSHIFT)
+
+/*
+ * spl functions; all are normally done in-line
+ */
+#include <machine/psl.h>
+
+/*
+ * point to the custom.intenar and custom.intenaw respectively.
+ */
+extern volatile unsigned short *amiga_intena_read, *amiga_intena_write;
+
+#if 0
+#define _debug_spl(s) \
+({ \
+ register int _spl_r; \
+\
+ __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \
+ "&=d" (_spl_r) : "di" (s)); \
+ if ((_spl_r&PSL_IPL) > ((s)&PSL_IPL)&&((s)&PSL_IPL)!=PSL_IPL1) \
+ printf ("%s:%d:spl(%d) ==> spl(%d)!!\n",__FILE__,__LINE__, \
+ ((PSL_IPL&_spl_r)>>8), ((PSL_IPL&(s))>>8)); \
+ _spl_r; \
+})
+#else
+/*
+ * Don't lower IPL below current IPL (unless new IPL is 6)
+ */
+#define _debug_spl(s) \
+({ \
+ register int _spl_r; \
+\
+ __asm __volatile ("clrl %0; movew sr,%0" : \
+ "&=d" (_spl_r)); \
+ if ((((s)&PSL_IPL) >= PSL_IPL6) || (_spl_r&PSL_IPL) < ((s)&PSL_IPL) || ((s)&PSL_IPL) <= PSL_IPL1) \
+ __asm __volatile ("movew %0,sr" : : "di" (s)); \
+ _spl_r; \
+})
+#endif
+
+#define _spl_no_check(s) \
+({ \
+ register int _spl_r; \
+\
+ __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \
+ "&=d" (_spl_r) : "di" (s)); \
+ _spl_r; \
+})
+#if defined (DEBUGXX) /* No workee */
+#define _spl _debug_spl
+#else
+#define _spl _spl_no_check
+#endif
+
+#define spl0() _spl(PSL_S|PSL_IPL0)
+#define spl1() _spl(PSL_S|PSL_IPL1)
+#define spl2() _spl(PSL_S|PSL_IPL2)
+#define spl3() _spl(PSL_S|PSL_IPL3)
+#define spl4() _spl(PSL_S|PSL_IPL4)
+#define spl5() _spl(PSL_S|PSL_IPL5)
+#define spl6() _spl(PSL_S|PSL_IPL6)
+#define spl7() _spl(PSL_S|PSL_IPL7)
+
+#define splnone() spl0()
+#define splsoftclock() spl1()
+#define splsoftnet() spl1()
+#define splbio() spl3()
+#define splnet() spl3()
+#define spltty() spl4()
+#define splimp() spl4()
+#ifndef LEV6_DEFER
+#define splclock() spl6()
+#define splstatclock() spl6()
+#define splvm() spl6()
+#define splhigh() spl7()
+#define splsched() spl7()
+#else
+#define splclock() spl4()
+#define splstatclock() spl4()
+#define splvm() spl4()
+#define splhigh() spl4()
+#define splsched() spl4()
+#endif
+
+#define splx(s) _spl_no_check(s)
+
+#ifdef _KERNEL
+void delay __P((int));
+void DELAY __P((int));
+#endif
+
+#endif /* !_MACHINE_PARAM_H_ */
diff --git a/sys/arch/amiga/include/pcb.h b/sys/arch/amiga/include/pcb.h
new file mode 100644
index 00000000000..fd78f0f1cb2
--- /dev/null
+++ b/sys/arch/amiga/include/pcb.h
@@ -0,0 +1,76 @@
+/* $NetBSD: pcb.h,v 1.9 1995/05/11 23:05:57 chopps Exp $ */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1982, 1986, 1990 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.
+ *
+ * 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 7.4 (Berkeley) 5/4/91
+ */
+#ifndef _MACHINE_PCB_H_
+#define _MACHINE_PCB_H_
+
+#include <machine/frame.h>
+
+/*
+ * AMIGA process control block
+ */
+struct pcb
+{
+ short pcb_flags; /* misc. process flags (+0) */
+ short pcb_ps; /* processor status word (+2) */
+ int pcb_ustp; /* user segment table pointer (+4) */
+ int pcb_usp; /* user stack pointer (+8) */
+ int pcb_regs[12]; /* D2-D7, A2-A7 (+C) */
+ int pcb_cmap2; /* temporary copy PTE */
+ caddr_t pcb_onfault; /* for copyin/out faults */
+ struct fpframe pcb_fpregs; /* 68881/2 context save area */
+ int pcb_exec[16]; /* exec structure for core dumps */
+};
+
+/* flags (none currently used) */
+
+/*
+ * The pcb is augmented with machine-dependent additional data for
+ * core dumps. For the hp300, this includes an HP-UX exec header
+ * which is dumped for HP-UX processes.
+ */
+struct md_coredump {
+ int md_exec[16]; /* exec structure for HP-UX core dumps */
+};
+
+#endif /* !_MACHINE_PCB_H_ */
diff --git a/sys/arch/amiga/include/pmap.h b/sys/arch/amiga/include/pmap.h
new file mode 100644
index 00000000000..0b830babf4e
--- /dev/null
+++ b/sys/arch/amiga/include/pmap.h
@@ -0,0 +1,146 @@
+/* $NetBSD: pmap.h,v 1.16 1995/09/29 13:52:08 chopps Exp $ */
+
+/*
+ * Copyright (c) 1987 Carnegie-Mellon University
+ * Copyright (c) 1991 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.
+ *
+ * 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 7.6 (Berkeley) 5/10/91
+ */
+#ifndef _MACHINE_PMAP_H_
+#define _MACHINE_PMAP_H_
+
+/*
+ * Pmap stuff
+ */
+struct pmap {
+ pt_entry_t *pm_ptab; /* KVA of page table */
+ st_entry_t *pm_stab; /* KVA of segment table */
+ int pm_stchanged; /* ST changed */
+ int pm_stfree; /* 040: free lev2 blocks */
+ u_int *pm_stpa; /* 040: ST phys addr */
+ short pm_sref; /* segment table ref count */
+ short pm_count; /* pmap reference count */
+ long pm_ptpages; /* more stats: PT pages */
+ simple_lock_data_t pm_lock; /* lock on pmap */
+ struct pmap_statistics pm_stats; /* pmap statistics */
+};
+
+typedef struct pmap *pmap_t;
+
+/*
+ * On the 040 we keep track of which level 2 blocks are already in use
+ * with the pm_stfree mask. Bits are arranged from LSB (block 0) to MSB
+ * (block 31). For convenience, the level 1 table is considered to be
+ * block 0.
+ *
+ * MAX[KU]L2SIZE control how many pages of level 2 descriptors are allowed.
+ * for the kernel and users. 16 implies only the initial "segment table"
+ * page is used. WARNING: don't change MAXUL2SIZE unless you can allocate
+ * physically contiguous pages for the ST in pmap.c!
+ */
+#define MAXKL2SIZE 32
+#define MAXUL2SIZE 16
+#define l2tobm(n) (1 << (n))
+#define bmtol2(n) (ffs(n) - 1)
+
+/*
+ * Macros for speed
+ */
+#define PMAP_ACTIVATE(pmapp, pcbp, iscurproc) \
+ if ((pmapp) != NULL && (pmapp)->pm_stchanged) { \
+ (pcbp)->pcb_ustp = \
+ amiga_btop((vm_offset_t)(pmapp)->pm_stpa); \
+ if (iscurproc) \
+ loadustp((pcbp)->pcb_ustp); \
+ (pmapp)->pm_stchanged = FALSE; \
+ }
+#define PMAP_DEACTIVATE(pmapp, pcbp)
+
+/*
+ * For each vm_page_t, there is a list of all currently valid virtual
+ * mappings of that page. An entry is a pv_entry_t, the list is pv_table.
+ */
+typedef struct pv_entry {
+ struct pv_entry *pv_next; /* next pv_entry */
+ struct pmap *pv_pmap; /* pmap where mapping lies */
+ vm_offset_t pv_va; /* virtual address for mapping */
+ u_int *pv_ptste; /* non-zero if VA maps a PT page */
+ struct pmap *pv_ptpmap; /* if pv_ptste, pmap for PT page */
+ int pv_flags; /* flags */
+} *pv_entry_t;
+
+#define PV_CI 0x01 /* all entries must be cache inhibited */
+#define PV_PTPAGE 0x02 /* entry maps a page table page */
+
+struct pv_page;
+
+struct pv_page_info {
+ TAILQ_ENTRY(pv_page) pgi_list;
+ struct pv_entry *pgi_freelist;
+ int pgi_nfree;
+};
+
+/*
+ * This is basically:
+ * ((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry))
+ */
+#define NPVPPG 340
+
+struct pv_page {
+ struct pv_page_info pvp_pgi;
+ struct pv_entry pvp_pv[NPVPPG];
+};
+
+#ifdef _KERNEL
+pv_entry_t pv_table; /* array of entries, one per page */
+u_int *Sysmap;
+char *vmmap; /* map for mem, dumps, etc. */
+struct pmap kernel_pmap_store;
+
+#ifdef MACHINE_NONCONTIG
+#define pa_index(pa) pmap_page_index(pa)
+#else
+#define pa_index(pa) atop(pa - vm_first_phys)
+#endif
+#define pa_to_pvh(pa) (&pv_table[pa_index(pa)])
+#define pmap_kernel() (&kernel_pmap_store)
+#define active_pmap(pm) \
+ ((pm) == pmap_kernel() || (pm) == curproc->p_vmspace->vm_map.pmap)
+#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
+#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
+#endif /* _KERNEL */
+
+#endif /* !_MACHINE_PMAP_H_ */
diff --git a/sys/arch/amiga/include/proc.h b/sys/arch/amiga/include/proc.h
new file mode 100644
index 00000000000..6ee0eefbb90
--- /dev/null
+++ b/sys/arch/amiga/include/proc.h
@@ -0,0 +1,53 @@
+/* $NetBSD: proc.h,v 1.10 1994/10/26 02:06:27 cgd Exp $ */
+
+/*
+ * Copyright (c) 1991 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.
+ *
+ * @(#)proc.h 7.1 (Berkeley) 5/15/91
+ */
+#ifndef _MACHINE_PROC_H_
+#define _MACHINE_PROC_H_
+
+/*
+ * Machine-dependent part of the proc structure for amiga.
+ */
+struct mdproc {
+ int *md_regs; /* registers on current frame */
+ long md_flags; /* machine-dependent flags */
+};
+
+/* md_flags */
+#define MDP_AST 0x0001 /* async trap pending */
+#define MDP_STACKADJ 0x0002 /* frame SP adjusted, might have to
+ undo when system call returns
+ ERESTART. */
+#endif /* !_MACHINE_PROC_H_ */
diff --git a/sys/arch/amiga/include/profile.h b/sys/arch/amiga/include/profile.h
new file mode 100644
index 00000000000..e29f9651cd3
--- /dev/null
+++ b/sys/arch/amiga/include/profile.h
@@ -0,0 +1,8 @@
+/* $NetBSD: profile.h,v 1.2 1994/10/26 02:06:29 cgd Exp $ */
+
+#ifndef _MACHINE_PROFILE_H_
+#define _MACHINE_PROFILE_H_
+
+#include <m68k/profile.h>
+
+#endif
diff --git a/sys/arch/amiga/include/psl.h b/sys/arch/amiga/include/psl.h
new file mode 100644
index 00000000000..ff340b33085
--- /dev/null
+++ b/sys/arch/amiga/include/psl.h
@@ -0,0 +1,8 @@
+/* $NetBSD: psl.h,v 1.7 1994/10/26 02:06:31 cgd Exp $ */
+
+#ifndef _MACHINE_PSL_H_
+#define _MACHINE_PSL_H_
+
+#include <m68k/psl.h>
+
+#endif
diff --git a/sys/arch/amiga/include/pte.h b/sys/arch/amiga/include/pte.h
new file mode 100644
index 00000000000..8617b5f3213
--- /dev/null
+++ b/sys/arch/amiga/include/pte.h
@@ -0,0 +1,149 @@
+/* $NetBSD: pte.h,v 1.14 1995/09/29 13:52:09 chopps Exp $ */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1982, 1986, 1990 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.
+ *
+ * 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: pte.h 1.11 89/09/03$
+ *
+ * @(#)pte.h 7.3 (Berkeley) 5/8/91
+ */
+#ifndef _MACHINE_PTE_H_
+#define _MACHINE_PTE_H_
+
+/*
+ * AMIGA hardware segment/page table entries
+ */
+
+struct pte {
+ u_int pte;
+};
+typedef u_int pt_entry_t; /* Mach page table entry */
+
+struct ste {
+ u_int ste;
+};
+typedef u_int st_entry_t; /* segment table entry */
+
+#define PT_ENTRY_NULL ((pt_entry_t *) 0)
+#define ST_ENTRY_NULL ((st_entry_t *) 0)
+
+#define SG_V 0x00000002 /* segment is valid */
+#define SG_NV 0x00000000
+#define SG_PROT 0x00000004 /* access protection mask */
+#define SG_RO 0x00000004
+#define SG_RW 0x00000000
+#define SG_U 0x00000008 /* modified bit (68040) */
+#define SG_FRAME 0xffffe000
+#define SG_IMASK 0xff000000
+#define SG_ISHIFT 24
+#define SG_PMASK 0x00ffe000
+#define SG_PSHIFT 13
+
+/* 68040 additions */
+#define SG4_MASK1 0xfe000000 /* pointer table 1 index mask */
+#define SG4_SHIFT1 25
+#define SG4_MASK2 0x01fc0000 /* pointer table 2 index mask */
+#define SG4_SHIFT2 18
+#define SG4_MASK3 0x0003e000 /* page table index mask */
+#define SG4_SHIFT3 13
+#define SG4_ADDR1 0xfffffe00 /* pointer table address mask */
+#define SG4_ADDR2 0xffffff80 /* page table address mask */
+#define SG4_LEV1SIZE 128 /* entries in pointer table 1 */
+#define SG4_LEV2SIZE 128 /* entries in pointer table 2 */
+#define SG4_LEV3SIZE 32 /* entries in page table */
+
+#define PG_V 0x00000001
+#define PG_NV 0x00000000
+#define PG_PROT 0x00000004
+#define PG_U 0x00000008
+#define PG_M 0x00000010
+#define PG_W 0x00000100
+#define PG_RO 0x00000004
+#define PG_RW 0x00000000
+#define PG_FRAME 0xffffe000
+#define PG_CI 0x00000040
+#define PG_SHIFT 13
+#define PG_PFNUM(x) (((x) & PG_FRAME) >> PG_SHIFT)
+
+/* 68040 additions */
+#define PG_CMASK 0x00000060 /* cache mode mask */
+#define PG_CWT 0x00000000 /* writethrough caching */
+#define PG_CCB 0x00000020 /* copyback caching */
+#define PG_CIS 0x00000040 /* cache inhibited serialized */
+#define PG_CIN 0x00000060 /* cache inhibited nonserialized */
+#define PG_SO 0x00000080 /* supervisor only */
+
+#define AMIGA_040RTSIZE 512 /* root (level 1) table size */
+#define AMIGA_040STSIZE 512 /* segment (level 2) table size */
+#define AMIGA_040PTSIZE 128 /* page (level 3) table size */
+#if 0
+#define AMIGA_STSIZE 1024 /* segment table size */
+#else
+#define AMIGA_STSIZE (MAXUL2SIZE*SG4_LEV2SIZE*sizeof(st_entry_t))
+#endif
+/*
+ * AMIGA_MAX_COREUPT maximum number of incore user page tables
+ * AMIGA_USER_PTSIZE the number of bytes for user pagetables
+ * AMIGA_PTBASE the VA start of the map from which upt's are allocated
+ * AMIGA_PTSIZE the size of the map from which upt's are allocated
+ * AMIGA_KPTSIZE size of kernel page table
+ * AMIGA_MAX_KPTSIZE the most number of bytes for kpt pages
+ * AMIGA_MAX_PTSIZE the number of bytes to map everything
+ */
+#define AMIGA_MAX_COREUPT 1024
+#define AMIGA_UPTSIZE roundup(VM_MAXUSER_ADDRESS / NPTEPG, NBPG)
+#define AMIGA_UPTBASE 0x10000000
+#define AMIGA_UPTMAXSIZE \
+ roundup((AMIGA_MAX_COREUPT * AMIGA_UPTSIZE), NBPG)
+#define AMIGA_MAX_KPTSIZE \
+ (AMIGA_MAX_COREUPT * AMIGA_UPTSIZE / NPTEPG)
+#define AMIGA_KPTSIZE \
+ roundup((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NPTEPG, NBPG)
+#define AMIGA_MAX_PTSIZE roundup(0xffffffff / NPTEPG, NBPG)
+
+/*
+ * Kernel virtual address to page table entry and to physical address.
+ */
+#define kvtopte(va) \
+ (&Sysmap[((unsigned)(va) - VM_MIN_KERNEL_ADDRESS) >> PGSHIFT])
+#define ptetokv(pt) \
+ ((((u_int *)(pt) - Sysmap) << PGSHIFT) + VM_MIN_KERNEL_ADDRESS)
+#define kvtophys(va) \
+ ((kvtopte(va)->pg_pfnum << PGSHIFT) | ((int)(va) & PGOFSET))
+
+
+#endif /* !_MACHINE_PTE_H_ */
diff --git a/sys/arch/amiga/include/ptrace.h b/sys/arch/amiga/include/ptrace.h
new file mode 100644
index 00000000000..24aa91a2e64
--- /dev/null
+++ b/sys/arch/amiga/include/ptrace.h
@@ -0,0 +1,8 @@
+/* $NetBSD: ptrace.h,v 1.4 1994/10/26 02:06:36 cgd Exp $ */
+
+#ifndef _MACHINE_PTRACE_H_
+#define _MACHINE_PTRACE_H_
+
+#include <m68k/ptrace.h>
+
+#endif
diff --git a/sys/arch/amiga/include/reg.h b/sys/arch/amiga/include/reg.h
new file mode 100644
index 00000000000..b485e45d618
--- /dev/null
+++ b/sys/arch/amiga/include/reg.h
@@ -0,0 +1,8 @@
+/* $NetBSD: reg.h,v 1.11 1994/10/26 02:06:37 cgd Exp $ */
+
+#ifndef _MACHINE_REG_H_
+#define _MACHINE_REG_H_
+
+#include <m68k/reg.h>
+
+#endif
diff --git a/sys/arch/amiga/include/setjmp.h b/sys/arch/amiga/include/setjmp.h
new file mode 100644
index 00000000000..7c4f40837b4
--- /dev/null
+++ b/sys/arch/amiga/include/setjmp.h
@@ -0,0 +1,3 @@
+/* $NetBSD: setjmp.h,v 1.1 1994/12/20 10:36:27 cgd Exp $ */
+
+#include <m68k/setjmp.h>
diff --git a/sys/arch/amiga/include/signal.h b/sys/arch/amiga/include/signal.h
new file mode 100644
index 00000000000..20a114a32e4
--- /dev/null
+++ b/sys/arch/amiga/include/signal.h
@@ -0,0 +1,8 @@
+/* $NetBSD: signal.h,v 1.5 1994/10/26 02:06:39 cgd Exp $ */
+
+#ifndef _MACHINE_SIGNAL_H_
+#define _MACHINE_SIGNAL_H_
+
+#include <m68k/signal.h>
+
+#endif
diff --git a/sys/arch/amiga/include/stdarg.h b/sys/arch/amiga/include/stdarg.h
new file mode 100644
index 00000000000..0717f83d839
--- /dev/null
+++ b/sys/arch/amiga/include/stdarg.h
@@ -0,0 +1,4 @@
+/* $NetBSD: stdarg.h,v 1.8 1994/10/26 02:06:40 cgd Exp $ */
+
+/* Just use the common m68k definition */
+#include <m68k/stdarg.h>
diff --git a/sys/arch/amiga/include/trap.h b/sys/arch/amiga/include/trap.h
new file mode 100644
index 00000000000..2da4dd73844
--- /dev/null
+++ b/sys/arch/amiga/include/trap.h
@@ -0,0 +1,14 @@
+/* $NetBSD: trap.h,v 1.8 1995/02/12 19:19:39 chopps Exp $ */
+
+#ifndef _MACHINE_TRAP_H_
+#define _MACHINE_TRAP_H_
+
+#include <m68k/trap.h>
+
+/*
+ * make sure we don't have this one defined, it's no longer done
+ * with the REI emulation.
+ */
+#undef T_SSIR
+
+#endif
diff --git a/sys/arch/amiga/include/types.h b/sys/arch/amiga/include/types.h
new file mode 100644
index 00000000000..3c8c13b2d3c
--- /dev/null
+++ b/sys/arch/amiga/include/types.h
@@ -0,0 +1,8 @@
+/* $NetBSD: types.h,v 1.9 1995/09/16 16:11:40 chopps Exp $ */
+
+#ifndef _MACHINE_TYPES_H_
+#define _MACHINE_TYPES_H_
+
+#include <m68k/types.h>
+
+#endif
diff --git a/sys/arch/amiga/include/varargs.h b/sys/arch/amiga/include/varargs.h
new file mode 100644
index 00000000000..24a0e69b483
--- /dev/null
+++ b/sys/arch/amiga/include/varargs.h
@@ -0,0 +1,4 @@
+/* $NetBSD: varargs.h,v 1.6 1994/10/26 02:06:46 cgd Exp $ */
+
+/* Just use the common m68k definition */
+#include <m68k/varargs.h>
diff --git a/sys/arch/amiga/include/vmparam.h b/sys/arch/amiga/include/vmparam.h
new file mode 100644
index 00000000000..2234a56fadc
--- /dev/null
+++ b/sys/arch/amiga/include/vmparam.h
@@ -0,0 +1,167 @@
+/* $NetBSD: vmparam.h,v 1.13 1994/10/26 02:06:47 cgd Exp $ */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1982, 1986, 1990 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.
+ *
+ * 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 7.3 (Berkeley) 5/7/91
+ */
+#ifndef _MACHINE_VMPARAM_H_
+#define _MACHINE_VMPARAM_H_
+
+#include <machine/pte.h>
+
+/*
+ * Machine dependent constants for HP300
+ */
+/*
+ * 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.
+ *
+ * These are a mixture of i386, sun3 and hp settings..
+ */
+
+/* Sun settings. Still hope, that I might get sun3 binaries to work... */
+#define USRTEXT 0x2000
+#define USRSTACK 0x0E000000
+#define LOWPAGES btoc(USRTEXT)
+#define KUSER_AREA (-UPAGES*NBPG)
+/*
+ * Virtual memory related constants, all in bytes
+ */
+
+#ifndef MAXTSIZ
+#define MAXTSIZ (6*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 (2*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 NBPG /* largest potential swap allocation */
+
+/*
+ * Sizes of the system and user portions of the system page table.
+ */
+/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
+#define SYSPTSIZE (2 * NPTEPG) /* 16mb */
+#define USRPTSIZE (1 * NPTEPG) /* 16mb */
+
+/*
+ * PTEs for mapping user space into the kernel for phyio operations.
+ * One page is enough to handle 16Mb of simultaneous raw IO operations.
+ */
+#ifndef USRIOSIZE
+#define USRIOSIZE (1 * NPTEPG) /* 16mb */
+#endif
+
+/*
+ * PTEs for system V style shared memory.
+ * This is basically slop for kmempt which we actually allocate (malloc) from.
+ */
+#ifndef SHMMAXPGS
+#define SHMMAXPGS (1 * NPTEPG) /* 16mb */
+#endif
+
+/*
+ * 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 */
+
+/*
+ * user/kernel map constants
+ */
+#define VM_MIN_ADDRESS ((vm_offset_t)0)
+#define VM_MAXUSER_ADDRESS ((vm_offset_t)(USRSTACK))
+#define VM_MAX_ADDRESS ((vm_offset_t)(0-(UPAGES*NBPG)))
+#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0)
+#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)(0-NBPG))
+
+/*
+ * 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)
+
+/*
+ * number of kernel PT pages (initial only, can grow dynamically)
+ */
+#define VM_KERNEL_PT_PAGES ((vm_size_t)2) /* XXX: SYSPTSIZE */
+#endif /* !_MACHINE_VMPARAM_H_ */