diff --git a/sys/arch/dnard/include/Makefile b/sys/arch/dnard/include/Makefile new file mode 100644 index 000000000000..67da7294ce3b --- /dev/null +++ b/sys/arch/dnard/include/Makefile @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.1 2001/05/09 15:40:54 matt Exp $ + +KDIR= /sys/arch/dnard/include +INCSDIR= /usr/include/arm/dnard + +INCS= ansi.h aout_machdep.h asm.h \ + beep.h bootconfig.h bswap.h bus.h \ + cdefs.h conf.h cpu.h cpufunc.h cpus.h \ + db_machdep.h disklabel.h disklabel_acorn.h \ + endian.h endian_machdep.h \ + float.h fp.h frame.h \ + ieee.h ieeefp.h int_types.h intr.h ipkdb.h irqhandler.h \ + joystick.h \ + katelib.h kbd.h \ + limits.h lock.h \ + math.h \ + param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \ + reg.h \ + setjmp.h signal.h stdarg.h sysarch.h \ + trap.h types.h \ + undefined.h \ + varargs.h vmparam.h + +.include diff --git a/sys/arch/dnard/include/bootconfig.h b/sys/arch/dnard/include/bootconfig.h new file mode 100644 index 000000000000..3639d43555c3 --- /dev/null +++ b/sys/arch/dnard/include/bootconfig.h @@ -0,0 +1,92 @@ +/* $NetBSD: bootconfig.h,v 1.1 2001/05/09 15:40:54 matt 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 + */ + +#ifdef _KERNEL +typedef struct _PhysMem { + u_int address; + u_int pages; + int list; +} PhysMem; + +/* + * Currently several bootconfig structure members are used + * in the arm32 generic part. This needs to be fixed. + * In the mean time just define the fields required + * to get the files to compile. + * To solve this either + * 1. fake a bootconfig structure as required + * 2. provide a generic structure for this information + * (need to see the shark code first) + * 3. move the dependant routines to the machine specific + * areas (e.g. move dumpsys() to *_machdep.c + * + * 1 is probably the simplest stop gap measure + * 2 is the solution I plan on using. + * + * code affected: pmap.c stubs.c + */ + +#define DRAM_BLOCKS 33 + +typedef struct _BootConfig { + PhysMem dram[DRAM_BLOCKS]; + u_int dramblocks; +} BootConfig; + +extern BootConfig bootconfig; + +#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 __P((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/dnard/include/bus.h b/sys/arch/dnard/include/bus.h new file mode 100644 index 000000000000..4602ca0179d9 --- /dev/null +++ b/sys/arch/dnard/include/bus.h @@ -0,0 +1,4 @@ +/* $NetBSD: bus.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#include + diff --git a/sys/arch/dnard/include/conf.h b/sys/arch/dnard/include/conf.h new file mode 100644 index 000000000000..240067bc76fd --- /dev/null +++ b/sys/arch/dnard/include/conf.h @@ -0,0 +1,105 @@ +/* $NetBSD: conf.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +/* + * Copyright (c) 1997 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 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. + * + * RiscBSD kernel project + * + * conf.h + * + * Prototypes for device driver functions + */ + +#include + +bdev_decl(wd); +cdev_decl(wd); +bdev_decl(sw); +cdev_decl(sw); +bdev_decl(md); +cdev_decl(md); +bdev_decl(raid); +cdev_decl(raid); + +/* Character device declarations */ + +/* open, close, read, write, ioctl, tty, mmap */ +#define cdev_physcon_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ + dev_init(c,n,write), dev_init(c,n,ioctl), dev_init(c,n,stop), \ + dev_init(c,n,tty), ttpoll, dev_init(c,n,mmap), 0 } + +/* open, close, read, ioctl */ +#define cdev_joy_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ + (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ + (dev_type_stop((*))) enodev, 0, seltrue, \ + (dev_type_mmap((*))) enodev } + +/* open, close, write, ioctl */ +#define cdev_cpu_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ + (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ + (dev_type_stop((*))) enodev, \ + 0, seltrue, (dev_type_mmap((*))) enodev, 0 } + +/* open, close, read, ioctl */ +#define cdev_prof_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ + (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ + (dev_type_stop((*))) nullop, 0, (dev_type_poll((*))) enodev, \ + (dev_type_mmap((*))) enodev } + +#define mmread mmrw +#define mmwrite mmrw +cdev_decl(mm); + +cdev_decl(com); +cdev_decl(lpt); +cdev_decl(pms); +cdev_decl(cpu); +cdev_decl(ofcons_); +cdev_decl(ofd); +cdev_decl(ofrtc); +cdev_decl(scr); +cdev_decl(prof); +#define ofromread ofromrw +#define ofromwrite ofromrw +cdev_decl(ofrom); +cdev_decl(joy); +cdev_decl(vc_nb_); +cdev_decl(wsdisplay); +cdev_decl(wskbd); +cdev_decl(wsmouse); +cdev_decl(wsmux); +cdev_decl(scsibus); +cdev_decl(openfirm); diff --git a/sys/arch/dnard/include/cpufunc.h b/sys/arch/dnard/include/cpufunc.h new file mode 100644 index 000000000000..a474d00f99a3 --- /dev/null +++ b/sys/arch/dnard/include/cpufunc.h @@ -0,0 +1,4 @@ +/* $NetBSD: cpufunc.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#include + diff --git a/sys/arch/dnard/include/cpus.h b/sys/arch/dnard/include/cpus.h new file mode 100644 index 000000000000..aa209622ea77 --- /dev/null +++ b/sys/arch/dnard/include/cpus.h @@ -0,0 +1,4 @@ +/* $NetBSD: cpus.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#include + diff --git a/sys/arch/dnard/include/ipkdb.h b/sys/arch/dnard/include/ipkdb.h new file mode 100644 index 000000000000..0943b3c2ade7 --- /dev/null +++ b/sys/arch/dnard/include/ipkdb.h @@ -0,0 +1,4 @@ +/* $NetBSD: ipkdb.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#include + diff --git a/sys/arch/dnard/include/irqhandler.h b/sys/arch/dnard/include/irqhandler.h new file mode 100644 index 000000000000..274a72155ff7 --- /dev/null +++ b/sys/arch/dnard/include/irqhandler.h @@ -0,0 +1,159 @@ +/* $NetBSD: irqhandler.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +/* + * Copyright (c) 1994-1996 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. + * + * IRQ related stuff (defines + structures) + * + * Created : 30/09/94 + */ + +#ifndef _ARM32_IRQHANDLER_H_ +#define _ARM32_IRQHANDLER_H_ + +#if defined(_KERNEL) && !defined(_LKM) +#include "opt_cputypes.h" +#endif + +#ifndef _LOCORE +#include +#endif /* _LOCORE */ + +/* Define the IRQ bits */ + +/* + * shark hardware requirements for IRQ's: + * IDE: 14 (hardwired) + * PCI: 5, 9, 10, 11, 15(mapped to UMIPCI inta, intb, intc, intd) + * UMIISA: 10, 11, 12 + * SuperIO: 1, 3..12, 14, 15(all may be remapped. defaults as follows.) + * KBC: 1 + * USI: 3 (UART with Slow Infrared support) + * UART: 4 + * FLOPPY: 6 (not currently used on shark) + * PARALLEL: 7 + * RTC: 8 (not used on shark: RTC in sequoia used) + * MOUSE: 12 + * Sequoia: 8 (internal RTC hardwired to irq 8) + * Codec: 5, 7, 9, 10, 15 (irqe, connected to 15, has special status.) + * CS8900: 5, 10, 11, 12 (P.14 of datasheet sez only 1 used/time) + * FERR#: 13 (unconnected floating point error) + * + * total of 15 irqs: + * timer, ide, 2 umi = isa/pci, ethernet, 2 codec, kb, usi, uart, floppy, + * parallel, rtc, mouse, ferr (irq 13) + * + * eventually, need to read the OFW dev info tree, and allocate IRQs. + * hardcoded for now. + */ +#define IRQ_TIMER0 0x00 /* hardwired to 8254 counter 0 in sequoia */ +#define IRQ_KEYBOARD 0x01 +#define IRQ_CASCADE 0x02 /* hardwired IRQ for second 8259 = IRQ_SLAVE */ +#define IRQ_USI 0x03 +#define IRQ_UART 0x04 +#define IRQ_ETHERNET 0x05 +#define IRQ_FLOPPY 0x06 +#define IRQ_PARALLEL 0x07 + +#define IRQ_RTC 0x08 /* hardwired to the sequoia RTC */ +#define IRQ_CODEC1 0x09 +#define IRQ_UMI1 0x0A /* isa or pci */ +#define IRQ_UMI2 0x0B /* isa or pci */ + +#define IRQ_MOUSE 0x0C +#define IRQ_FERR 0x0D /* FERR# pin on sequoia needs to be connected */ +#define IRQ_IDE 0x0E /* hardwired to the IDE connector */ +#define IRQ_CODEC2 0x0F /* special interrupt on codec */ + +#define IRQ_VSYNC IRQ_FLYBACK /* Aliased */ +#define IRQ_NETSLOT IRQ_EXTENDED + +#define IRQ_INSTRUCT -1 +#define NIRQS 0x20 + +#include + +#ifndef _LOCORE +typedef struct irqhandler { + int (*ih_func) __P((void *arg));/* handler function */ + void *ih_arg; /* Argument to handler */ + int ih_level; /* Interrupt level */ + int ih_num; /* Interrupt number (for accounting) */ + const char *ih_name; /* Name of interrupt (for vmstat -i) */ + u_int ih_flags; /* Interrupt flags */ + u_int ih_maskaddr; /* mask address for expansion cards */ + u_int ih_maskbits; /* interrupt bit for expansion cards */ + struct irqhandler *ih_next; /* next handler */ +} irqhandler_t; + +#ifdef _KERNEL +extern u_int irqmasks[IPL_LEVELS]; +extern irqhandler_t *irqhandlers[NIRQS]; + +void irq_init __P((void)); +int irq_claim __P((int, irqhandler_t *)); +int irq_release __P((int, irqhandler_t *)); +void *intr_claim __P((int irq, int level, const char *name, int (*func) __P((void *)), void *arg)); +int intr_release __P((void *ih)); +void irq_setmasks __P((void)); +void disable_irq __P((int)); +void enable_irq __P((int)); +#endif /* _KERNEL */ +#endif /* _LOCORE */ + +#define IRQ_FLAG_ACTIVE 0x00000001 /* This is the active handler in list */ + +#ifndef _LOCORE +typedef struct fiqhandler { + void (*fh_func) __P((void));/* handler function */ + u_int fh_size; /* Size of handler function */ + u_int fh_mask; /* FIQ mask */ + u_int fh_r8; /* FIQ mode r8 */ + u_int fh_r9; /* FIQ mode r9 */ + u_int fh_r10; /* FIQ mode r10 */ + u_int fh_r11; /* FIQ mode r11 */ + u_int fh_r12; /* FIQ mode r12 */ + u_int fh_r13; /* FIQ mode r13 */ +} fiqhandler_t; + +#ifdef _KERNEL +int fiq_claim __P((fiqhandler_t *)); +int fiq_release __P((fiqhandler_t *)); +#endif /* _KERNEL */ +#endif /* _LOCORE */ + +#endif /* _ARM32_IRQHANDLER_H_ */ + +/* End of irqhandler.h */ diff --git a/sys/arch/dnard/include/isa_machdep.h b/sys/arch/dnard/include/isa_machdep.h new file mode 100644 index 000000000000..3950ae4a31cb --- /dev/null +++ b/sys/arch/dnard/include/isa_machdep.h @@ -0,0 +1,3 @@ +/* $NetBSD: isa_machdep.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#include diff --git a/sys/arch/dnard/include/joystick.h b/sys/arch/dnard/include/joystick.h new file mode 100644 index 000000000000..88c4bad7ae2b --- /dev/null +++ b/sys/arch/dnard/include/joystick.h @@ -0,0 +1,23 @@ +/* $NetBSD: joystick.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#ifndef _JOY_IOCTL_H_ +#define _JOY_IOCTL_H_ + +#include +#include + +struct joystick { + int x; + int y; + int b1; + int b2; +}; + +#define JOY_SETTIMEOUT _IOW('J', 1, int) /* set timeout */ +#define JOY_GETTIMEOUT _IOR('J', 2, int) /* get timeout */ +#define JOY_SET_X_OFFSET _IOW('J', 3, int) /* set offset on X-axis */ +#define JOY_SET_Y_OFFSET _IOW('J', 4, int) /* set offset on X-axis */ +#define JOY_GET_X_OFFSET _IOR('J', 5, int) /* get offset on X-axis */ +#define JOY_GET_Y_OFFSET _IOR('J', 6, int) /* get offset on Y-axis */ + +#endif /* _JOY_IOCTL_H_ */ diff --git a/sys/arch/dnard/include/katelib.h b/sys/arch/dnard/include/katelib.h new file mode 100644 index 000000000000..644e8e92dc7e --- /dev/null +++ b/sys/arch/dnard/include/katelib.h @@ -0,0 +1,4 @@ +/* $NetBSD: katelib.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +#include + diff --git a/sys/arch/dnard/include/kerndebug.h b/sys/arch/dnard/include/kerndebug.h new file mode 100644 index 000000000000..8ebba45a698a --- /dev/null +++ b/sys/arch/dnard/include/kerndebug.h @@ -0,0 +1,132 @@ +/* $NetBSD: kerndebug.h,v 1.1 2001/05/09 15:40:55 matt Exp $ */ + +/* + * Copyright 1997 + * Digital Equipment Corporation. All rights reserved. + * + * This software is furnished under license and may be used and + * copied only in accordance with the following terms and conditions. + * Subject to these conditions, you may download, copy, install, + * use, modify and distribute this software in source and/or binary + * form. No title or ownership is transferred hereby. + * + * 1) Any source code used, modified or distributed must reproduce + * and retain this copyright notice and list of conditions as + * they appear in the source file. + * + * 2) No right is granted to use any trade name, trademark, or logo of + * Digital Equipment Corporation. Neither the "Digital Equipment + * Corporation" name nor any trademark or logo of Digital Equipment + * Corporation may be used to endorse or promote products derived + * from this software without the prior written permission of + * Digital Equipment Corporation. + * + * 3) This software is provided "AS-IS" and any express or implied + * warranties, including but not limited to, any implied warranties + * of merchantability, fitness for a particular purpose, or + * non-infringement are disclaimed. In no event shall DIGITAL be + * liable for any damages whatsoever, and in particular, DIGITAL + * shall not be liable for special, indirect, consequential, or + * incidental damages or damages for lost profits, loss of + * revenue or loss of use, whether such damages arise in contract, + * negligence, tort, under statute, in equity, at law or otherwise, + * even if advised of the possibility of such damage. + */ + +/* +**++ +** FACILITY: +** +** kerndebug.h +** +** +** ABSTRACT: +** +** This header provides generic debugging capabilities using printf. +** All debugging can be compiled out by not defining the +** KERNEL_DEBUG macro. In addition the amount of debug output is +** defined by individual variables controlled by each subsystem +** using this utility. Finally note that the two middle bytes of +** the kern debug flags (bits 16 to 23) are free for individual +** subsystems to use as they please (eg. define switches for +** individual functions etc). +** +** AUTHORS: +** +** John Court +** +** CREATION DATE: 2-Feb-1992 +** +** MODIFICATION HISTORY: +** +**-- +*/ +#ifndef _KERNDEBUG_H_ +#define _KERNDEBUG_H_ + +#define KERN_DEBUG_INFO 0x00000001 +#define KERN_DEBUG_WARNING 0x00000002 +#define KERN_DEBUG_ERROR 0x00000010 +#define KERN_DEBUG_SMP 0x00000020 +#define KERN_DEBUG_PANIC 0x40000000 +#define KERN_REAL_PANIC 0x80000000 +#define KERN_DEBUG_ALL KERN_DEBUG_INFO | KERN_DEBUG_WARNING | \ + KERN_DEBUG_ERROR | KERN_DEBUG_PANIC +/* +** Define the type for debugging flag subsystem variables +*/ +typedef unsigned int Kern_Debug_Flags; +/* +** Set up source line location macro for extra debugging and panics +*/ +#ifdef __FILE__ +#define KERN_DEBUG_LOC ":%s:%d:=\n\t",__FILE__,__LINE__ +#else +#define KERN_DEBUG_LOC ":__FILE__ not supported :=\n\t" +#endif + +/* +** This is real nasty in that it requires several printf's but is +** unavoidable due to the differences between +** preprocessors supporting standard ANSI C and others. +** +** NOTE: The format of calls to this macro must be +** +** KERN_DEBUG((Kern_Debug_Flags)CntrlVar, KERN_DEBUG_xxxx, +** (normal printf arguments)); +** +** pay special attention to the extra set of () around the +** final arguement. +** +*/ +#ifdef KERNEL_DEBUG +#define KERN_DEBUG(CntrlVar,Level,Output) \ +{ \ + if ( (CntrlVar) & (Level) ) \ + { \ + if ( (CntrlVar) & (Level) & KERN_DEBUG_PANIC ) \ + { \ + printf ("KERNEL:DEBUG PANIC"); \ + printf (KERN_DEBUG_LOC); \ + printf Output; \ + panic("KERN_DEBUG Panicing"); \ + } \ + else \ + { \ + printf Output; \ + } \ + } \ +} +#else /* else KERNEL_DEBUG not defined */ +#define KERN_DEBUG(CntrlVar,Level,Output) +#endif /* end else KERNEL_DEBUG not defined */ + +#endif /* _KERNDEBUG_H_ */ + + + + + + + + diff --git a/sys/arch/dnard/include/ofw.h b/sys/arch/dnard/include/ofw.h new file mode 100644 index 000000000000..8f5a75be6d28 --- /dev/null +++ b/sys/arch/dnard/include/ofw.h @@ -0,0 +1,3 @@ +/* $NetBSD: ofw.h,v 1.1 2001/05/09 15:40:56 matt Exp $ */ + +#include diff --git a/sys/arch/dnard/include/profileio.h b/sys/arch/dnard/include/profileio.h new file mode 100644 index 000000000000..ed5de7f5579f --- /dev/null +++ b/sys/arch/dnard/include/profileio.h @@ -0,0 +1,3 @@ +/* $NetBSD: profileio.h,v 1.1 2001/05/09 15:40:56 matt Exp $ */ + +#include diff --git a/sys/arch/dnard/include/psl.h b/sys/arch/dnard/include/psl.h new file mode 100644 index 000000000000..e70417965c4d --- /dev/null +++ b/sys/arch/dnard/include/psl.h @@ -0,0 +1,4 @@ +/* $NetBSD: psl.h,v 1.1 2001/05/09 15:40:56 matt Exp $ */ + +#include + diff --git a/sys/arch/dnard/include/scrio.h b/sys/arch/dnard/include/scrio.h new file mode 100644 index 000000000000..955b063503d7 --- /dev/null +++ b/sys/arch/dnard/include/scrio.h @@ -0,0 +1,97 @@ +/* $NetBSD: scrio.h,v 1.1 2001/05/09 15:40:56 matt Exp $ */ + +/* + * Copyright 1997 + * Digital Equipment Corporation. All rights reserved. + * + * This software is furnished under license and may be used and + * copied only in accordance with the following terms and conditions. + * Subject to these conditions, you may download, copy, install, + * use, modify and distribute this software in source and/or binary + * form. No title or ownership is transferred hereby. + * + * 1) Any source code used, modified or distributed must reproduce + * and retain this copyright notice and list of conditions as + * they appear in the source file. + * + * 2) No right is granted to use any trade name, trademark, or logo of + * Digital Equipment Corporation. Neither the "Digital Equipment + * Corporation" name nor any trademark or logo of Digital Equipment + * Corporation may be used to endorse or promote products derived + * from this software without the prior written permission of + * Digital Equipment Corporation. + * + * 3) This software is provided "AS-IS" and any express or implied + * warranties, including but not limited to, any implied warranties + * of merchantability, fitness for a particular purpose, or + * non-infringement are disclaimed. In no event shall DIGITAL be + * liable for any damages whatsoever, and in particular, DIGITAL + * shall not be liable for special, indirect, consequential, or + * incidental damages or damages for lost profits, loss of + * revenue or loss of use, whether such damages arise in contract, + * negligence, tort, under statute, in equity, at law or otherwise, + * even if advised of the possibility of such damage. + */ + +/* + * Definitions for SCR smart card driver + */ + +#ifndef _ARM32_SCRIO_H_ +#define _ARM32_SCRIO_H_ + +#define ATR_BUF_MAX 1 + 1 + 4 * 10 + 15 + 1 /* TS + T0 + 4 * TABCD + 15 * TK + TCK */ +#define CMD_BUF_LEN 5 +#define DATA_BUF_MAX 256 + +/* status information for Status */ +#define CARD_REMOVED 0x0000 +#define CARD_INSERTED 0x0001 +#define CARD_ON 0x0002 + +typedef struct { + int status; +} ScrStatus; + +typedef struct { + unsigned char atrBuf[ATR_BUF_MAX]; + unsigned int atrLen; + unsigned int status; +} ScrOn; + +typedef struct { + unsigned char command[CMD_BUF_LEN]; /* command */ + int writeBuffer; /* true write, false read */ + unsigned char data[DATA_BUF_MAX]; /* data, write to card, read from card */ + unsigned int dataLen; /* data length, used on write, set of read */ + unsigned char sw1; /* sw1 status */ + unsigned char sw2; /* sw2 status */ + unsigned int status; /* driver status */ +} ScrT0; + +typedef struct { + unsigned int status; +} ScrOff; + +#define SCRIOSTATUS _IOR ('S', 1, ScrStatus) /* return card in/out, card on/off */ +#define SCRIOON _IOR ('S', 2, ScrOn) /* turns card on, returns ATR */ +#define SCRIOOFF _IOR ('S', 3, ScrOff) /* turns card off */ +#define SCRIOT0 _IOWR('S', 4, ScrT0) /* read/write card data in T0 protocol */ + + +#define ERROR_OK 0 /* no error */ +#define ERROR_PARITY 1 /* too many parity errors */ +#define ERROR_ATR_TCK 2 /* ATR checksum error */ +#define ERROR_ATR_BUF_OVERRUN 3 /* ATR was to big for buf */ +#define ERROR_ATR_FI_INVALID 4 /* FI was invalid */ +#define ERROR_ATR_DI_INVALID 5 /* DI was invalid */ +#define ERROR_ATR_T3 6 /* timer T3 expired */ +#define ERROR_WORK_WAITING 7 /* work waiting expired */ +#define ERROR_BAD_PROCEDURE_BYTE 8 /* bad procedure byte */ +#define ERROR_CARD_REMOVED 9 /* tried to do ioctal that needs card inserted */ +#define ERROR_CARD_ON 10 /* tried to do ioctal that needs card off */ +#define ERROR_CARD_OFF 11 /* tried to do ioctal that needs card on */ +#define ERROR_INVALID_DATALEN 12 /* invalid data length on t0 write */ +#define ERROR_TO_OVERRUN 13 /* invalid data length read from card */ + +#endif /* _ARM32_SCRIO_H_ */ diff --git a/sys/arch/dnard/include/undefined.h b/sys/arch/dnard/include/undefined.h new file mode 100644 index 000000000000..5ed29814dc03 --- /dev/null +++ b/sys/arch/dnard/include/undefined.h @@ -0,0 +1,3 @@ +/* $NetBSD: undefined.h,v 1.1 2001/05/09 15:40:56 matt Exp $ */ + +#include diff --git a/sys/arch/dnard/include/vmparam.h b/sys/arch/dnard/include/vmparam.h new file mode 100644 index 000000000000..460b694e07ff --- /dev/null +++ b/sys/arch/dnard/include/vmparam.h @@ -0,0 +1,209 @@ +/* $NetBSD: vmparam.h,v 1.1 2001/05/09 15:40:56 matt 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _ARM32_VMPARAM_H_ +#define _ARM32_VMPARAM_H_ + +/* for pt_entry_t definition */ +#include + +#define USRTEXT VM_MIN_ADDRESS +#define USRSTACK VM_MAXUSER_ADDRESS + +/* + * Note that MAXTSIZ mustn't be greater than 32M. Otherwise you'd have + * to change the compiler to not generate bl instructions + */ +#define MAXTSIZ (16*1024*1024) /* max text size */ +#ifndef DFLDSIZ +#define DFLDSIZ (128*1024*1024) /* initial data size limit */ +#endif +#ifndef MAXDSIZ +#define MAXDSIZ (512*1024*1024) /* max data size */ +#endif +#ifndef DFLSSIZ +#define DFLSSIZ (2*1024*1024) /* initial stack size limit */ +#endif +#ifndef MAXSSIZ +#define MAXSSIZ (8*1024*1024) /* max stack size */ +#endif + +/* + * Size of shared memory map + */ +#ifndef SHMMAXPGS +#define SHMMAXPGS 1024 +#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 + +/* + * Address space constants + */ + +/* + * The line between user space and kernel space + * Mappings >= KERNEL_SPACE_START are constant across all processes + */ +#define KERNEL_SPACE_START 0xf0000000 + +/* total number of page table entries to map 4GB * size of each entry*/ +#define PAGE_TABLE_SPACE ((1 << (32 - PGSHIFT)) * sizeof(pt_entry_t)) + +/* Address where the page tables are mapped */ +#define PAGE_TABLE_SPACE_START (KERNEL_SPACE_START - PAGE_TABLE_SPACE) + +/* Various constants used by the MD code*/ +#define KERNEL_BASE 0xf0000000 +#define KERNEL_TEXT_BASE KERNEL_BASE +#define ALT_PAGE_TBLS_BASE 0xf0c00000 +#define KERNEL_VM_BASE 0xf1000000 +/* + * The Kernel VM Size varies depending on the machine depending on how + * much space is needed (and where) for other mappings. + * In some cases the chosen value may not be the maximum in order that + * we don't waste memory with kernel pages tables as we can't currently + * grow the kernel page tables after booting. + * You only need to increase these values if you find that the number of + * buffers is being limited due to lack of VA space. + */ +#if defined(FOOTBRIDGE) +/* + * The range 0xf1000000 - 0xfcffffff is available for kernel VM space + * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff + */ +#define KERNEL_VM_SIZE 0x07000000 +#elif defined(SHARK) +/* + * The range 0xf1000000 - 0xf6ffffff is available for kernel VM space + * OFW sites at 0xf7000000 + */ +#define KERNEL_VM_SIZE 0x04000000 +#else +/* + * The range 0xf1000000 - 0xf3ffffff is available for kernel VM space + * Fixed mappings exist from 0xf4000000 - 0xffffffff + */ +#define KERNEL_VM_SIZE 0x03000000 +#endif +#define PROCESS_PAGE_TBLS_BASE PAGE_TABLE_SPACE_START + +/* + * Override the default pager_map size, there's not enough KVA. + */ +#define PAGER_MAP_SIZE (4 * 1024 * 1024) + +/* + * Mach derived constants + */ + +#define VM_MIN_ADDRESS ((vm_offset_t)0x00001000) +#define VM_MAXUSER_ADDRESS ((vm_offset_t)(PAGE_TABLE_SPACE_START - UPAGES * NBPG)) +#define VM_MAX_ADDRESS ((vm_offset_t)(PAGE_TABLE_SPACE_START + (KERNEL_SPACE_START >> PGSHIFT) * sizeof(pt_entry_t))) + +#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNEL_TEXT_BASE) +#define VM_MAXKERN_ADDRESS ((vm_offset_t)(KERNEL_VM_BASE + KERNEL_VM_SIZE)) +#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xffffffff) + +/* + * Size of User Raw I/O map + */ + +#define USRIOSIZE 300 + +/* XXX max. amount of KVM to be used by buffers. */ +#ifndef VM_MAX_KERNEL_BUF +#define VM_MAX_KERNEL_BUF \ + ((VM_MAXKERN_ADDRESS - KERNEL_VM_BASE) * 4 / 10) +#endif + +/* virtual sizes (bytes) for various kernel submaps */ + +#define VM_PHYS_SIZE (USRIOSIZE*NBPG) + +/* + * max number of non-contig chunks of physical RAM you can have + */ + +#define VM_PHYSSEG_MAX 32 + +/* + * when converting a physical address to a vm_page structure, we + * want to use a binary search on the chunks of physical memory + * to find our RAM + */ + +#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH + +/* + * this indicates that we can't add RAM to the VM system after the + * vm system is init'd. + */ + +#define VM_PHYSSEG_NOADD + +/* + * we support 2 free lists: + * + * - DEFAULT for all systems + * - ISADMA for the ISA DMA range on Sharks only + */ + +#define VM_NFREELIST 2 +#define VM_FREELIST_DEFAULT 0 +#define VM_FREELIST_ISADMA 1 + +/* + * define structure pmap_physseg: there is one of these structures + * for each chunk of noncontig RAM you have. + */ + +struct pmap_physseg { + struct pv_entry *pvent; /* pv_entry array */ + char *attrs; /* attrs array */ +}; + +#endif /* _ARM32_VMPARAM_H_ */ + +/* End of vmparam.h */