OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [gdb-5.0/] [include/] [aout/] [dynix3.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
/*
2
 * a.out specifics for Sequent Symmetry running Dynix 3.x
3
 */
4
#ifndef A_OUT_DYNIX3_H
5
#define A_OUT_DYNIX3_H
6
 
7
#define external_exec dynix_external_exec
8
 
9
/* struct exec for Dynix 3
10
 *
11
 * a_gdtbl and a_bootstrap are only for standalone binaries.
12
 * Shared data fields are not supported by the kernel as of Dynix 3.1,
13
 * but are supported by Dynix compiler programs.
14
 */
15
struct dynix_external_exec {
16
        unsigned char e_info[4];
17
        unsigned char e_text[4];
18
        unsigned char e_data[4];
19
        unsigned char e_bss[4];
20
        unsigned char e_syms[4];
21
        unsigned char e_entry[4];
22
        unsigned char e_trsize[4];
23
        unsigned char e_drsize[4];
24
        unsigned char e_g_code[8], e_g_data[8], e_g_desc[8];
25
        unsigned char e_shdata[4];
26
        unsigned char e_shbss[4];
27
        unsigned char e_shdrsize[4];
28
        unsigned char e_bootstrap[44];
29
        unsigned char e_reserved[12];
30
        unsigned char e_version[4];
31
};
32
 
33
#define EXEC_BYTES_SIZE (128)
34
 
35
/*
36
 * All executables under Dynix are demand paged with read-only text,
37
 * Thus no NMAGIC.
38
 *
39
 * ZMAGIC has a page of 0s at virtual 0,
40
 * XMAGIC has an invalid page at virtual 0
41
 */
42
#define OMAGIC  0x12eb          /* .o */
43
#define ZMAGIC  0x22eb          /* zero @ 0, demand load */
44
#define XMAGIC  0x32eb          /* invalid @ 0, demand load */
45
#define SMAGIC  0x42eb          /* standalone, not supported here */
46
 
47
#define N_BADMAG(x) ((OMAGIC != N_MAGIC(x)) && \
48
                     (ZMAGIC != N_MAGIC(x)) && \
49
                     (XMAGIC != N_MAGIC(x)) && \
50
                     (SMAGIC != N_MAGIC(x)))
51
 
52
#define N_ADDRADJ(x) ((ZMAGIC == N_MAGIC(x) || XMAGIC == N_MAGIC(x)) ? 0x1000 : 0)
53
 
54
#define N_TXTOFF(x) (EXEC_BYTES_SIZE)
55
#define N_DATOFF(x) (N_TXTOFF(x) + N_TXTSIZE(x))
56
#define N_SHDATOFF(x) (N_DATOFF(x) + (x).a_data)
57
#define N_TRELOFF(x) (N_SHDATOFF(x) + (x).a_shdata)
58
#define N_DRELOFF(x) (N_TRELOFF(x) + (x).a_trsize)
59
#define N_SHDRELOFF(x) (N_DRELOFF(x) + (x).a_drsize)
60
#define N_SYMOFF(x) (N_SHDRELOFF(x) + (x).a_shdrsize)
61
#define N_STROFF(x) (N_SYMOFF(x) + (x).a_syms)
62
 
63
#define N_TXTADDR(x) \
64
        (((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? 0 \
65
         : TEXT_START_ADDR + EXEC_BYTES_SIZE)
66
 
67
#define N_TXTSIZE(x) \
68
        (((OMAGIC == N_MAGIC(x)) || (SMAGIC == N_MAGIC(x))) ? ((x).a_text) \
69
         : ((x).a_text - N_ADDRADJ(x) - EXEC_BYTES_SIZE))
70
 
71
#endif /* A_OUT_DYNIX3_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.