From 8c0bacb71bee1ba1a169af8ebda59567a87ef88f Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Wed, 26 Nov 2008 14:47:51 +0000 Subject: Start at the port of OpenBSD to the OpenMoko hardware. Work in progress. --- sys/arch/moko/include/_types.h | 11 ++++ sys/arch/moko/include/apmvar.h | 1 + sys/arch/moko/include/asm.h | 4 ++ sys/arch/moko/include/atomic.h | 10 +++ sys/arch/moko/include/bootconfig.h | 76 ++++++++++++++++++++++ sys/arch/moko/include/bus.h | 4 ++ sys/arch/moko/include/cdefs.h | 3 + sys/arch/moko/include/conf.h | 19 ++++++ sys/arch/moko/include/cpu.h | 4 ++ sys/arch/moko/include/db_machdep.h | 4 ++ sys/arch/moko/include/disklabel.h | 3 + sys/arch/moko/include/endian.h | 4 ++ sys/arch/moko/include/exec.h | 3 + sys/arch/moko/include/float.h | 4 ++ sys/arch/moko/include/fp.h | 4 ++ sys/arch/moko/include/frame.h | 4 ++ sys/arch/moko/include/ieee.h | 4 ++ sys/arch/moko/include/ieeefp.h | 4 ++ sys/arch/moko/include/internal_types.h | 7 +++ sys/arch/moko/include/intr.h | 105 +++++++++++++++++++++++++++++++ sys/arch/moko/include/limits.h | 4 ++ sys/arch/moko/include/loadfile_machdep.h | 52 +++++++++++++++ sys/arch/moko/include/lock.h | 4 ++ sys/arch/moko/include/mutex.h | 3 + sys/arch/moko/include/param.h | 51 +++++++++++++++ sys/arch/moko/include/pcb.h | 4 ++ sys/arch/moko/include/pio.h | 4 ++ sys/arch/moko/include/pmap.h | 4 ++ sys/arch/moko/include/proc.h | 4 ++ sys/arch/moko/include/profile.h | 4 ++ sys/arch/moko/include/psl.h | 1 + sys/arch/moko/include/ptrace.h | 4 ++ sys/arch/moko/include/reg.h | 4 ++ sys/arch/moko/include/reloc.h | 2 + sys/arch/moko/include/setjmp.h | 4 ++ sys/arch/moko/include/signal.h | 4 ++ sys/arch/moko/include/spinlock.h | 7 +++ sys/arch/moko/include/stdarg.h | 4 ++ sys/arch/moko/include/sysarch.h | 4 ++ sys/arch/moko/include/trap.h | 4 ++ sys/arch/moko/include/vmparam.h | 86 +++++++++++++++++++++++++ 41 files changed, 536 insertions(+) create mode 100644 sys/arch/moko/include/_types.h create mode 100644 sys/arch/moko/include/apmvar.h create mode 100644 sys/arch/moko/include/asm.h create mode 100644 sys/arch/moko/include/atomic.h create mode 100644 sys/arch/moko/include/bootconfig.h create mode 100644 sys/arch/moko/include/bus.h create mode 100644 sys/arch/moko/include/cdefs.h create mode 100644 sys/arch/moko/include/conf.h create mode 100644 sys/arch/moko/include/cpu.h create mode 100644 sys/arch/moko/include/db_machdep.h create mode 100644 sys/arch/moko/include/disklabel.h create mode 100644 sys/arch/moko/include/endian.h create mode 100644 sys/arch/moko/include/exec.h create mode 100644 sys/arch/moko/include/float.h create mode 100644 sys/arch/moko/include/fp.h create mode 100644 sys/arch/moko/include/frame.h create mode 100644 sys/arch/moko/include/ieee.h create mode 100644 sys/arch/moko/include/ieeefp.h create mode 100644 sys/arch/moko/include/internal_types.h create mode 100644 sys/arch/moko/include/intr.h create mode 100644 sys/arch/moko/include/limits.h create mode 100644 sys/arch/moko/include/loadfile_machdep.h create mode 100644 sys/arch/moko/include/lock.h create mode 100644 sys/arch/moko/include/mutex.h create mode 100644 sys/arch/moko/include/param.h create mode 100644 sys/arch/moko/include/pcb.h create mode 100644 sys/arch/moko/include/pio.h create mode 100644 sys/arch/moko/include/pmap.h create mode 100644 sys/arch/moko/include/proc.h create mode 100644 sys/arch/moko/include/profile.h create mode 100644 sys/arch/moko/include/psl.h create mode 100644 sys/arch/moko/include/ptrace.h create mode 100644 sys/arch/moko/include/reg.h create mode 100644 sys/arch/moko/include/reloc.h create mode 100644 sys/arch/moko/include/setjmp.h create mode 100644 sys/arch/moko/include/signal.h create mode 100644 sys/arch/moko/include/spinlock.h create mode 100644 sys/arch/moko/include/stdarg.h create mode 100644 sys/arch/moko/include/sysarch.h create mode 100644 sys/arch/moko/include/trap.h create mode 100644 sys/arch/moko/include/vmparam.h (limited to 'sys/arch/moko/include') 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 + +#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 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 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 + +#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 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 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 + +/* + * MOKO specific device includes go in here + */ + +//#define CONF_HAVE_APM +#define CONF_HAVE_USB +#define CONF_HAVE_WSCONS + +#include + +#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 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 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 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 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 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 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 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 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 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 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 +#include + +#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 + +#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 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 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 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 + +#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 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 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 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 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 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 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 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 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 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 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 +#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 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 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 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 + +#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_ */ -- cgit v1.2.3