ecoff_machdep.h revision 1.11
1268899Sbapt/*	$NetBSD: ecoff_machdep.h,v 1.11 1997/10/08 07:36:58 jonathan Exp $	*/
2234949Sbapt
3234949Sbapt/*
4234949Sbapt * Copyright (c) 1997 Jonathan Stone
5234949Sbapt * All rights reserved.
6234949Sbapt *
7234949Sbapt * Copyright (c) 1994 Adam Glass
8234949Sbapt * All rights reserved.
9234949Sbapt *
10234949Sbapt * Redistribution and use in source and binary forms, with or without
11234949Sbapt * modification, are permitted provided that the following conditions
12234949Sbapt * are met:
13234949Sbapt * 1. Redistributions of source code must retain the above copyright
14234949Sbapt *    notice, this list of conditions and the following disclaimer.
15234949Sbapt * 2. Redistributions in binary form must reproduce the above copyright
16234949Sbapt *    notice, this list of conditions and the following disclaimer in the
17234949Sbapt *    documentation and/or other materials provided with the distribution.
18234949Sbapt * 3. All advertising materials mentioning features or use of this software
19234949Sbapt *    must display the following acknowledgement:
20234949Sbapt *	This product includes software developed by Adam Glass.
21234949Sbapt * 4. The name of the Author may not be used to endorse or promote products
22234949Sbapt *    derived from this software without specific prior written permission.
23234949Sbapt *
24234949Sbapt * THIS SOFTWARE IS PROVIDED BY Adam Glass ``AS IS'' AND
25234949Sbapt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26234949Sbapt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27234949Sbapt * ARE DISCLAIMED.  IN NO EVENT SHALL Adam Glass BE LIABLE
28234949Sbapt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29234949Sbapt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30234949Sbapt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31234949Sbapt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32234949Sbapt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33234949Sbapt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34234949Sbapt * SUCH DAMAGE.
35234949Sbapt */
36234949Sbapt
37234949Sbapt#include <mips/cpu.h>		/* mips CPU architecture levels */
38234949Sbapt
39234949Sbapt#define ECOFF_LDPGSZ 4096
40234949Sbapt
41234949Sbapt#define ECOFF_PAD
42234949Sbapt
43234949Sbapt#define ECOFF_MACHDEP \
44234949Sbapt        u_long gprmask; \
45234949Sbapt        u_long cprmask[4]; \
46234949Sbapt        u_long gp_value
47234949Sbapt
48234949Sbapt#define ECOFF_MAGIC_MIPSEL	0x0162	/* mips1, little-endian */
49234949Sbapt#define ECOFF_MAGIC_MIPSEL3	0x0142	/* mips3, little-endian */
50234949Sbapt
51234949Sbapt#define ECOFF_BADMAG(ep) \
52234949Sbapt    (!								\
53234949Sbapt	((ep)->f.f_magic == ECOFF_MAGIC_MIPSEL ||		\
54268899Sbapt	 (CPUISMIPS3 && (ep)->f.f_magic == ECOFF_MAGIC_MIPSEL3)) \
55234949Sbapt    )
56268899Sbapt
57268899Sbapt
58234949Sbapt#define ECOFF_SEGMENT_ALIGNMENT(ep) ((ep)->a.vstamp < 23 ? 8 : 16)
59234949Sbapt
60234949Sbaptextern void	cpu_exec_ecoff_setregs __P((
61234949Sbapt    struct proc *, struct exec_package *, u_long));
62234949Sbapt
63234949Sbapt
64234949Sbapt/*
65234949Sbapt * ECOFF symbol definitions for 32-bit mips.
66234949Sbapt * XXX 64-bit (mips3?) may be different.
67234949Sbapt */
68234949Sbaptstruct ecoff_symhdr {
69234949Sbapt	int16_t		magic;
70234949Sbapt	int16_t		vstamp;
71234949Sbapt	int32_t		ilineMax;
72234949Sbapt	int32_t		cbLine;
73234949Sbapt	int32_t		cbLineOffset;
74234949Sbapt	int32_t		idnMax;
75234949Sbapt	int32_t		cbDnOffset;
76234949Sbapt	int32_t		ipdMax;
77234949Sbapt	int32_t		cbPdOffset;
78234949Sbapt	int32_t		isymMax;
79234949Sbapt	int32_t		cbSymOffset;
80234949Sbapt	int32_t		ioptMax;
81234949Sbapt	int32_t		cbOptOffset;
82234949Sbapt	int32_t		iauxMax;
83234949Sbapt	int32_t		cbAuxOffset;
84234949Sbapt	int32_t		issMax;
85234949Sbapt	int32_t		cbSsOffset;
86234949Sbapt	int32_t		issExtMax;
87234949Sbapt	int32_t		cbSsExtOffset;
88234949Sbapt	int32_t		ifdMax;
89234949Sbapt	int32_t		cbFdOffset;
90234949Sbapt	int32_t		crfd;
91234949Sbapt	int32_t		cbRfdOffset;
92234949Sbapt	int32_t		iextMax;
93234949Sbapt	int32_t		cbExtOffset;
94234949Sbapt};
95234949Sbapt
96234949Sbapt/* Macro for field name used by cgd's Alpha-derived code */
97234949Sbapt#define esymMax iextMax
98234949Sbapt
99234949Sbapt
100234949Sbaptstruct ecoff_extsym {
101234949Sbapt	u_int16_t	es_flags;
102234949Sbapt	u_int16_t	es_ifd;
103234949Sbapt	int32_t		es_strindex;
104234949Sbapt	int32_t		es_value;
105234949Sbapt	unsigned	es_type:6;
106234949Sbapt	unsigned	es_class:5;
107234949Sbapt	unsigned	:1;
108234949Sbapt	unsigned	es_symauxindex:20;
109234949Sbapt};
110234949Sbapt
111234949Sbapt
112234949Sbapt