ecoff_machdep.h revision 1.11 1 /* $NetBSD: ecoff_machdep.h,v 1.11 1997/10/08 07:36:58 jonathan Exp $ */
2
3 /*
4 * Copyright (c) 1997 Jonathan Stone
5 * All rights reserved.
6 *
7 * Copyright (c) 1994 Adam Glass
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
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.
23 *
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
34 * SUCH DAMAGE.
35 */
36
37 #include <mips/cpu.h> /* mips CPU architecture levels */
38
39 #define ECOFF_LDPGSZ 4096
40
41 #define ECOFF_PAD
42
43 #define ECOFF_MACHDEP \
44 u_long gprmask; \
45 u_long cprmask[4]; \
46 u_long gp_value
47
48 #define ECOFF_MAGIC_MIPSEL 0x0162 /* mips1, little-endian */
49 #define ECOFF_MAGIC_MIPSEL3 0x0142 /* mips3, little-endian */
50
51 #define ECOFF_BADMAG(ep) \
52 (! \
53 ((ep)->f.f_magic == ECOFF_MAGIC_MIPSEL || \
54 (CPUISMIPS3 && (ep)->f.f_magic == ECOFF_MAGIC_MIPSEL3)) \
55 )
56
57
58 #define ECOFF_SEGMENT_ALIGNMENT(ep) ((ep)->a.vstamp < 23 ? 8 : 16)
59
60 extern void cpu_exec_ecoff_setregs __P((
61 struct proc *, struct exec_package *, u_long));
62
63
64 /*
65 * ECOFF symbol definitions for 32-bit mips.
66 * XXX 64-bit (mips3?) may be different.
67 */
68 struct ecoff_symhdr {
69 int16_t magic;
70 int16_t vstamp;
71 int32_t ilineMax;
72 int32_t cbLine;
73 int32_t cbLineOffset;
74 int32_t idnMax;
75 int32_t cbDnOffset;
76 int32_t ipdMax;
77 int32_t cbPdOffset;
78 int32_t isymMax;
79 int32_t cbSymOffset;
80 int32_t ioptMax;
81 int32_t cbOptOffset;
82 int32_t iauxMax;
83 int32_t cbAuxOffset;
84 int32_t issMax;
85 int32_t cbSsOffset;
86 int32_t issExtMax;
87 int32_t cbSsExtOffset;
88 int32_t ifdMax;
89 int32_t cbFdOffset;
90 int32_t crfd;
91 int32_t cbRfdOffset;
92 int32_t iextMax;
93 int32_t cbExtOffset;
94 };
95
96 /* Macro for field name used by cgd's Alpha-derived code */
97 #define esymMax iextMax
98
99
100 struct ecoff_extsym {
101 u_int16_t es_flags;
102 u_int16_t es_ifd;
103 int32_t es_strindex;
104 int32_t es_value;
105 unsigned es_type:6;
106 unsigned es_class:5;
107 unsigned :1;
108 unsigned es_symauxindex:20;
109 };
110
111
112