sym-sgi.h
14.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
/*
* Copyright (C) 1996-1998 by the Board of Trustees
* of Leland Stanford Junior University.
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef _SYM_SGI_H_
#define _SYM_SGI_H_
#include "simtypes.h"
#define langAssembler 3 /* one Assembley inst might map to many mach */
#define scNil 0
#define scText 1 /* text symbol */
#define scData 2 /* initialized data symbol */
#define scBss 3 /* un-initialized data symbol */
#define scRegister 4 /* value of symbol is register number */
#define scAbs 5 /* value of symbol is absolute */
#define scUndefined 6 /* who knows? */
#define scCdbLocal 7 /* variable's value is IN se->va.?? */
#define scBits 8 /* this is a bit field */
#define scCdbSystem 9 /* variable's value is IN CDB's address space */
#define scDbx 9 /* overlap dbx internal use */
#define scRegImage 10 /* register value saved on stack */
#define scInfo 11 /* symbol contains debugger information */
#define scUserStruct 12 /* address in struct user for current process */
#define scSData 13 /* load time only small data */
#define scSBss 14 /* load time only small common */
#define scRData 15 /* load time only read only data */
#define scVar 16 /* Var parameter (fortran,pascal) */
#define scCommon 17 /* common variable */
#define scSCommon 18 /* small common */
#define stNil 0 /* Nuthin' special */
#define stGlobal 1 /* external symbol */
#define stStatic 2 /* static */
#define stParam 3 /* procedure argument */
#define stLocal 4 /* local variable */
#define stLabel 5 /* label */
#define stProc 6 /* " " Procedure */
#define stBlock 7 /* beginnning of block */
#define stEnd 8 /* end (of anything) */
#define stMember 9 /* member (of anything - struct/union/enum */
#define stTypedef 10 /* type definition */
#define stFile 11 /* file name */
#define stRegReloc 12 /* register relocation */
#define stForward 13 /* forwarding address */
#define stStaticProc 14 /* load time only static procs */
#define stConstant 15 /* const */
#define stStaParam 16 /* Fortran static parameters */
#define stBase 17 /* DEC */
#define stTag 18 /* DEC */
#define stAdjMember 19 /* DEC INTERLUDE */
#define stPublic 20 /* public access divider */
#define stProtected 21 /* protected access divider */
#define stPrivate 22 /* private access divider */
#define stTemp 23 /* template */
#define stTempProc 24 /* template function */
#define stDefArg 25 /* default argument */
#define stStruct 26 /* begin Struct kind of stBlock */
#define stUnion 27 /* begin Union kind of stBlock */
#define stEnum 28 /* begin Enum kind of stBlock */
#define stIndirect 34 /* Indirect type specification */
#define tqNil 0 /* bt is what you see */
#define tqPtr 1 /* pointer */
#define tqProc 2 /* procedure */
#define tqArray 3 /* duh */
#define tqFar 4 /* longer addressing - 8086/8 land */
#define tqVol 5 /* volatile */
#define tqConst 6 /* const */
#define btNil 0 /* undefined */
#define btAdr32 1 /* 32-bit address */
#define btAdr btAdr32 /* address - integer same size as pointer */
#define btChar 2 /* character */
#define btUChar 3 /* unsigned character */
#define btShort 4 /* short */
#define btUShort 5 /* unsigned short */
#define btInt32 6 /* 32-bit int */
#define btInt btInt32 /* int */
#define btUInt32 7 /* 32-bit unsigned int */
#define btUInt btUInt32 /* unsigned int */
#define btLong32 8 /* 32-bit long */
#define btLong btLong32 /* long */
#define btULong32 9 /* 32-bit unsigned long */
#define btULong btULong32 /* unsigned long */
#define btFloat 10 /* float (real) */
#define btDouble 11 /* Double (real) */
#define btStruct 12 /* Structure (Record) */
#define btUnion 13 /* Union (variant) */
#define btEnum 14 /* Enumerated */
#define btTypedef 15 /* defined via a typedef, isymRef points */
#define btLong64 30 /* 64-bit long */
#define btULong64 31 /* 64-bit unsigned long */
#define btLongLong64 32 /* 64-bit int64 */
#define btLongLong btLongLong64 /* int64 */
#define btULongLong64 33 /* 64-bit uint64 */
#define btULongLong btULongLong64 /* uint64 */
#define btAdr64 34 /* 64-bit address */
typedef int32 long_i;
typedef uint32 ulong_i;
typedef struct __sgi_hdrr_s {
short magic; /* to verify validity of the table */
short vstamp; /* version stamp */
long_i ilineMax; /* number of line number entries */
long_i cbLine; /* number of bytes for line number entries */
long_i cbLineOffset; /* offset to start of line number entries*/
long_i idnMax; /* max index into dense number table */
long_i cbDnOffset; /* offset to start dense number table */
long_i ipdMax; /* number of procedures */
long_i cbPdOffset; /* offset to procedure descriptor table */
long_i isymMax; /* number of local symbols */
long_i cbSymOffset; /* offset to start of local symbols*/
long_i ioptMax; /* max index into optimization symbol entries */
long_i cbOptOffset; /* offset to optimization symbol entries */
long_i iauxMax; /* number of auxillary symbol entries */
long_i cbAuxOffset; /* offset to start of auxillary symbol entries*/
long_i issMax; /* max index into local strings */
long_i cbSsOffset; /* offset to start of local strings */
long_i issExtMax; /* max index into external strings */
long_i cbSsExtOffset; /* offset to start of external strings */
long_i ifdMax; /* number of file descriptor entries */
long_i cbFdOffset; /*s offset to file descriptor table */
long_i crfd; /* number of relative file descriptor entries */
long_i cbRfdOffset; /* offset to relative file descriptor table */
long_i iextMax; /* max index into external symbols */
long_i cbExtOffset; /* offset to start of external symbol entries*/
/* If you add machine dependent fields, add them here */
} HDRR, *pHDRR;
#define cbHDRR sizeof(HDRR)
#define hdrNil ((pHDRR)0)
#ifdef HOST_BIG_ENDIAN
typedef struct fdr {
ulong_i adr; /* memory address of beginning of file */
long_i rss; /* file name (of source, if known) */
long_i issBase; /* file's string space */
long_i cbSs; /* number of bytes in the ss */
long_i isymBase; /* beginning of symbols */
long_i csym; /* count file's of symbols */
long_i ilineBase; /* file's line symbols */
long_i cline; /* count of file's line symbols */
long_i ioptBase; /* file's optimization entries */
long_i copt; /* count of file's optimization entries */
/* the following MUST be unsigned: still
** restricts to 64K procedures. sgi */
unsigned short ipdFirst;/* start of procedures for this file */
unsigned short cpd; /* count of procedures for this file */
long_i iauxBase; /* file's auxiliary entries */
long_i caux; /* count of file's auxiliary entries */
long_i rfdBase; /* index into the file indirect table */
long_i crfd; /* count file indirect entries */
unsigned lang: 5; /* language for this file */
unsigned fMerge : 1; /* whether this file can be merged */
unsigned fReadin : 1; /* true if it was read in (not just created) */
unsigned fBigendian : 1;/* if set, was compiled on big endian machine */
/* aux's will be in compile host's sex */
unsigned glevel : 2; /* level this file was compiled with */
unsigned signedchar : 1; /* whether files was compiled with char being signed */
unsigned ipdFirstMSBits: 4; /* upper bits to allow ipdFirst to
exceed 64K entries
(These are the most significant bits of what is,
after concatenating the bits, a 20 bit number) */
unsigned cpdMSBits: 4; /* upper bits to allow cpd to exceed 64K
entries
(These are the most significant bits of what is,
after concatenating the bits, a 20 bit number) */
unsigned reserved : 13; /* reserved for future use */
long_i cbLineOffset; /* byte offset from header for this file ln's */
long_i cbLine; /* size of lines for this file */
} FDR, *pFDR;
#endif
#ifdef HOST_LITTLE_ENDIAN
typedef struct fdr {
ulong_i adr; /* memory address of beginning of file */
long_i rss; /* file name (of source, if known) */
long_i issBase; /* file's string space */
long_i cbSs; /* number of bytes in the ss */
long_i isymBase; /* beginning of symbols */
long_i csym; /* count file's of symbols */
long_i ilineBase; /* file's line symbols */
long_i cline; /* count of file's line symbols */
long_i ioptBase; /* file's optimization entries */
long_i copt; /* count of file's optimization entries */
/* the following MUST be unsigned: still
** restricts to 64K procedures. sgi */
unsigned short ipdFirst;/* start of procedures for this file */
unsigned short cpd; /* count of procedures for this file */
long_i iauxBase; /* file's auxiliary entries */
long_i caux; /* count of file's auxiliary entries */
long_i rfdBase; /* index into the file indirect table */
long_i crfd; /* count file indirect entries */
unsigned reserved : 13; /* reserved for future use */
unsigned cpdMSBits: 4; /* upper bits to allow cpd to exceed 64K
entries
(These are the most significant bits of what is,
after concatenating the bits, a 20 bit number) */
unsigned ipdFirstMSBits: 4; /* upper bits to allow ipdFirst to
exceed 64K entries
(These are the most significant bits of what is,
after concatenating the bits, a 20 bit number) */
unsigned signedchar : 1; /* whether files was compiled with char being signed */
unsigned glevel : 2; /* level this file was compiled with */
unsigned fBigendian : 1;/* if set, was compiled on big endian machine */
/* aux's will be in compile host's sex */
unsigned fReadin : 1; /* true if it was read in (not just created) */
unsigned fMerge : 1; /* whether this file can be merged */
unsigned lang: 5; /* language for this file */
long_i cbLineOffset; /* byte offset from header for this file ln's */
long_i cbLine; /* size of lines for this file */
} FDR, *pFDR;
#endif
#define cbFDR sizeof(FDR)
#define fdNil ((pFDR)0)
#define ifdNil -1
#define ifdTemp 0
#define ilnNil -1
typedef struct pdr {
ulong_i adr; /* memory address of start of procedure */
long_i isym; /* start of local symbol entries */
long_i iline; /* start of line number entries*/
long_i regmask; /* save register mask */
long_i regoffset; /* save register offset */
long_i iopt; /* start of optimization symbol entries*/
long_i fregmask; /* save floating point register mask */
long_i fregoffset; /* save floating point register offset */
long_i frameoffset; /* frame size */
short framereg; /* frame pointer register */
short pcreg; /* offset or reg of return pc */
long_i lnLow; /* lowest line in the procedure */
long_i lnHigh; /* highest line in the procedure */
long_i cbLineOffset; /* byte offset for this procedure from the fd base */
} PDR, *pPDR;
#define cbPDR sizeof(PDR)
#define pdNil ((pPDR) 0)
#define ipdNil -1
typedef long_i LINER, *pLINER;
#define lineNil ((pLINER)0)
#define cbLINER sizeof(LINER)
#define ilineNil -1
#ifdef HOST_BIG_ENDIAN
typedef struct __sgi_symr_s {
long_i iss; /* index into String Space of name */
long_i value; /* value of symbol */
unsigned st : 6; /* symbol type */
unsigned sc : 5; /* storage class - text, data, etc */
unsigned reserved : 1; /* reserved */
unsigned index : 20; /* index into sym/aux table */
} SYMR, *pSYMR;
#endif
#ifdef HOST_LITTLE_ENDIAN
typedef struct __sgi_symr_s {
long_i iss; /* index into String Space of name */
long_i value; /* value of symbol */
unsigned index : 20; /* index into sym/aux table */
unsigned reserved : 1; /* reserved */
unsigned sc : 5; /* storage class - text, data, etc */
unsigned st : 6; /* symbol type */
} SYMR, *pSYMR;
#endif
#define symNil ((pSYMR)0)
#define cbSYMR sizeof(SYMR)
#define isymNil -1
#define indexNil 0xfffff
#define issNil -1
#define issNull 0
#ifdef HOST_BIG_ENDIAN
typedef struct __sgi_extr__ {
unsigned jmptbl:1; /* symbol is a jump table entry for shlibs */
unsigned cobol_main:1; /* symbol is a cobol main procedure */
unsigned weakext:1; /* symbol is weak external */
unsigned deltacplus:1; /* symbol is delta C++ symbol */
unsigned multiext:1; /* symbol may be defined multiple times */
unsigned reserved:11; /* reserved for future use */
short ifd; /* where the iss and index fields point into */
SYMR asym; /* symbol for the external */
} EXTR, *pEXTR;
#endif
#ifdef HOST_LITTLE_ENDIAN
typedef struct __sgi_extr__ {
unsigned reserved:11; /* reserved for future use */
unsigned multiext:1; /* symbol may be defined multiple times */
unsigned deltacplus:1; /* symbol is delta C++ symbol */
unsigned weakext:1; /* symbol is weak external */
unsigned cobol_main:1; /* symbol is a cobol main procedure */
unsigned jmptbl:1; /* symbol is a jump table entry for shlibs */
short ifd; /* where the iss and index fields point into */
SYMR asym; /* symbol for the external */
} EXTR, *pEXTR;
#endif
#define extNil ((pEXTR)0)
#define cbEXTR sizeof(EXTR)
#ifdef HOST_BIG_ENDIAN
typedef struct {
unsigned fBitfield : 1; /* set if bit width is specified */
unsigned continued : 1; /* indicates additional TQ info in next AUX */
unsigned bt : 6; /* basic type */
unsigned tq4 : 4;
unsigned tq5 : 4;
/* ---- 16 bit boundary ---- */
unsigned tq0 : 4;
unsigned tq1 : 4; /* 6 type qualifiers - tqPtr, etc. */
unsigned tq2 : 4;
unsigned tq3 : 4;
} TIR, *pTIR;
#endif
#ifdef HOST_LITTLE_ENDIAN
typedef struct {
unsigned tq3 : 4;
unsigned tq2 : 4;
unsigned tq1 : 4; /* 6 type qualifiers - tqPtr, etc. */
unsigned tq0 : 4;
/* ---- 16 bit boundary ---- */
unsigned tq5 : 4;
unsigned tq4 : 4;
unsigned bt : 6; /* basic type */
unsigned continued : 1; /* indicates additional TQ info in next AUX */
unsigned fBitfield : 1; /* set if bit width is specified */
} TIR, *pTIR;
#endif
#define cbTIR sizeof(TIR)
#define tiNil ((pTIR)0)
#define itqMax 6
#ifdef HOST_BIG_ENDIAN
typedef struct {
unsigned rfd : 12; /* index into the file indirect table */
unsigned index : 20; /* index int sym/aux/iss tables */
} RNDXR, *pRNDXR;
#endif
#ifdef HOST_LITTLE_ENDIAN
typedef struct {
unsigned index : 20; /* index int sym/aux/iss tables */
unsigned rfd : 12; /* index into the file indirect table */
} RNDXR, *pRNDXR;
#endif
#define cbRNDXR sizeof(RNDXR)
#define rndxNil ((pRNDXR)0)
typedef union __sgi_auxu_u {
TIR ti; /* type information record */
RNDXR rndx; /* relative index into symbol table */
long_i dnLow; /* low dimension */
long_i dnHigh; /* high dimension */
long_i isym; /* symbol table index (end of proc) */
long_i iss; /* index into string space (not used) */
long_i width; /* width for non-default sized struc fields */
long_i count; /* count of ranges for variant arm */
} AUXU, *pAUXU;
#define cbAUXU sizeof(AUXU)
#define auxNil ((pAUXU)0)
#define iauxNil -1
typedef long_i RFDT, *pRFDT;
#define cbRFDT sizeof(RFDT)
#define rfdNil -1
#endif