1 /* $NetBSD: ecoff_machdep.h,v 1.1 2002/02/23 21:32:28 gmcgarry Exp $ */
4 * Copyright (c) 1997 Jonathan Stone
7 * Copyright (c) 1994 Adam Glass
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Adam Glass.
21 * 4. The name of the Author may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY Adam Glass ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL Adam Glass BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 typedef u_int16_t ECOFF_USHORT
;
38 typedef u_int32_t ECOFF_UINT
;
39 typedef u_int32_t ECOFF_ULONG
;
41 #define ECOFF_LDPGSZ 4096
45 #define ECOFF_MACHDEP \
46 ECOFF_ULONG gprmask; \
47 ECOFF_ULONG cprmask[4]; \
50 #include <mips/cpu.h> /* mips CPU architecture levels */
51 #define _MIPS3_OK() CPUISMIPS3
57 #define ECOFF_MAGIC_MIPSEB 0x0160 /* mips1, big-endian */
58 #define ECOFF_MAGIC_MIPSEL 0x0162 /* mips1, little-endian */
59 #define ECOFF_MAGIC_MIPSEL3 0x0142 /* mips3, little-endian */
61 #if BYTE_ORDER == LITTLE_ENDIAN
62 #define ECOFF_BADMAG(ep) \
64 ((ep)->f.f_magic == ECOFF_MAGIC_MIPSEL || \
65 (_MIPS3_OK() && (ep)->f.f_magic == ECOFF_MAGIC_MIPSEL3)) \
68 #if BYTE_ORDER == BIG_ENDIAN
69 #define ECOFF_BADMAG(ep) ((ep)->f.f_magic != ECOFF_MAGIC_MIPSEB)
73 #define ECOFF_SEGMENT_ALIGNMENT(ep) ((ep)->a.vstamp < 23 ? 8 : 16)
78 void cpu_exec_ecoff_setregs
__P((
79 struct proc
*, struct exec_package
*, u_long
));
84 * ECOFF symbol definitions for 32-bit mips.
85 * XXX 64-bit (mips3?) may be different.
106 int32_t cbSsExtOffset
;
115 /* Macro for field name used by cgd's Alpha-derived code */
116 #define esymMax iextMax
119 struct ecoff_extsym
{
127 unsigned es_symauxindex
:20;