diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 08:53:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 08:53:40 +0000 |
commit | d6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch) | |
tree | ece253b876159b39c620e62b6c9b1174642e070e /sys/arch/m68k/include |
initial import of NetBSD tree
Diffstat (limited to 'sys/arch/m68k/include')
-rw-r--r-- | sys/arch/m68k/include/ansi.h | 74 | ||||
-rw-r--r-- | sys/arch/m68k/include/asm.h | 76 | ||||
-rw-r--r-- | sys/arch/m68k/include/cdefs.h | 35 | ||||
-rw-r--r-- | sys/arch/m68k/include/db_machdep.h | 107 | ||||
-rw-r--r-- | sys/arch/m68k/include/endian.h | 91 | ||||
-rw-r--r-- | sys/arch/m68k/include/float.h | 80 | ||||
-rw-r--r-- | sys/arch/m68k/include/frame.h | 227 | ||||
-rw-r--r-- | sys/arch/m68k/include/ieeefp.h | 23 | ||||
-rw-r--r-- | sys/arch/m68k/include/limits.h | 84 | ||||
-rw-r--r-- | sys/arch/m68k/include/profile.h | 61 | ||||
-rw-r--r-- | sys/arch/m68k/include/psl.h | 73 | ||||
-rw-r--r-- | sys/arch/m68k/include/ptrace.h | 44 | ||||
-rw-r--r-- | sys/arch/m68k/include/reg.h | 102 | ||||
-rw-r--r-- | sys/arch/m68k/include/setjmp.h | 7 | ||||
-rw-r--r-- | sys/arch/m68k/include/signal.h | 67 | ||||
-rw-r--r-- | sys/arch/m68k/include/stdarg.h | 64 | ||||
-rw-r--r-- | sys/arch/m68k/include/trap.h | 69 | ||||
-rw-r--r-- | sys/arch/m68k/include/types.h | 71 | ||||
-rw-r--r-- | sys/arch/m68k/include/varargs.h | 71 |
19 files changed, 1426 insertions, 0 deletions
diff --git a/sys/arch/m68k/include/ansi.h b/sys/arch/m68k/include/ansi.h new file mode 100644 index 00000000000..0e64d6c9db1 --- /dev/null +++ b/sys/arch/m68k/include/ansi.h @@ -0,0 +1,74 @@ +/* $NetBSD: ansi.h,v 1.5 1994/10/26 07:50:40 cgd Exp $ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ansi.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _ANSI_H_ +#define _ANSI_H_ + +/* + * Types which are fundamental to the implementation and may appear in + * more than one standard header are defined here. Standard headers + * then use: + * #ifdef _BSD_SIZE_T_ + * typedef _BSD_SIZE_T_ size_t; + * #undef _BSD_SIZE_T_ + * #endif + */ +#define _BSD_CLOCK_T_ unsigned long /* clock() */ +#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */ +#define _BSD_SIZE_T_ unsigned int /* sizeof() */ +#define _BSD_SSIZE_T_ int /* byte count or error */ +#define _BSD_TIME_T_ long /* time() */ +#define _BSD_VA_LIST_ char * /* va_list */ + +/* + * Runes (wchar_t) is declared to be an ``int'' instead of the more natural + * ``unsigned long'' or ``long''. Two things are happening here. It is not + * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, + * it looks like 10646 will be a 31 bit standard. This means that if your + * ints cannot hold 32 bits, you will be in trouble. The reason an int was + * chosen over a long is that the is*() and to*() routines take ints (says + * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t + * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains + * defined for ctype.h. + */ +#define _BSD_WCHAR_T_ int /* wchar_t */ +#define _BSD_RUNE_T_ int /* rune_t */ + +#endif /* _ANSI_H_ */ diff --git a/sys/arch/m68k/include/asm.h b/sys/arch/m68k/include/asm.h new file mode 100644 index 00000000000..527d6d663d2 --- /dev/null +++ b/sys/arch/m68k/include/asm.h @@ -0,0 +1,76 @@ +/* $NetBSD: asm.h,v 1.10 1995/03/26 17:08:36 briggs Exp $ */ + +/* + * Copyright (c) 1994 Allen Briggs + * All rights reserved. + * + * Gleaned from locore.s and sun3 asm.h which had the following copyrights: + * locore.s: + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1982, 1990 The Regents of the University of California. + * sun3/include/asm.h: + * Copyright (c) 1993 Adam Glass + * Copyright (c) 1990 The Regents of the University of California. + * + * 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 _ASM_H_ +#define _ASM_H_ + +#ifdef __STDC__ +#define _C_LABEL(name) _ ## name +#else +#define _C_LABEL(name) _/**/name +#endif +#define _ASM_LABEL(name) name + +#ifndef _KERNEL +#define _ENTRY(name) \ + .text; .even; .globl name; .type name,@function; name: +#else +#define _ENTRY(name) \ + .text; .even; .globl name; name: +#endif + + +#ifdef PROF +#define ENTRY(name) \ + _ENTRY(_C_LABEL(name)); link a6,#0; jbsr mcount; unlk a6 +#define ALTENTRY(name, rname) \ + ENTRY(name); jra rname+12 +#else +#define ENTRY(name) _ENTRY(_C_LABEL(name)) +#define ALTENTRY(name, rname) _ENTRY(_C_LABEL(name)) +#endif +#define ASENTRY(name) _ENTRY(_ASM_LABEL(name)) + +#define RCSID(x) .text; .asciz x + +#endif /* _ASM_H_ */ diff --git a/sys/arch/m68k/include/cdefs.h b/sys/arch/m68k/include/cdefs.h new file mode 100644 index 00000000000..d5ea5cdbc21 --- /dev/null +++ b/sys/arch/m68k/include/cdefs.h @@ -0,0 +1,35 @@ +/* $NetBSD: cdefs.h,v 1.2 1995/03/23 20:10:33 jtc Exp $ */ + +/* + * Written by J.T. Conklin <jtc@wimsey.com> 01/17/95. + * Public domain. + */ + +#ifndef _M68K_CDEFS_H_ +#define _M68K_CDEFS_H_ + +#ifdef __STDC__ +#define _C_LABEL(x) _STRING(_ ## x) +#else +#define _C_LABEL(x) _STRING(_/**/x) +#endif + +#ifdef __GNUC__ +#ifdef __STDC__ +#define __indr_reference(sym,alias) \ + __asm__(".stabs \"_" #alias "\",11,0,0,0"); \ + __asm__(".stabs \"_" #sym "\",1,0,0,0") +#define __warn_references(sym,msg) \ + __asm__(".stabs \"" msg "\",30,0,0,0"); \ + __asm__(".stabs \"_" #sym "\",1,0,0,0") +#else +#define __indr_reference(sym,alias) \ + __asm__(".stabs \"_/**/alias\",11,0,0,0"); \ + __asm__(".stabs \"_/**/sym\",1,0,0,0") +#define __warn_references(sym,msg) \ + __asm__(".stabs msg,30,0,0,0"); \ + __asm__(".stabs \"_/**/sym\",1,0,0,0") +#endif +#endif + +#endif /* !_M68K_CDEFS_H_ */ diff --git a/sys/arch/m68k/include/db_machdep.h b/sys/arch/m68k/include/db_machdep.h new file mode 100644 index 00000000000..aa5ea85aad8 --- /dev/null +++ b/sys/arch/m68k/include/db_machdep.h @@ -0,0 +1,107 @@ +/* $NetBSD: db_machdep.h,v 1.12 1994/10/26 07:50:44 cgd Exp $ */ + +/* + * Mach Operating System + * Copyright (c) 1992 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Machine-dependent defines for new kernel debugger. + */ +#ifndef _M68K_DB_MACHDEP_H_ +#define _M68K_DB_MACHDEP_H_ + +#include <vm/vm_prot.h> +#include <vm/vm_param.h> +#include <vm/vm_inherit.h> +#include <vm/lock.h> +#include <machine/psl.h> +#include <machine/trap.h> + +typedef vm_offset_t db_addr_t; /* address - unsigned */ +typedef int db_expr_t; /* expression - signed */ +struct mc68020_saved_state { + int d0; /* data registers */ + int d1; + int d2; + int d3; + int d4; + int d5; + int d6; + int d7; + int a0; /* address registers */ + int a1; + int a2; + int a3; + int a4; + int a5; + int a6; + int sp; /* stack pointer */ + short empty; + short stackadj; + unsigned short sr; /* status register */ + unsigned int pc; /* program counter - UNALIGNED!!! */ + unsigned short stkfmt : 4; /* rte stack frame format */ + unsigned short vector : 12; /* vector number */ +}; +typedef struct mc68020_saved_state db_regs_t; +db_regs_t ddb_regs; /* register state */ +#define DDB_REGS (&ddb_regs) + +#define PC_REGS(regs) ((db_addr_t)(regs)->pc) + +#define BKPT_INST 0x4e4f /* breakpoint instruction */ +#define BKPT_SIZE (2) /* size of breakpoint inst */ +#define BKPT_SET(inst) (BKPT_INST) + +#define FIXUP_PC_AFTER_BREAK ddb_regs.pc -= 2; + +#define SR_T1 0x8000 +#define db_clear_single_step(regs) ((regs)->sr &= ~SR_T1) +#define db_set_single_step(regs) ((regs)->sr |= SR_T1) + +#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT) +#ifdef T_WATCHPOINT +#define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT) +#else +#define IS_WATCHPOINT_TRAP(type, code) 0 +#endif + +#define M_RTS 0xffff0000 +#define I_RTS 0x4e750000 +#define M_JSR 0xffc00000 +#define I_JSR 0x4e800000 +#define M_BSR 0xff000000 +#define I_BSR 0x61000000 +#define M_RTE 0xffff0000 +#define I_RTE 0x4e730000 + +#define inst_trap_return(ins) (((ins)&M_RTE) == I_RTE) +#define inst_return(ins) (((ins)&M_RTS) == I_RTS) +#define inst_call(ins) (((ins)&M_JSR) == I_JSR || \ + ((ins)&M_BSR) == I_BSR) +#define inst_load(ins) 0 +#define inst_store(ins) 0 + +#endif /* _M68K_DB_MACHDEP_H_ */ diff --git a/sys/arch/m68k/include/endian.h b/sys/arch/m68k/include/endian.h new file mode 100644 index 00000000000..4422c1906c1 --- /dev/null +++ b/sys/arch/m68k/include/endian.h @@ -0,0 +1,91 @@ +/* $NetBSD: endian.h,v 1.6 1994/10/26 07:50:45 cgd Exp $ */ + +/* + * Copyright (c) 1987, 1991 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)endian.h 7.7 (Berkeley) 4/3/91 + */ + +#ifndef _M68K_ENDIAN_H_ +#define _M68K_ENDIAN_H_ + +/* + * Define the order of 32-bit words in 64-bit words. + */ +#define _QUAD_HIGHWORD 0 +#define _QUAD_LOWWORD 1 + +#ifndef _POSIX_SOURCE +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ + +#define BYTE_ORDER BIG_ENDIAN + +#include <sys/cdefs.h> + +__BEGIN_DECLS +unsigned long htonl __P((unsigned long)); +unsigned short htons __P((unsigned short)); +unsigned long ntohl __P((unsigned long)); +unsigned short ntohs __P((unsigned short)); +__END_DECLS + +/* + * Macros for network/external number representation conversion. + */ +#if BYTE_ORDER == BIG_ENDIAN && !defined(lint) +#define ntohl(x) (x) +#define ntohs(x) (x) +#define htonl(x) (x) +#define htons(x) (x) + +#define NTOHL(x) (x) +#define NTOHS(x) (x) +#define HTONL(x) (x) +#define HTONS(x) (x) + +#else + +#define NTOHL(x) (x) = ntohl((u_long)x) +#define NTOHS(x) (x) = ntohs((u_short)x) +#define HTONL(x) (x) = htonl((u_long)x) +#define HTONS(x) (x) = htons((u_short)x) +#endif + +#endif /* _POSIX_SOURCE */ + +#endif /* _M68K_ENDIAN_H_ */ diff --git a/sys/arch/m68k/include/float.h b/sys/arch/m68k/include/float.h new file mode 100644 index 00000000000..c37cea367f2 --- /dev/null +++ b/sys/arch/m68k/include/float.h @@ -0,0 +1,80 @@ +/* $NetBSD: float.h,v 1.10 1995/06/20 20:45:41 jtc Exp $ */ + +/* + * Copyright (c) 1989 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)float.h 7.1 (Berkeley) 5/8/90 + */ + +#ifndef _M68K_FLOAT_H_ +#define _M68K_FLOAT_H_ + +#include <sys/cdefs.h> + +__BEGIN_DECLS +extern int __flt_rounds(); +__END_DECLS + +#define FLT_RADIX 2 /* b */ +#define FLT_ROUNDS __flt_rounds() + +#define FLT_MANT_DIG 24 /* p */ +#define FLT_EPSILON 1.19209290E-07F /* b**(1-p) */ +#define FLT_DIG 6 /* floor((p-1)*log10(b))+(b == 10) */ +#define FLT_MIN_EXP -125 /* emin */ +#define FLT_MIN 1.17549435E-38F /* b**(emin-1) */ +#define FLT_MIN_10_EXP -37 /* ceil(log10(b**(emin-1))) */ +#define FLT_MAX_EXP 128 /* emax */ +#define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ +#define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ + +#define DBL_MANT_DIG 53 +#define DBL_EPSILON 2.2204460492503131E-16 +#define DBL_DIG 15 +#define DBL_MIN_EXP -1021 +#define DBL_MIN 2.2250738585072014E-308 +#define DBL_MIN_10_EXP -307 +#define DBL_MAX_EXP 1024 +#define DBL_MAX 1.7976931348623157E+308 +#define DBL_MAX_10_EXP 308 + +#define LDBL_MANT_DIG DBL_MANT_DIG +#define LDBL_EPSILON DBL_EPSILON +#define LDBL_DIG DBL_DIG +#define LDBL_MIN_EXP DBL_MIN_EXP +#define LDBL_MIN DBL_MIN +#define LDBL_MIN_10_EXP DBL_MIN_10_EXP +#define LDBL_MAX_EXP DBL_MAX_EXP +#define LDBL_MAX DBL_MAX +#define LDBL_MAX_10_EXP DBL_MAX_10_EXP + +#endif /* !_M68K_FLOAT_H_ */ diff --git a/sys/arch/m68k/include/frame.h b/sys/arch/m68k/include/frame.h new file mode 100644 index 00000000000..a71b485bd06 --- /dev/null +++ b/sys/arch/m68k/include/frame.h @@ -0,0 +1,227 @@ +/* $NetBSD: frame.h,v 1.10 1995/05/12 12:45:24 mycroft Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1982, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: Utah $Hdr: frame.h 1.8 92/12/20$ + * + * @(#)frame.h 8.1 (Berkeley) 6/10/93 + */ + +struct frame { + struct trapframe { + int tf_regs[16]; + short tf_pad; + short tf_stackadj; + u_short tf_sr; + u_int tf_pc; + u_short tf_format:4, + tf_vector:12; + } F_t; + union F_u { + struct fmt2 { + u_int f_iaddr; + } F_fmt2; + + struct fmt3 { + u_int f_ea; + } F_fmt3; + + struct fmt7 { + u_int f_ea; + u_short f_ssw; + u_short f_wb3s, f_wb2s, f_wb1s; + u_int f_fa; + u_int f_wb3a, f_wb3d; + u_int f_wb2a, f_wb2d; + u_int f_wb1a, f_wb1d; +#define f_pd0 f_wb1d + u_int f_pd1, f_pd2, f_pd3; + } F_fmt7; + + struct fmt9 { + u_int f_iaddr; + u_short f_iregs[4]; + } F_fmt9; + + struct fmtA { + u_short f_ir0; + u_short f_ssw; + u_short f_ipsc; + u_short f_ipsb; + u_int f_dcfa; + u_short f_ir1, f_ir2; + u_int f_dob; + u_short f_ir3, f_ir4; + } F_fmtA; + + struct fmtB { + u_short f_ir0; + u_short f_ssw; + u_short f_ipsc; + u_short f_ipsb; + u_int f_dcfa; + u_short f_ir1, f_ir2; + u_int f_dob; + u_short f_ir3, f_ir4; + u_short f_ir5, f_ir6; + u_int f_sba; + u_short f_ir7, f_ir8; + u_int f_dib; + u_short f_iregs[22]; + } F_fmtB; + } F_u; +}; + +#define f_regs F_t.tf_regs +#define f_pad F_t.tf_pad +#define f_stackadj F_t.tf_stackadj +#define f_sr F_t.tf_sr +#define f_pc F_t.tf_pc +#define f_format F_t.tf_format +#define f_vector F_t.tf_vector +#define f_fmt2 F_u.F_fmt2 +#define f_fmt3 F_u.F_fmt3 +#define f_fmt7 F_u.F_fmt7 +#define f_fmt9 F_u.F_fmt9 +#define f_fmtA F_u.F_fmtA +#define f_fmtB F_u.F_fmtB + +struct switchframe { + u_int sf_pc; +}; + +/* common frame size */ +#define CFSIZE (sizeof(struct frame) - sizeof(union F_u)) +#define NFMTSIZE 8 + +#define FMT0 0x0 +#define FMT1 0x1 +#define FMT2 0x2 +#define FMT3 0x3 +#define FMT7 0x7 +#define FMT9 0x9 +#define FMTA 0xA +#define FMTB 0xB + +/* frame specific info sizes */ +#define FMT0SIZE 0 +#define FMT1SIZE 0 +#define FMT2SIZE sizeof(struct fmt2) +#define FMT3SIZE sizeof(struct fmt3) +#define FMT7SIZE sizeof(struct fmt7) +#define FMT9SIZE sizeof(struct fmt9) +#define FMTASIZE sizeof(struct fmtA) +#define FMTBSIZE sizeof(struct fmtB) + +#define V_BUSERR 0x008 +#define V_ADDRERR 0x00C +#define V_TRAP1 0x084 + +/* 68020/68030 SSW bits */ +#define SSW_RC 0x2000 +#define SSW_RB 0x1000 +#define SSW_DF 0x0100 +#define SSW_RM 0x0080 +#define SSW_RW 0x0040 +#define SSW_FCMASK 0x0007 + +/* 68040 SSW bits */ +#define SSW4_CP 0x8000 +#define SSW4_CU 0x4000 +#define SSW4_CT 0x2000 +#define SSW4_CM 0x1000 +#define SSW4_MA 0x0800 +#define SSW4_ATC 0x0400 +#define SSW4_LK 0x0200 +#define SSW4_RW 0x0100 +#define SSW4_WBSV 0x0080 /* really in WB status, not SSW */ +#define SSW4_SZMASK 0x0060 +#define SSW4_SZLW 0x0000 +#define SSW4_SZB 0x0020 +#define SSW4_SZW 0x0040 +#define SSW4_SZLN 0x0060 +#define SSW4_TTMASK 0x0018 +#define SSW4_TTNOR 0x0000 +#define SSW4_TTM16 0x0008 +#define SSW4_TMMASK 0x0007 +#define SSW4_TMDCP 0x0000 +#define SSW4_TMUD 0x0001 +#define SSW4_TMUC 0x0002 +#define SSW4_TMKD 0x0005 +#define SSW4_TMKC 0x0006 + +struct fpframe { + union FPF_u1 { + u_int FPF_null; + struct { + u_char FPF_version; + u_char FPF_fsize; + u_short FPF_res1; + } FPF_nonnull; + } FPF_u1; + union FPF_u2 { + struct fpidle { + u_short fpf_ccr; + u_short fpf_res2; + u_int fpf_iregs1[8]; + u_int fpf_xops[3]; + u_int fpf_opreg; + u_int fpf_biu; + } FPF_idle; + + struct fpbusy { + u_int fpf_iregs[53]; + } FPF_busy; + + struct fpunimp { + u_int fpf_state[10]; + } FPF_unimp; + } FPF_u2; + u_int fpf_regs[8*3]; + u_int fpf_fpcr; + u_int fpf_fpsr; + u_int fpf_fpiar; +}; + +#define fpf_null FPF_u1.FPF_null +#define fpf_version FPF_u1.FPF_nonnull.FPF_version +#define fpf_fsize FPF_u1.FPF_nonnull.FPF_fsize +#define fpf_res1 FPF_u1.FPF_nonnull.FPF_res1 +#define fpf_idle FPF_u2.FPF_idle +#define fpf_busy FPF_u2.FPF_busy +#define fpf_unimp FPF_u2.FPF_unimp diff --git a/sys/arch/m68k/include/ieeefp.h b/sys/arch/m68k/include/ieeefp.h new file mode 100644 index 00000000000..2a4fc39689e --- /dev/null +++ b/sys/arch/m68k/include/ieeefp.h @@ -0,0 +1,23 @@ +/* + * Written by J.T. Conklin, Apr 6, 1995 + * Public domain. + */ + +#ifndef _M68K_IEEEFP_H_ +#define _M68K_IEEEFP_H_ + +typedef int fp_except; +#define FP_X_IMP 0x01 /* imprecise (loss of precision) */ +#define FP_X_DZ 0x02 /* divide-by-zero exception */ +#define FP_X_UFL 0x04 /* underflow exception */ +#define FP_X_OFL 0x08 /* overflow exception */ +#define FP_X_INV 0x10 /* invalid operation exception */ + +typedef enum { + FP_RN=0, /* round to nearest representable number */ + FP_RZ=1, /* round to zero (truncate) */ + FP_RM=2, /* round toward negative infinity */ + FP_RP=3 /* round toward positive infinity */ +} fp_rnd; + +#endif /* _M68K_IEEEFP_H_ */ diff --git a/sys/arch/m68k/include/limits.h b/sys/arch/m68k/include/limits.h new file mode 100644 index 00000000000..e0c44852d18 --- /dev/null +++ b/sys/arch/m68k/include/limits.h @@ -0,0 +1,84 @@ +/* $NetBSD: limits.h,v 1.9 1994/10/26 07:50:48 cgd 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. + * + * @(#)limits.h 7.2 (Berkeley) 6/28/90 + */ + +#define CHAR_BIT 8 /* number of bits in a char */ +#define MB_LEN_MAX 1 /* no multibyte characters */ + +#define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ +#define SCHAR_MAX 0x7f /* min value for a signed char */ + +#define UCHAR_MAX 0xff /* max value for an unsigned char */ +#define CHAR_MAX 0x7f /* max value for a char */ +#define CHAR_MIN (-0x7f-1) /* min value for a char */ + +#define USHRT_MAX 0xffff /* max value for an unsigned short */ +#define SHRT_MAX 0x7fff /* max value for a short */ +#define SHRT_MIN (-0x7fff-1) /* min value for a short */ + +#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ +#define INT_MAX 0x7fffffff /* max value for an int */ +#define INT_MIN (-0x7fffffff-1) /* min value for an int */ + +#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ +#define LONG_MAX 0x7fffffffL /* max value for a long */ +#define LONG_MIN (-0x7fffffffL-1) /* min value for a long */ + +#if !defined(_ANSI_SOURCE) +#define SSIZE_MAX INT_MAX /* max value for a ssize_t */ + +#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) +#define SIZE_T_MAX UINT_MAX /* max value for a size_t */ + +#define UQUAD_MAX 0xffffffffffffffffULL /* max unsigned quad */ +#define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */ +#define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */ + +#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ +#endif /* !_ANSI_SOURCE */ + +#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) +#define LONG_BIT 32 +#define WORD_BIT 32 + +#define DBL_DIG 15 +#define DBL_MAX 1.7976931348623157E+308 +#define DBL_MIN 2.2250738585072014E-308 + +#define FLT_DIG 6 +#define FLT_MAX 3.40282347E+38F +#define FLT_MIN 1.17549435E-38F +#endif diff --git a/sys/arch/m68k/include/profile.h b/sys/arch/m68k/include/profile.h new file mode 100644 index 00000000000..137da3739dc --- /dev/null +++ b/sys/arch/m68k/include/profile.h @@ -0,0 +1,61 @@ +/* $NetBSD: profile.h,v 1.3 1995/03/26 17:08:37 briggs Exp $ */ + +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)profile.h 8.1 (Berkeley) 6/10/93 + */ + +#define _MCOUNT_DECL static inline void _mcount + +#define MCOUNT \ +extern void mcount() asm("mcount"); void mcount() { \ + int selfpc, frompcindex; \ + asm("movl a6@(4),%0" : "=r" (selfpc)); \ + asm("movl a6@(0)@(4),%0" : "=r" (frompcindex)); \ + _mcount(frompcindex, selfpc); \ +} + +#ifdef _KERNEL +/* + * The following two macros do splhigh and splx respectively. + * They have to be defined this way because these are real + * functions on the HP, and we do not want to invoke mcount + * recursively. + */ +#define MCOUNT_ENTER \ + asm("movw sr,%0" : "=g" (s)); \ + asm("movw #0x2700,sr") + +#define MCOUNT_EXIT \ + asm("movw %0,sr" : : "g" (s)) +#endif /* _KERNEL */ diff --git a/sys/arch/m68k/include/psl.h b/sys/arch/m68k/include/psl.h new file mode 100644 index 00000000000..c8cb28ab6ad --- /dev/null +++ b/sys/arch/m68k/include/psl.h @@ -0,0 +1,73 @@ +/* $NetBSD: psl.h,v 1.5 1994/10/26 07:50:50 cgd Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)psl.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef PSL_C +/* + * MC68000 program status word + */ + +#define PSL_C 0x0001 /* carry bit */ +#define PSL_V 0x0002 /* overflow bit */ +#define PSL_Z 0x0004 /* zero bit */ +#define PSL_N 0x0008 /* negative bit */ +#define PSL_X 0x0010 /* extend bit */ +#define PSL_ALLCC 0x001F /* all cc bits - unlikely */ +#define PSL_IPL0 0x0000 /* interrupt priority level 0 */ +#define PSL_IPL1 0x0100 /* interrupt priority level 1 */ +#define PSL_IPL2 0x0200 /* interrupt priority level 2 */ +#define PSL_IPL3 0x0300 /* interrupt priority level 3 */ +#define PSL_IPL4 0x0400 /* interrupt priority level 4 */ +#define PSL_IPL5 0x0500 /* interrupt priority level 5 */ +#define PSL_IPL6 0x0600 /* interrupt priority level 6 */ +#define PSL_IPL7 0x0700 /* interrupt priority level 7 */ +#define PSL_M 0x1000 /* master (kernel) sp vs intr sp */ +#define PSL_S 0x2000 /* supervisor enable bit */ +/* PSL_T0 0x4000 ??? T0 on 68020, 8000 is T1 */ +#define PSL_T 0x8000 /* trace enable bit */ + +#define PSL_LOWIPL (PSL_S) +#define PSL_HIGHIPL (PSL_S | PSL_IPL7) +#define PSL_IPL (PSL_IPL7) +#define PSL_USER (0) + +#define PSL_MBZ 0xFFFF58E0 /* must be zero bits */ + +#define PSL_USERSET (0) +#define PSL_USERCLR (PSL_S | PSL_IPL7 | PSL_MBZ) + +#define USERMODE(ps) (((ps) & PSL_S) == 0) +#endif diff --git a/sys/arch/m68k/include/ptrace.h b/sys/arch/m68k/include/ptrace.h new file mode 100644 index 00000000000..9d89193b016 --- /dev/null +++ b/sys/arch/m68k/include/ptrace.h @@ -0,0 +1,44 @@ +/* $NetBSD: ptrace.h,v 1.7 1995/01/26 19:47:10 mycroft Exp $ */ + +/* + * Copyright (c) 1993 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _M68K_PTRACE_H_ +#define _M68K_PTRACE_H_ + +/* + * m68k-dependent ptrace definitions + */ +#define PT_STEP (PT_FIRSTMACH + 0) +#define PT_GETREGS (PT_FIRSTMACH + 1) +#define PT_SETREGS (PT_FIRSTMACH + 2) +#define PT_GETFPREGS (PT_FIRSTMACH + 3) +#define PT_SETFPREGS (PT_FIRSTMACH + 4) + +#endif /* !_M68K_PTRACE_H_ */ diff --git a/sys/arch/m68k/include/reg.h b/sys/arch/m68k/include/reg.h new file mode 100644 index 00000000000..ad628b9a70d --- /dev/null +++ b/sys/arch/m68k/include/reg.h @@ -0,0 +1,102 @@ +/* $NetBSD: reg.h,v 1.11 1995/03/26 17:08:38 briggs Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: Utah Hdr: reg.h 1.1 90/07/09 + * + * @(#)reg.h 7.2 (Berkeley) 11/3/90 + */ + +#ifndef _M68K_REG_H_ +#define _M68K_REG_H_ + +/* + * Register set accessible via /proc/$pid/reg and ptrace() + */ +struct reg { + int r_regs[16]; /* D0-D7/A0-A7 */ + int r_sr; + int r_pc; +}; + +struct fpreg { + int r_regs[8*3]; /* FP0-FP7 */ + int r_fpcr; + int r_fpsr; + int r_fpiar; +}; + +/* XXXX this is historical (but it can't be deprecated quite yet) */ + +/* + * Location of the users' stored + * registers relative to D0. + * Usage is u.u_ar0[XX]. + */ +#define D0 (0) +#define D1 (1) +#define D2 (2) +#define D3 (3) +#define D4 (4) +#define D5 (5) +#define D6 (6) +#define D7 (7) +#define A0 (8) +#define A1 (9) +#define A2 (10) +#define A3 (11) +#define A4 (12) +#define A5 (13) +#define A6 (14) +#define A7 (15) + +#define SP A7 +#define PS (16) +#define PC (17) + +#ifdef _KERNEL +/* + * Due to a mental lapse somewhere down the line, wait returns its values + * in strange registers. Kludge it up here so we don't have to in the + * machine-independent code. + */ +#define R0 D1 +#define R1 A0 +#endif + +#endif /* !_M68K_REG_H_ */ diff --git a/sys/arch/m68k/include/setjmp.h b/sys/arch/m68k/include/setjmp.h new file mode 100644 index 00000000000..ae2d1a20bae --- /dev/null +++ b/sys/arch/m68k/include/setjmp.h @@ -0,0 +1,7 @@ +/* $NetBSD: setjmp.h,v 1.1 1994/12/20 10:36:49 cgd Exp $ */ + +/* + * machine/setjmp.h: machine dependent setjmp-related information. + */ + +#define _JBLEN 17 /* size, in longs, of a jmp_buf */ diff --git a/sys/arch/m68k/include/signal.h b/sys/arch/m68k/include/signal.h new file mode 100644 index 00000000000..3e2614cd8f8 --- /dev/null +++ b/sys/arch/m68k/include/signal.h @@ -0,0 +1,67 @@ +/* $NetBSD: signal.h,v 1.4 1995/01/10 19:01:31 jtc Exp $ */ + +/* + * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signal.h 7.16 (Berkeley) 3/17/91 + */ + +#ifndef _M68K_SIGNAL_H_ +#define _M68K_SIGNAL_H_ + +typedef int sig_atomic_t; + +#ifndef _ANSI_SOURCE +/* + * Get the "code" values + */ +#include <machine/trap.h> + +/* + * Information pushed on stack when a signal is delivered. + * This is used by the kernel to restore state following + * execution of the signal handler. It is also made available + * to the handler to allow it to restore state properly if + * a non-standard exit is performed. + */ +struct sigcontext { + int sc_onstack; /* sigstack state to restore */ + int sc_mask; /* signal mask to restore */ + int sc_sp; /* sp to restore */ + int sc_fp; /* fp to restore */ + int sc_ap; /* ap to restore */ + int sc_pc; /* pc to restore */ + int sc_ps; /* psl to restore */ +}; + +#endif /* !_ANSI_SOURCE */ +#endif /* !_M68K_SIGNAL_H_ */ diff --git a/sys/arch/m68k/include/stdarg.h b/sys/arch/m68k/include/stdarg.h new file mode 100644 index 00000000000..b34dd9e4c7b --- /dev/null +++ b/sys/arch/m68k/include/stdarg.h @@ -0,0 +1,64 @@ +/* $NetBSD: stdarg.h,v 1.11 1995/09/07 01:20:15 jtc Exp $ */ + +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdarg.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _M68K_STDARG_H_ +#define _M68K_STDARG_H_ + +#include <machine/ansi.h> + +typedef _BSD_VA_LIST_ va_list; + +#define __va_promote(type) \ + (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) + +#define va_start(ap, last) \ + (ap = ((char *)&(last) + sizeof(last))) + +#ifdef _KERNEL +#define va_arg(ap, type) \ + ((type *)(ap += sizeof(type)))[-1] +#else +#define va_arg(ap, type) \ + ((type *)(ap += __va_promote(type), \ + ap - (sizeof(type) < sizeof(int) && \ + sizeof(type) != __va_promote(type) ? \ + sizeof(type) : __va_promote(type))))[0] +#endif + +#define va_end(ap) ((void) 0) + +#endif /* !_M68K_STDARG_H_ */ diff --git a/sys/arch/m68k/include/trap.h b/sys/arch/m68k/include/trap.h new file mode 100644 index 00000000000..aaab5155ce7 --- /dev/null +++ b/sys/arch/m68k/include/trap.h @@ -0,0 +1,69 @@ +/* $NetBSD: trap.h,v 1.8 1994/10/26 07:50:56 cgd Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: Utah $Hdr: trap.h 1.7 91/03/25$ + * + * @(#)trap.h 8.1 (Berkeley) 6/10/93 + */ + +/* + * Trap codes + */ + +#define T_BUSERR 0 +#define T_ADDRERR 1 +#define T_ILLINST 2 +#define T_ZERODIV 3 +#define T_CHKINST 4 +#define T_TRAPVINST 5 +#define T_PRIVINST 6 +#define T_TRACE 7 +#define T_MMUFLT 8 +#define T_SSIR 9 +#define T_FMTERR 10 +#define T_FPERR 11 +#define T_COPERR 12 +#define T_ASTFLT 13 +#define T_TRAP15 15 +#define T_BREAKPOINT T_TRAP15 +#define T_FPEMULI 16 +#define T_FPEMULD 17 + +#define T_USER 0x80 /* user-mode flag or'ed with type */ + diff --git a/sys/arch/m68k/include/types.h b/sys/arch/m68k/include/types.h new file mode 100644 index 00000000000..5d401340690 --- /dev/null +++ b/sys/arch/m68k/include/types.h @@ -0,0 +1,71 @@ +/* $NetBSD: types.h,v 1.9 1995/07/06 03:39:38 cgd Exp $ */ + +/*- + * Copyright (c) 1990 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. + * + * @(#)types.h 7.9 (Berkeley) 3/9/91 + */ +#ifndef _M68K_TYPES_H_ +#define _M68K_TYPES_H_ + +#include <sys/cdefs.h> + +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +typedef struct _physadr { + short r[1]; +} *physadr; + +typedef struct label_t { /* consistent with HP-UX */ + int val[15]; +} label_t; +#endif + +typedef unsigned long vm_offset_t; +typedef unsigned long vm_size_t; + +/* + * Basic integral types. Omit the typedef if + * not possible for a machine/compiler combination. + */ +#define __BIT_TYPES_DEFINED__ +typedef signed char int8_t; +typedef unsigned char u_int8_t; +typedef short int16_t; +typedef unsigned short u_int16_t; +typedef int int32_t; +typedef unsigned int u_int32_t; +typedef long long int64_t; +typedef unsigned long long u_int64_t; + +typedef int32_t register_t; + +#endif /* !_M68K_TYPES_H_ */ diff --git a/sys/arch/m68k/include/varargs.h b/sys/arch/m68k/include/varargs.h new file mode 100644 index 00000000000..ab4c8f976e5 --- /dev/null +++ b/sys/arch/m68k/include/varargs.h @@ -0,0 +1,71 @@ +/* $NetBSD: varargs.h,v 1.10 1995/03/26 17:08:41 briggs Exp $ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)varargs.h 8.2 (Berkeley) 3/22/94 + */ + +#ifndef _M68K_VARARGS_H_ +#define _M68K_VARARGS_H_ + +#include <machine/ansi.h> + +typedef _BSD_VA_LIST_ va_list; + +#define va_dcl int va_alist; + +#define __va_promote(type) \ + (((sizeof(type) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) + +#define va_start(ap) \ + ap = (char *)&va_alist + +#ifdef _KERNEL +#define va_arg(ap, type) \ + ((type *)(ap += sizeof(type)))[-1] +#else +#define va_arg(ap, type) \ + ((type *)(ap += __va_promote(type), \ + ap - (sizeof(type) < sizeof(int) && \ + sizeof(type) != __va_promote(type) ? \ + sizeof(type) : __va_promote(type))))[0] +#endif + +#define va_end(ap) ((void) 0) + +#endif /* !_M68K_VARARGS_H_ */ |