1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef _XTENSA_ELF_H
14 #define _XTENSA_ELF_H
15
16 #include <asm/ptrace.h>
17 #include <asm/coprocessor.h>
18 #include <linux/elf-em.h>
19
20
21
22 #define EM_XTENSA_OLD 0xABC7
23
24
25
26 #define R_XTENSA_NONE 0
27 #define R_XTENSA_32 1
28 #define R_XTENSA_RTLD 2
29 #define R_XTENSA_GLOB_DAT 3
30 #define R_XTENSA_JMP_SLOT 4
31 #define R_XTENSA_RELATIVE 5
32 #define R_XTENSA_PLT 6
33 #define R_XTENSA_OP0 8
34 #define R_XTENSA_OP1 9
35 #define R_XTENSA_OP2 10
36 #define R_XTENSA_ASM_EXPAND 11
37 #define R_XTENSA_ASM_SIMPLIFY 12
38 #define R_XTENSA_GNU_VTINHERIT 15
39 #define R_XTENSA_GNU_VTENTRY 16
40 #define R_XTENSA_DIFF8 17
41 #define R_XTENSA_DIFF16 18
42 #define R_XTENSA_DIFF32 19
43 #define R_XTENSA_SLOT0_OP 20
44 #define R_XTENSA_SLOT1_OP 21
45 #define R_XTENSA_SLOT2_OP 22
46 #define R_XTENSA_SLOT3_OP 23
47 #define R_XTENSA_SLOT4_OP 24
48 #define R_XTENSA_SLOT5_OP 25
49 #define R_XTENSA_SLOT6_OP 26
50 #define R_XTENSA_SLOT7_OP 27
51 #define R_XTENSA_SLOT8_OP 28
52 #define R_XTENSA_SLOT9_OP 29
53 #define R_XTENSA_SLOT10_OP 30
54 #define R_XTENSA_SLOT11_OP 31
55 #define R_XTENSA_SLOT12_OP 32
56 #define R_XTENSA_SLOT13_OP 33
57 #define R_XTENSA_SLOT14_OP 34
58 #define R_XTENSA_SLOT0_ALT 35
59 #define R_XTENSA_SLOT1_ALT 36
60 #define R_XTENSA_SLOT2_ALT 37
61 #define R_XTENSA_SLOT3_ALT 38
62 #define R_XTENSA_SLOT4_ALT 39
63 #define R_XTENSA_SLOT5_ALT 40
64 #define R_XTENSA_SLOT6_ALT 41
65 #define R_XTENSA_SLOT7_ALT 42
66 #define R_XTENSA_SLOT8_ALT 43
67 #define R_XTENSA_SLOT9_ALT 44
68 #define R_XTENSA_SLOT10_ALT 45
69 #define R_XTENSA_SLOT11_ALT 46
70 #define R_XTENSA_SLOT12_ALT 47
71 #define R_XTENSA_SLOT13_ALT 48
72 #define R_XTENSA_SLOT14_ALT 49
73
74
75
76 typedef unsigned long elf_greg_t;
77
78 typedef struct user_pt_regs xtensa_gregset_t;
79
80 #define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t))
81
82 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
83
84 #define ELF_NFPREG 18
85
86 typedef unsigned int elf_fpreg_t;
87 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
88
89
90
91
92
93 #define elf_check_arch(x) ( ( (x)->e_machine == EM_XTENSA ) || \
94 ( (x)->e_machine == EM_XTENSA_OLD ) )
95
96
97
98
99
100 #ifdef __XTENSA_EL__
101 # define ELF_DATA ELFDATA2LSB
102 #elif defined(__XTENSA_EB__)
103 # define ELF_DATA ELFDATA2MSB
104 #else
105 # error processor byte order undefined!
106 #endif
107
108 #define ELF_CLASS ELFCLASS32
109 #define ELF_ARCH EM_XTENSA
110
111 #define ELF_EXEC_PAGESIZE PAGE_SIZE
112 #define CORE_DUMP_USE_REGSET
113
114
115
116
117
118
119
120
121 #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
122
123
124
125
126
127
128
129 #define ELF_HWCAP (0)
130
131
132
133
134
135
136
137
138
139 #define ELF_PLATFORM (NULL)
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155 #define ELF_PLAT_INIT(_r, load_addr) \
156 do { _r->areg[0]=0; _r->areg[2]=0; _r->areg[3]=0; \
157 _r->areg[4]=0; _r->areg[5]=0; _r->areg[6]=0; _r->areg[7]=0; \
158 _r->areg[8]=0; _r->areg[9]=0; _r->areg[10]=0; _r->areg[11]=0; \
159 _r->areg[12]=0; _r->areg[13]=0; _r->areg[14]=0; _r->areg[15]=0; \
160 } while (0)
161
162 typedef struct {
163 xtregs_opt_t opt;
164 xtregs_user_t user;
165 #if XTENSA_HAVE_COPROCESSORS
166 xtregs_cp0_t cp0;
167 xtregs_cp1_t cp1;
168 xtregs_cp2_t cp2;
169 xtregs_cp3_t cp3;
170 xtregs_cp4_t cp4;
171 xtregs_cp5_t cp5;
172 xtregs_cp6_t cp6;
173 xtregs_cp7_t cp7;
174 #endif
175 } elf_xtregs_t;
176
177 #define SET_PERSONALITY(ex) \
178 set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))
179
180 #endif