1#ifndef __ASMPARISC_ELF_H
2#define __ASMPARISC_ELF_H
3
4
5
6
7
8#include <asm/ptrace.h>
9
10#define EM_PARISC 15
11
12
13
14
15
16#define EF_PARISC_TRAPNIL 0x00010000
17#define EF_PARISC_EXT 0x00020000
18#define EF_PARISC_LSB 0x00040000
19#define EF_PARISC_WIDE 0x00080000
20#define EF_PARISC_NO_KABP 0x00100000
21
22#define EF_PARISC_LAZYSWAP 0x00400000
23#define EF_PARISC_ARCH 0x0000ffff
24
25
26
27#define EFA_PARISC_1_0 0x020b
28#define EFA_PARISC_1_1 0x0210
29#define EFA_PARISC_2_0 0x0214
30
31
32
33#define SHN_PARISC_ANSI_COMMON 0xff00
34
35#define SHN_PARISC_HUGE_COMMON 0xff01
36
37
38
39#define SHT_PARISC_EXT 0x70000000
40#define SHT_PARISC_UNWIND 0x70000001
41#define SHT_PARISC_DOC 0x70000002
42
43
44
45#define SHF_PARISC_SHORT 0x20000000
46#define SHF_PARISC_HUGE 0x40000000
47#define SHF_PARISC_SBP 0x80000000
48
49
50
51#define STT_PARISC_MILLICODE 13
52
53#define STT_HP_OPAQUE (STT_LOOS + 0x1)
54#define STT_HP_STUB (STT_LOOS + 0x2)
55
56
57
58#define R_PARISC_NONE 0
59#define R_PARISC_DIR32 1
60#define R_PARISC_DIR21L 2
61#define R_PARISC_DIR17R 3
62#define R_PARISC_DIR17F 4
63#define R_PARISC_DIR14R 6
64#define R_PARISC_PCREL32 9
65#define R_PARISC_PCREL21L 10
66#define R_PARISC_PCREL17R 11
67#define R_PARISC_PCREL17F 12
68#define R_PARISC_PCREL14R 14
69#define R_PARISC_DPREL21L 18
70#define R_PARISC_DPREL14R 22
71#define R_PARISC_GPREL21L 26
72#define R_PARISC_GPREL14R 30
73#define R_PARISC_LTOFF21L 34
74#define R_PARISC_LTOFF14R 38
75#define R_PARISC_SECREL32 41
76#define R_PARISC_SEGBASE 48
77#define R_PARISC_SEGREL32 49
78#define R_PARISC_PLTOFF21L 50
79#define R_PARISC_PLTOFF14R 54
80#define R_PARISC_LTOFF_FPTR32 57
81#define R_PARISC_LTOFF_FPTR21L 58
82#define R_PARISC_LTOFF_FPTR14R 62
83#define R_PARISC_FPTR64 64
84#define R_PARISC_PLABEL32 65
85#define R_PARISC_PCREL64 72
86#define R_PARISC_PCREL22F 74
87#define R_PARISC_PCREL14WR 75
88#define R_PARISC_PCREL14DR 76
89#define R_PARISC_PCREL16F 77
90#define R_PARISC_PCREL16WF 78
91#define R_PARISC_PCREL16DF 79
92#define R_PARISC_DIR64 80
93#define R_PARISC_DIR14WR 83
94#define R_PARISC_DIR14DR 84
95#define R_PARISC_DIR16F 85
96#define R_PARISC_DIR16WF 86
97#define R_PARISC_DIR16DF 87
98#define R_PARISC_GPREL64 88
99#define R_PARISC_GPREL14WR 91
100#define R_PARISC_GPREL14DR 92
101#define R_PARISC_GPREL16F 93
102#define R_PARISC_GPREL16WF 94
103#define R_PARISC_GPREL16DF 95
104#define R_PARISC_LTOFF64 96
105#define R_PARISC_LTOFF14WR 99
106#define R_PARISC_LTOFF14DR 100
107#define R_PARISC_LTOFF16F 101
108#define R_PARISC_LTOFF16WF 102
109#define R_PARISC_LTOFF16DF 103
110#define R_PARISC_SECREL64 104
111#define R_PARISC_SEGREL64 112
112#define R_PARISC_PLTOFF14WR 115
113#define R_PARISC_PLTOFF14DR 116
114#define R_PARISC_PLTOFF16F 117
115#define R_PARISC_PLTOFF16WF 118
116#define R_PARISC_PLTOFF16DF 119
117#define R_PARISC_LTOFF_FPTR64 120
118#define R_PARISC_LTOFF_FPTR14WR 123
119#define R_PARISC_LTOFF_FPTR14DR 124
120#define R_PARISC_LTOFF_FPTR16F 125
121#define R_PARISC_LTOFF_FPTR16WF 126
122#define R_PARISC_LTOFF_FPTR16DF 127
123#define R_PARISC_LORESERVE 128
124#define R_PARISC_COPY 128
125#define R_PARISC_IPLT 129
126#define R_PARISC_EPLT 130
127#define R_PARISC_TPREL32 153
128#define R_PARISC_TPREL21L 154
129#define R_PARISC_TPREL14R 158
130#define R_PARISC_LTOFF_TP21L 162
131#define R_PARISC_LTOFF_TP14R 166
132#define R_PARISC_LTOFF_TP14F 167
133#define R_PARISC_TPREL64 216
134#define R_PARISC_TPREL14WR 219
135#define R_PARISC_TPREL14DR 220
136#define R_PARISC_TPREL16F 221
137#define R_PARISC_TPREL16WF 222
138#define R_PARISC_TPREL16DF 223
139#define R_PARISC_LTOFF_TP64 224
140#define R_PARISC_LTOFF_TP14WR 227
141#define R_PARISC_LTOFF_TP14DR 228
142#define R_PARISC_LTOFF_TP16F 229
143#define R_PARISC_LTOFF_TP16WF 230
144#define R_PARISC_LTOFF_TP16DF 231
145#define R_PARISC_HIRESERVE 255
146
147#define PA_PLABEL_FDESC 0x02
148
149
150
151
152
153
154
155
156
157
158typedef struct elf32_fdesc {
159 __u32 addr;
160 __u32 gp;
161} Elf32_Fdesc;
162
163
164typedef struct elf64_fdesc {
165 __u64 dummy[2];
166
167 __u64 addr;
168 __u64 gp;
169} Elf64_Fdesc;
170
171#ifdef __KERNEL__
172
173#ifdef CONFIG_64BIT
174#define Elf_Fdesc Elf64_Fdesc
175#else
176#define Elf_Fdesc Elf32_Fdesc
177#endif
178
179#endif
180
181
182
183#define PT_HP_TLS (PT_LOOS + 0x0)
184#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
185#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
186#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
187#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
188#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
189#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
190#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
191#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
192#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
193#define PT_HP_PARALLEL (PT_LOOS + 0x10)
194#define PT_HP_FASTBIND (PT_LOOS + 0x11)
195#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
196#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
197#define PT_HP_STACK (PT_LOOS + 0x14)
198
199#define PT_PARISC_ARCHEXT 0x70000000
200#define PT_PARISC_UNWIND 0x70000001
201
202
203
204#define PF_PARISC_SBP 0x08000000
205
206#define PF_HP_PAGE_SIZE 0x00100000
207#define PF_HP_FAR_SHARED 0x00200000
208#define PF_HP_NEAR_SHARED 0x00400000
209#define PF_HP_CODE 0x01000000
210#define PF_HP_MODIFY 0x02000000
211#define PF_HP_LAZYSWAP 0x04000000
212#define PF_HP_SBP 0x08000000
213
214
215
216
217
218
219
220
221#ifndef ELF_CLASS
222
223
224
225
226
227
228
229
230
231
232
233#ifdef CONFIG_64BIT
234#define ELF_CLASS ELFCLASS64
235#else
236#define ELF_CLASS ELFCLASS32
237#endif
238
239typedef unsigned long elf_greg_t;
240
241
242
243
244
245
246
247#define ELF_PLATFORM ("PARISC\0")
248
249#define SET_PERSONALITY(ex) \
250 set_personality((current->personality & ~PER_MASK) | PER_LINUX); \
251 current->thread.map_base = DEFAULT_MAP_BASE; \
252 current->thread.task_size = DEFAULT_TASK_SIZE \
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#define ELF_CORE_COPY_REGS(dst, pt) \
278 memset(dst, 0, sizeof(dst)); \
279 memcpy(dst + 0, pt->gr, 32 * sizeof(elf_greg_t)); \
280 memcpy(dst + 32, pt->sr, 8 * sizeof(elf_greg_t)); \
281 memcpy(dst + 40, pt->iaoq, 2 * sizeof(elf_greg_t)); \
282 memcpy(dst + 42, pt->iasq, 2 * sizeof(elf_greg_t)); \
283 dst[44] = pt->sar; dst[45] = pt->iir; \
284 dst[46] = pt->isr; dst[47] = pt->ior; \
285 dst[48] = mfctl(22); dst[49] = mfctl(0); \
286 dst[50] = mfctl(24); dst[51] = mfctl(25); \
287 dst[52] = mfctl(26); dst[53] = mfctl(27); \
288 dst[54] = mfctl(28); dst[55] = mfctl(29); \
289 dst[56] = mfctl(30); dst[57] = mfctl(31); \
290 dst[58] = mfctl( 8); dst[59] = mfctl( 9); \
291 dst[60] = mfctl(12); dst[61] = mfctl(13); \
292 dst[62] = mfctl(10); dst[63] = mfctl(15);
293
294#endif
295
296#define ELF_NGREG 80
297
298typedef elf_greg_t elf_gregset_t[ELF_NGREG];
299
300#define ELF_NFPREG 32
301typedef double elf_fpreg_t;
302typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
303
304struct task_struct;
305
306extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
307#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
308
309struct pt_regs;
310
311
312#define elf_check_arch(x) ((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELF_CLASS)
313
314
315
316
317#define ELF_DATA ELFDATA2MSB
318#define ELF_ARCH EM_PARISC
319#define ELF_OSABI ELFOSABI_LINUX
320
321
322
323
324
325
326
327
328
329#define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0
330
331#define ELF_EXEC_PAGESIZE 4096
332
333
334
335
336
337
338
339
340
341
342
343#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x01000000)
344
345
346
347
348
349#define ELF_HWCAP 0
350
351#define STACK_RND_MASK (is_32bit_task() ? \
352 0x7ff >> (PAGE_SHIFT - 12) : \
353 0x3ffff >> (PAGE_SHIFT - 12))
354
355struct mm_struct;
356extern unsigned long arch_randomize_brk(struct mm_struct *);
357#define arch_randomize_brk arch_randomize_brk
358
359#endif
360