summaryrefslogtreecommitdiff
path: root/sys/arch/moko/include
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2008-11-26 14:47:51 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2008-11-26 14:47:51 +0000
commit8c0bacb71bee1ba1a169af8ebda59567a87ef88f (patch)
treeca1be99d32f89df936b5892e92ad6376c513e755 /sys/arch/moko/include
parentc6d65e6e11637f113bb9637929b7a7ba1382553e (diff)
Start at the port of OpenBSD to the OpenMoko hardware. Work in progress.
Diffstat (limited to 'sys/arch/moko/include')
-rw-r--r--sys/arch/moko/include/_types.h11
-rw-r--r--sys/arch/moko/include/apmvar.h1
-rw-r--r--sys/arch/moko/include/asm.h4
-rw-r--r--sys/arch/moko/include/atomic.h10
-rw-r--r--sys/arch/moko/include/bootconfig.h76
-rw-r--r--sys/arch/moko/include/bus.h4
-rw-r--r--sys/arch/moko/include/cdefs.h3
-rw-r--r--sys/arch/moko/include/conf.h19
-rw-r--r--sys/arch/moko/include/cpu.h4
-rw-r--r--sys/arch/moko/include/db_machdep.h4
-rw-r--r--sys/arch/moko/include/disklabel.h3
-rw-r--r--sys/arch/moko/include/endian.h4
-rw-r--r--sys/arch/moko/include/exec.h3
-rw-r--r--sys/arch/moko/include/float.h4
-rw-r--r--sys/arch/moko/include/fp.h4
-rw-r--r--sys/arch/moko/include/frame.h4
-rw-r--r--sys/arch/moko/include/ieee.h4
-rw-r--r--sys/arch/moko/include/ieeefp.h4
-rw-r--r--sys/arch/moko/include/internal_types.h7
-rw-r--r--sys/arch/moko/include/intr.h105
-rw-r--r--sys/arch/moko/include/limits.h4
-rw-r--r--sys/arch/moko/include/loadfile_machdep.h52
-rw-r--r--sys/arch/moko/include/lock.h4
-rw-r--r--sys/arch/moko/include/mutex.h3
-rw-r--r--sys/arch/moko/include/param.h51
-rw-r--r--sys/arch/moko/include/pcb.h4
-rw-r--r--sys/arch/moko/include/pio.h4
-rw-r--r--sys/arch/moko/include/pmap.h4
-rw-r--r--sys/arch/moko/include/proc.h4
-rw-r--r--sys/arch/moko/include/profile.h4
-rw-r--r--sys/arch/moko/include/psl.h1
-rw-r--r--sys/arch/moko/include/ptrace.h4
-rw-r--r--sys/arch/moko/include/reg.h4
-rw-r--r--sys/arch/moko/include/reloc.h2
-rw-r--r--sys/arch/moko/include/setjmp.h4
-rw-r--r--sys/arch/moko/include/signal.h4
-rw-r--r--sys/arch/moko/include/spinlock.h7
-rw-r--r--sys/arch/moko/include/stdarg.h4
-rw-r--r--sys/arch/moko/include/sysarch.h4
-rw-r--r--sys/arch/moko/include/trap.h4
-rw-r--r--sys/arch/moko/include/vmparam.h86
41 files changed, 536 insertions, 0 deletions
diff --git a/sys/arch/moko/include/_types.h b/sys/arch/moko/include/_types.h
new file mode 100644
index 00000000000..4c23f11f13c
--- /dev/null
+++ b/sys/arch/moko/include/_types.h
@@ -0,0 +1,11 @@
+/* $OpenBSD: _types.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+
+#ifndef _MOKO_TYPES_H_
+#define _MOKO_TYPES_H_
+
+#include <arm/_types.h>
+
+#define __HAVE_GENERIC_SOFT_INTERRUPTS
+#define __HAVE_TIMECOUNTER
+
+#endif
diff --git a/sys/arch/moko/include/apmvar.h b/sys/arch/moko/include/apmvar.h
new file mode 100644
index 00000000000..dfce83ed6c6
--- /dev/null
+++ b/sys/arch/moko/include/apmvar.h
@@ -0,0 +1 @@
+#include <arm/apmvar.h>
diff --git a/sys/arch/moko/include/asm.h b/sys/arch/moko/include/asm.h
new file mode 100644
index 00000000000..58a834bd185
--- /dev/null
+++ b/sys/arch/moko/include/asm.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: asm.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: asm.h,v 1.3 2001/11/25 15:55:54 thorpej Exp $ */
+
+#include <arm/asm.h>
diff --git a/sys/arch/moko/include/atomic.h b/sys/arch/moko/include/atomic.h
new file mode 100644
index 00000000000..a06ed7888eb
--- /dev/null
+++ b/sys/arch/moko/include/atomic.h
@@ -0,0 +1,10 @@
+/* $OpenBSD: atomic.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+
+/* Public Domain */
+
+#ifndef __MOKO_ATOMIC_H__
+#define __MOKO_ATOMIC_H__
+
+#include <arm/atomic.h>
+
+#endif /* __MOKO_ATOMIC_H__ */
diff --git a/sys/arch/moko/include/bootconfig.h b/sys/arch/moko/include/bootconfig.h
new file mode 100644
index 00000000000..23618d1be9a
--- /dev/null
+++ b/sys/arch/moko/include/bootconfig.h
@@ -0,0 +1,76 @@
+/* $OpenBSD: bootconfig.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: bootconfig.h,v 1.2 2001/06/21 22:08:28 chris Exp $ */
+
+/*
+ * Copyright (c) 1994 Mark Brinicombe.
+ * Copyright (c) 1994 Brini.
+ * All rights reserved.
+ *
+ * This code is derived from software written for Brini by Mark Brinicombe
+ *
+ * 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 Mark Brinicombe
+ * for the NetBSD Project.
+ * 4. The name of the company nor the name of the author may 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 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.
+ *
+ * boot configuration structures
+ *
+ * Created : 12/09/94
+ *
+ * Based on kate/boot/bootconfig.h
+ */
+
+typedef struct _PhysMem {
+ u_int address;
+ u_int pages;
+} PhysMem;
+
+#if defined(_KERNEL)
+
+#define DRAM_BLOCKS 1
+
+typedef struct _BootConfig {
+ PhysMem dram[DRAM_BLOCKS];
+ u_int dramblocks;
+} BootConfig;
+
+extern BootConfig bootconfig;
+#define MAX_BOOT_STRING 255
+
+#define BOOTOPT_TYPE_BOOLEAN 0
+#define BOOTOPT_TYPE_STRING 1
+#define BOOTOPT_TYPE_INT 2
+#define BOOTOPT_TYPE_BININT 3
+#define BOOTOPT_TYPE_HEXINT 4
+#define BOOTOPT_TYPE_MASK 7
+
+int get_bootconf_option (char *string, char *option, int type, void *result);
+
+extern char *boot_args;
+extern char *boot_file;
+#endif /* _KERNEL */
+
+/* End of bootconfig.h */
diff --git a/sys/arch/moko/include/bus.h b/sys/arch/moko/include/bus.h
new file mode 100644
index 00000000000..46728f6516e
--- /dev/null
+++ b/sys/arch/moko/include/bus.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: bus.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: bus.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
+
+#include <arm/bus.h>
diff --git a/sys/arch/moko/include/cdefs.h b/sys/arch/moko/include/cdefs.h
new file mode 100644
index 00000000000..a59e4e43757
--- /dev/null
+++ b/sys/arch/moko/include/cdefs.h
@@ -0,0 +1,3 @@
+/* $OpenBSD: cdefs.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+
+#include <arm/cdefs.h>
diff --git a/sys/arch/moko/include/conf.h b/sys/arch/moko/include/conf.h
new file mode 100644
index 00000000000..fc45d3f86a6
--- /dev/null
+++ b/sys/arch/moko/include/conf.h
@@ -0,0 +1,19 @@
+/* $OpenBSD: conf.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: conf.h,v 1.8 2002/02/10 12:26:03 chris Exp $ */
+
+#ifndef _MOKO_CONF_H
+#define _MOKO_CONF_H
+
+#include <sys/conf.h>
+
+/*
+ * MOKO specific device includes go in here
+ */
+
+//#define CONF_HAVE_APM
+#define CONF_HAVE_USB
+#define CONF_HAVE_WSCONS
+
+#include <arm/conf.h>
+
+#endif /* _MOKO_CONF_H */
diff --git a/sys/arch/moko/include/cpu.h b/sys/arch/moko/include/cpu.h
new file mode 100644
index 00000000000..cfd9d838561
--- /dev/null
+++ b/sys/arch/moko/include/cpu.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: cpu.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: cpu.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
+
+#include <arm/cpu.h>
diff --git a/sys/arch/moko/include/db_machdep.h b/sys/arch/moko/include/db_machdep.h
new file mode 100644
index 00000000000..3f4b9333e38
--- /dev/null
+++ b/sys/arch/moko/include/db_machdep.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: db_machdep.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: db_machdep.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */
+
+#include <arm/db_machdep.h>
diff --git a/sys/arch/moko/include/disklabel.h b/sys/arch/moko/include/disklabel.h
new file mode 100644
index 00000000000..1c0a7c435f1
--- /dev/null
+++ b/sys/arch/moko/include/disklabel.h
@@ -0,0 +1,3 @@
+/* $OpenBSD: disklabel.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+
+#include <arm/disklabel.h>
diff --git a/sys/arch/moko/include/endian.h b/sys/arch/moko/include/endian.h
new file mode 100644
index 00000000000..99041e16d9d
--- /dev/null
+++ b/sys/arch/moko/include/endian.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: endian.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: endian.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
+
+#include <arm/endian.h>
diff --git a/sys/arch/moko/include/exec.h b/sys/arch/moko/include/exec.h
new file mode 100644
index 00000000000..53fa453b754
--- /dev/null
+++ b/sys/arch/moko/include/exec.h
@@ -0,0 +1,3 @@
+/* $OpenBSD: exec.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* public domain */
+#include <arm/exec.h>
diff --git a/sys/arch/moko/include/float.h b/sys/arch/moko/include/float.h
new file mode 100644
index 00000000000..fa2e2249f53
--- /dev/null
+++ b/sys/arch/moko/include/float.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: float.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: float.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
+
+#include <arm/float.h>
diff --git a/sys/arch/moko/include/fp.h b/sys/arch/moko/include/fp.h
new file mode 100644
index 00000000000..9abd735a1ec
--- /dev/null
+++ b/sys/arch/moko/include/fp.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: fp.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: fp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
+
+#include <arm/fp.h>
diff --git a/sys/arch/moko/include/frame.h b/sys/arch/moko/include/frame.h
new file mode 100644
index 00000000000..110ad69ce5b
--- /dev/null
+++ b/sys/arch/moko/include/frame.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: frame.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: frame.h,v 1.1 2001/06/08 22:23:00 chris Exp $ */
+
+#include <arm/frame.h>
diff --git a/sys/arch/moko/include/ieee.h b/sys/arch/moko/include/ieee.h
new file mode 100644
index 00000000000..e1ad062370b
--- /dev/null
+++ b/sys/arch/moko/include/ieee.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: ieee.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: ieee.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
+
+#include <arm/ieee.h>
diff --git a/sys/arch/moko/include/ieeefp.h b/sys/arch/moko/include/ieeefp.h
new file mode 100644
index 00000000000..efcd0ff7ec2
--- /dev/null
+++ b/sys/arch/moko/include/ieeefp.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: ieeefp.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: ieeefp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */
+
+#include <arm/ieeefp.h>
diff --git a/sys/arch/moko/include/internal_types.h b/sys/arch/moko/include/internal_types.h
new file mode 100644
index 00000000000..a9e0d001189
--- /dev/null
+++ b/sys/arch/moko/include/internal_types.h
@@ -0,0 +1,7 @@
+/* $OpenBSD: internal_types.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* Public domain */
+#ifndef _MACHINE_INTERNAL_TYPES_H_
+#define _MACHINE_INTERNAL_TYPES_H_
+
+#include "arm/internal_types.h"
+#endif
diff --git a/sys/arch/moko/include/intr.h b/sys/arch/moko/include/intr.h
new file mode 100644
index 00000000000..f0658764ab2
--- /dev/null
+++ b/sys/arch/moko/include/intr.h
@@ -0,0 +1,105 @@
+/* $OpenBSD: intr.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: intr.h,v 1.12 2003/06/16 20:00:59 thorpej Exp $ */
+
+/*
+ * Copyright (c) 2001, 2003 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, 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 for the NetBSD Project by
+ * Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * 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 _EVBARM_INTR_H_
+#define _EVBARM_INTR_H_
+
+#ifdef _KERNEL
+
+
+/* Interrupt priority "levels". */
+#define IPL_NONE 0 /* nothing */
+#define IPL_SOFT 1 /* generic software interrupts */
+#define IPL_SOFTCLOCK 2 /* software clock interrupt */
+#define IPL_SOFTNET 3 /* software network interrupt */
+#define IPL_BIO 4 /* block I/O */
+#define IPL_NET 5 /* network */
+#define IPL_SOFTSERIAL 6 /* software serial interrupt */
+#define IPL_TTY 7 /* terminals */
+#define IPL_VM 8 /* memory allocation */
+#define IPL_AUDIO 9 /* audio device */
+#define IPL_CLOCK 10 /* clock interrupt */
+#define IPL_STATCLOCK 11 /* statistics clock interrupt */
+#define IPL_HIGH 12 /* everything */
+#define IPL_SERIAL 13 /* serial device */
+
+#define NIPL 14
+
+/* Interrupt sharing types. */
+#define IST_NONE 0 /* none */
+#define IST_PULSE 1 /* pulsed */
+#define IST_EDGE 2 /* edge-triggered */
+#define IST_LEVEL 3 /* level-triggered */
+
+#define IST_LEVEL_LOW IST_LEVEL
+#define IST_LEVEL_HIGH 4
+#define IST_EDGE_FALLING IST_EDGE
+#define IST_EDGE_RISING 5
+#define IST_EDGE_BOTH 6
+
+#ifndef _LOCORE
+
+#include <sys/device.h>
+#include <sys/queue.h>
+
+#define splhigh() _splraise(IPL_HIGH)
+#define splsoft() _splraise(IPL_SOFT)
+#define splsoftclock() _splraise(IPL_SOFTCLOCK)
+#define splsoftnet() _splraise(IPL_SOFTNET)
+#define splbio() _splraise(IPL_BIO)
+#define splnet() _splraise(IPL_NET)
+#define spltty() _splraise(IPL_TTY)
+#define splvm() _splraise(IPL_VM)
+#define splaudio() _splraise(IPL_AUDIO)
+#define splclock() _splraise(IPL_CLOCK)
+#define splstatclock() _splraise(IPL_STATCLOCK)
+#define splserial() _splraise(IPL_SERIAL)
+
+#define spl0() _spllower(IPL_NONE)
+
+#define splsched() splhigh()
+#define spllock() splhigh()
+
+#endif /* ! _LOCORE */
+
+#include <arm/s3c2xx0/s3c2410_intr.h>
+
+#endif /* _KERNEL */
+
+#endif /* _EVBARM_INTR_H_ */
+
diff --git a/sys/arch/moko/include/limits.h b/sys/arch/moko/include/limits.h
new file mode 100644
index 00000000000..96b0001ec1e
--- /dev/null
+++ b/sys/arch/moko/include/limits.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: limits.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: limits.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
+
+#include <arm/limits.h>
diff --git a/sys/arch/moko/include/loadfile_machdep.h b/sys/arch/moko/include/loadfile_machdep.h
new file mode 100644
index 00000000000..4390f306174
--- /dev/null
+++ b/sys/arch/moko/include/loadfile_machdep.h
@@ -0,0 +1,52 @@
+/* $OpenBSD: loadfile_machdep.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: loadfile_machdep.h,v 1.1 1999/04/29 03:17:12 tsubai Exp $ */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#define BOOT_ELF
+#define ELFSIZE 32
+
+#define LOAD_KERNEL (LOAD_ALL & ~LOAD_TEXTA)
+#define COUNT_KERNEL (COUNT_ALL & ~COUNT_TEXTA)
+
+#define LOADADDR(a) ((((u_long)(a)) + offset)&0xfffffff)
+#define ALIGNENTRY(a) ((u_long)(a))
+#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c))
+#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c))
+#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c))
+#define WARN(a) (void)(printf a, \
+ printf((errno ? ": %s\n" : "\n"), \
+ strerror(errno)))
+#define PROGRESS(a) (void) printf a
+#define ALLOC(a) alloc(a)
+#define FREE(a, b) free(a, b)
+#define OKMAGIC(a) ((a) == OMAGIC)
+
+void run_loadfile(u_long *, int);
diff --git a/sys/arch/moko/include/lock.h b/sys/arch/moko/include/lock.h
new file mode 100644
index 00000000000..707232f98cf
--- /dev/null
+++ b/sys/arch/moko/include/lock.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: lock.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: lock.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
+
+#include <arm/lock.h>
diff --git a/sys/arch/moko/include/mutex.h b/sys/arch/moko/include/mutex.h
new file mode 100644
index 00000000000..6324ae4058d
--- /dev/null
+++ b/sys/arch/moko/include/mutex.h
@@ -0,0 +1,3 @@
+/* $OpenBSD: mutex.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* public domain */
+#include <arm/mutex.h>
diff --git a/sys/arch/moko/include/param.h b/sys/arch/moko/include/param.h
new file mode 100644
index 00000000000..3fa378f46b5
--- /dev/null
+++ b/sys/arch/moko/include/param.h
@@ -0,0 +1,51 @@
+/* $OpenBSD: param.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: param.h,v 1.4 2002/02/12 06:58:19 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1994,1995 Mark Brinicombe.
+ * 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 RiscBSD team.
+ * 4. The name "RiscBSD" nor the name of the author may be used to
+ * endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY RISCBSD ``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 RISCBSD 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 _MOKO_PARAM_H_
+#define _MOKO_PARAM_H_
+
+/*
+ * 1 page should be enough
+ */
+#ifndef MSGBUFSIZE
+#define MSGBUFSIZE (1*NBPG)
+#endif
+
+#include <arm/param.h>
+
+#define _MACHINE moko
+#define MACHINE "moko"
+
+#endif /* _MOKO_PARAM_H_ */
diff --git a/sys/arch/moko/include/pcb.h b/sys/arch/moko/include/pcb.h
new file mode 100644
index 00000000000..680c1fe87b5
--- /dev/null
+++ b/sys/arch/moko/include/pcb.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: pcb.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: pcb.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
+
+#include <arm/pcb.h>
diff --git a/sys/arch/moko/include/pio.h b/sys/arch/moko/include/pio.h
new file mode 100644
index 00000000000..1360b2c43f7
--- /dev/null
+++ b/sys/arch/moko/include/pio.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: pio.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: pio.h,v 1.3 2001/12/07 23:09:33 chris Exp $ */
+
+#include <arm/pio.h>
diff --git a/sys/arch/moko/include/pmap.h b/sys/arch/moko/include/pmap.h
new file mode 100644
index 00000000000..2be90c7642d
--- /dev/null
+++ b/sys/arch/moko/include/pmap.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: pmap.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: pmap.h,v 1.2 2001/11/23 17:29:01 thorpej Exp $ */
+
+#include <arm/pmap.h>
diff --git a/sys/arch/moko/include/proc.h b/sys/arch/moko/include/proc.h
new file mode 100644
index 00000000000..7612fc2e983
--- /dev/null
+++ b/sys/arch/moko/include/proc.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: proc.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: proc.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
+
+#include <arm/proc.h>
diff --git a/sys/arch/moko/include/profile.h b/sys/arch/moko/include/profile.h
new file mode 100644
index 00000000000..6f5dac5f8d2
--- /dev/null
+++ b/sys/arch/moko/include/profile.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: profile.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: profile.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */
+
+#include <arm/profile.h>
diff --git a/sys/arch/moko/include/psl.h b/sys/arch/moko/include/psl.h
new file mode 100644
index 00000000000..bea8545a2c9
--- /dev/null
+++ b/sys/arch/moko/include/psl.h
@@ -0,0 +1 @@
+/* $OpenBSD: psl.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
diff --git a/sys/arch/moko/include/ptrace.h b/sys/arch/moko/include/ptrace.h
new file mode 100644
index 00000000000..3e6c527c823
--- /dev/null
+++ b/sys/arch/moko/include/ptrace.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: ptrace.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: ptrace.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/ptrace.h>
diff --git a/sys/arch/moko/include/reg.h b/sys/arch/moko/include/reg.h
new file mode 100644
index 00000000000..f5890b92e76
--- /dev/null
+++ b/sys/arch/moko/include/reg.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: reg.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: reg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/reg.h>
diff --git a/sys/arch/moko/include/reloc.h b/sys/arch/moko/include/reloc.h
new file mode 100644
index 00000000000..a3f2d660180
--- /dev/null
+++ b/sys/arch/moko/include/reloc.h
@@ -0,0 +1,2 @@
+/* $OpenBSD: reloc.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+#include <arm/reloc.h>
diff --git a/sys/arch/moko/include/setjmp.h b/sys/arch/moko/include/setjmp.h
new file mode 100644
index 00000000000..0b9adcf6bf3
--- /dev/null
+++ b/sys/arch/moko/include/setjmp.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: setjmp.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: setjmp.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/setjmp.h>
diff --git a/sys/arch/moko/include/signal.h b/sys/arch/moko/include/signal.h
new file mode 100644
index 00000000000..a372fb8119d
--- /dev/null
+++ b/sys/arch/moko/include/signal.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: signal.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: signal.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/signal.h>
diff --git a/sys/arch/moko/include/spinlock.h b/sys/arch/moko/include/spinlock.h
new file mode 100644
index 00000000000..784f95c8aee
--- /dev/null
+++ b/sys/arch/moko/include/spinlock.h
@@ -0,0 +1,7 @@
+
+/* $OpenBSD: spinlock.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+#ifndef _MOKO_SPINLOCK_H_
+#define _MOKO_SPINLOCK_H_
+#include <arm/spinlock.h>
+#endif /* _MOKO_SPINLOCK_H_ */
+
diff --git a/sys/arch/moko/include/stdarg.h b/sys/arch/moko/include/stdarg.h
new file mode 100644
index 00000000000..8d28cc23536
--- /dev/null
+++ b/sys/arch/moko/include/stdarg.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: stdarg.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: stdarg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/stdarg.h>
diff --git a/sys/arch/moko/include/sysarch.h b/sys/arch/moko/include/sysarch.h
new file mode 100644
index 00000000000..c63aca4c916
--- /dev/null
+++ b/sys/arch/moko/include/sysarch.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: sysarch.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: sysarch.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/sysarch.h>
diff --git a/sys/arch/moko/include/trap.h b/sys/arch/moko/include/trap.h
new file mode 100644
index 00000000000..8223c2b18bf
--- /dev/null
+++ b/sys/arch/moko/include/trap.h
@@ -0,0 +1,4 @@
+/* $OpenBSD: trap.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: trap.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */
+
+#include <arm/trap.h>
diff --git a/sys/arch/moko/include/vmparam.h b/sys/arch/moko/include/vmparam.h
new file mode 100644
index 00000000000..14a3a237c34
--- /dev/null
+++ b/sys/arch/moko/include/vmparam.h
@@ -0,0 +1,86 @@
+/* $OpenBSD: vmparam.h,v 1.1 2008/11/26 14:47:50 drahn Exp $ */
+/* $NetBSD: vmparam.h,v 1.23 2003/05/22 05:47:07 thorpej Exp $ */
+
+/*
+ * Copyright (c) 1988 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. 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 _ARM32_VMPARAM_H_
+#define _ARM32_VMPARAM_H_
+
+#define ARM_KERNEL_BASE 0xc0000000
+
+#include <arm/vmparam.h>
+
+#ifdef _KERNEL
+/*
+ * Address space constants
+ */
+
+/*
+ * The line between user space and kernel space
+ * Mappings >= KERNEL_BASE are constant across all processes
+ */
+#define KERNEL_BASE ARM_KERNEL_BASE
+
+/*
+ * Override the default pager_map size, there's not enough KVA.
+ */
+#define PAGER_MAP_SIZE (4 * 1024 * 1024)
+
+/*
+ * Size of User Raw I/O map
+ */
+
+#define USRIOSIZE 300
+
+/* virtual sizes (bytes) for various kernel submaps */
+
+#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
+
+/*
+ * max number of non-contig chunks of physical RAM you can have
+ */
+
+#define VM_PHYSSEG_MAX 1
+#define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM
+
+/*
+ * this indicates that we can't add RAM to the VM system after the
+ * vm system is init'd.
+ */
+
+#define VM_PHYSSEG_NOADD
+
+#endif /* _KERNEL */
+
+#define VM_NFREELIST 1
+#define VM_FREELIST_DEFAULT 0
+
+
+#endif /* _ARM32_VMPARAM_H_ */