1 |
/* gxemul: $Id: exec_ecoff_mips.h,v 1.7 2005/03/05 12:34:02 debug Exp $ |
2 |
* Addition of some ECOFF magin numbers, and ECOFF_BADMAG has been commented |
3 |
* out to avoid warnings on Solaris. |
4 |
*/ |
5 |
|
6 |
#ifndef EXEC_ECOFF_MIPS_H |
7 |
#define EXEC_ECOFF_MIPS_H |
8 |
|
9 |
/* $NetBSD: ecoff_machdep.h,v 1.18 2002/03/05 14:12:29 simonb Exp $ */ |
10 |
|
11 |
/* |
12 |
* Copyright (c) 1997 Jonathan Stone |
13 |
* All rights reserved. |
14 |
* |
15 |
* Copyright (c) 1994 Adam Glass |
16 |
* All rights reserved. |
17 |
* |
18 |
* Redistribution and use in source and binary forms, with or without |
19 |
* modification, are permitted provided that the following conditions |
20 |
* are met: |
21 |
* 1. Redistributions of source code must retain the above copyright |
22 |
* notice, this list of conditions and the following disclaimer. |
23 |
* 2. Redistributions in binary form must reproduce the above copyright |
24 |
* notice, this list of conditions and the following disclaimer in the |
25 |
* documentation and/or other materials provided with the distribution. |
26 |
* 3. All advertising materials mentioning features or use of this software |
27 |
* must display the following acknowledgement: |
28 |
* This product includes software developed by Adam Glass. |
29 |
* 4. The name of the Author may not be used to endorse or promote products |
30 |
* derived from this software without specific prior written permission. |
31 |
* |
32 |
* THIS SOFTWARE IS PROVIDED BY Adam Glass ``AS IS'' AND |
33 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
34 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
35 |
* ARE DISCLAIMED. IN NO EVENT SHALL Adam Glass BE LIABLE |
36 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
37 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
38 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
39 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
40 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
41 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
42 |
* SUCH DAMAGE. |
43 |
*/ |
44 |
|
45 |
#define ECOFF_LDPGSZ 4096 |
46 |
|
47 |
#define ECOFF_PAD |
48 |
|
49 |
/* gxemul NOTE: Original types in NetBSD were 'u_long', not uint32_t */ |
50 |
|
51 |
#define ECOFF_MACHDEP \ |
52 |
uint32_t gprmask; \ |
53 |
uint32_t cprmask[4]; \ |
54 |
uint32_t gp_value |
55 |
#ifdef _KERNEL |
56 |
#include <mips/cpu.h> /* mips CPU architecture levels */ |
57 |
#define _MIPS3_OK() CPUISMIPS3 |
58 |
#else |
59 |
#define _MIPS3_OK() 1 |
60 |
#endif |
61 |
|
62 |
|
63 |
#define ECOFF_MAGIC_MIPSEB 0x0160 /* mips1, big-endian */ |
64 |
#define ECOFF_MAGIC_MIPSEL 0x0162 /* mips1, little-endian */ |
65 |
#define ECOFF_MAGIC_MIPSEB2 0x0163 /* mips2, big-endian (gxemul addition) */ |
66 |
#define ECOFF_MAGIC_MIPSEL2 0x0166 /* mips2, little-endian (gxemul addition) */ |
67 |
#define ECOFF_MAGIC_MIPSEB3 0x0140 /* mips3, big-endian (gxemul addition) */ |
68 |
#define ECOFF_MAGIC_MIPSEL3 0x0142 /* mips3, little-endian */ |
69 |
|
70 |
#if 0 |
71 |
/* commented out in gxemul, to avoid warnings on Solaris */ |
72 |
#if BYTE_ORDER == LITTLE_ENDIAN |
73 |
#define ECOFF_BADMAG(ep) \ |
74 |
(! \ |
75 |
((ep)->f.f_magic == ECOFF_MAGIC_MIPSEL || \ |
76 |
(_MIPS3_OK() && (ep)->f.f_magic == ECOFF_MAGIC_MIPSEL3)) \ |
77 |
) |
78 |
#endif |
79 |
#if BYTE_ORDER == BIG_ENDIAN |
80 |
#define ECOFF_BADMAG(ep) ((ep)->f.f_magic != ECOFF_MAGIC_MIPSEB) |
81 |
#endif |
82 |
#endif /* gxemul */ |
83 |
|
84 |
#define ECOFF_SEGMENT_ALIGNMENT(ep) ((ep)->a.vstamp < 23 ? 8 : 16) |
85 |
|
86 |
#ifdef _KERNEL |
87 |
struct proc; |
88 |
struct exec_package; |
89 |
void cpu_exec_ecoff_setregs(struct proc *, struct exec_package *, u_long); |
90 |
#endif /* _KERNEL */ |
91 |
|
92 |
|
93 |
/* |
94 |
* ECOFF symbol definitions for 32-bit mips. |
95 |
* XXX 64-bit (mips3?) may be different. |
96 |
*/ |
97 |
struct ecoff_symhdr { |
98 |
int16_t magic; |
99 |
int16_t vstamp; |
100 |
int32_t ilineMax; |
101 |
int32_t cbLine; |
102 |
int32_t cbLineOffset; |
103 |
int32_t idnMax; |
104 |
int32_t cbDnOffset; |
105 |
int32_t ipdMax; |
106 |
int32_t cbPdOffset; |
107 |
int32_t isymMax; |
108 |
int32_t cbSymOffset; |
109 |
int32_t ioptMax; |
110 |
int32_t cbOptOffset; |
111 |
int32_t iauxMax; |
112 |
int32_t cbAuxOffset; |
113 |
int32_t issMax; |
114 |
int32_t cbSsOffset; |
115 |
int32_t issExtMax; |
116 |
int32_t cbSsExtOffset; |
117 |
int32_t ifdMax; |
118 |
int32_t cbFdOffset; |
119 |
int32_t crfd; |
120 |
int32_t cbRfdOffset; |
121 |
int32_t iextMax; |
122 |
int32_t cbExtOffset; |
123 |
}; |
124 |
|
125 |
#define MIPS_MAGIC_SYM 0x7009 /* gxemul addition */ |
126 |
|
127 |
/* Macro for field name used by cgd's Alpha-derived code */ |
128 |
#define esymMax iextMax |
129 |
|
130 |
|
131 |
struct ecoff_extsym { |
132 |
uint16_t es_flags; |
133 |
uint16_t es_ifd; |
134 |
int32_t es_strindex; |
135 |
int32_t es_value; |
136 |
unsigned es_type:6; |
137 |
unsigned es_class:5; |
138 |
unsigned :1; |
139 |
unsigned es_symauxindex:20; |
140 |
}; |
141 |
|
142 |
#endif /* EXEC_ECOFF_MIPS_H */ |
143 |
|