1
2#ifndef __ASM_ALPHA_ELF_H
3#define __ASM_ALPHA_ELF_H
4
5#include <asm/auxvec.h>
6#include <asm/special_insns.h>
7
8
9
10#define STO_ALPHA_NOPV 0x80
11#define STO_ALPHA_STD_GPLOAD 0x88
12
13
14
15
16#define R_ALPHA_NONE 0
17#define R_ALPHA_REFLONG 1
18#define R_ALPHA_REFQUAD 2
19#define R_ALPHA_GPREL32 3
20#define R_ALPHA_LITERAL 4
21#define R_ALPHA_LITUSE 5
22#define R_ALPHA_GPDISP 6
23#define R_ALPHA_BRADDR 7
24#define R_ALPHA_HINT 8
25#define R_ALPHA_SREL16 9
26#define R_ALPHA_SREL32 10
27#define R_ALPHA_SREL64 11
28#define R_ALPHA_GPRELHIGH 17
29#define R_ALPHA_GPRELLOW 18
30#define R_ALPHA_GPREL16 19
31#define R_ALPHA_COPY 24
32#define R_ALPHA_GLOB_DAT 25
33#define R_ALPHA_JMP_SLOT 26
34#define R_ALPHA_RELATIVE 27
35#define R_ALPHA_BRSGP 28
36#define R_ALPHA_TLSGD 29
37#define R_ALPHA_TLS_LDM 30
38#define R_ALPHA_DTPMOD64 31
39#define R_ALPHA_GOTDTPREL 32
40#define R_ALPHA_DTPREL64 33
41#define R_ALPHA_DTPRELHI 34
42#define R_ALPHA_DTPRELLO 35
43#define R_ALPHA_DTPREL16 36
44#define R_ALPHA_GOTTPREL 37
45#define R_ALPHA_TPREL64 38
46#define R_ALPHA_TPRELHI 39
47#define R_ALPHA_TPRELLO 40
48#define R_ALPHA_TPREL16 41
49
50#define SHF_ALPHA_GPREL 0x10000000
51
52
53
54#define EF_ALPHA_32BIT 1
55
56
57
58
59
60
61
62
63
64
65#define ELF_NGREG 33
66#define ELF_NFPREG 32
67
68typedef unsigned long elf_greg_t;
69typedef elf_greg_t elf_gregset_t[ELF_NGREG];
70
71typedef double elf_fpreg_t;
72typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
73
74
75
76
77#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
78
79
80
81
82#define ELF_CLASS ELFCLASS64
83#define ELF_DATA ELFDATA2LSB
84#define ELF_ARCH EM_ALPHA
85
86#define ELF_EXEC_PAGESIZE 8192
87
88
89
90
91
92
93#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)
94
95
96
97
98
99
100
101
102
103
104#define ELF_PLAT_INIT(_r, load_addr) _r->r0 = 0
105
106
107
108
109struct pt_regs;
110struct thread_info;
111struct task_struct;
112extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt,
113 struct thread_info *ti);
114#define ELF_CORE_COPY_REGS(DEST, REGS) \
115 dump_elf_thread(DEST, REGS, current_thread_info());
116
117
118
119extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task);
120#define ELF_CORE_COPY_TASK_REGS(TASK, DEST) \
121 dump_elf_task(*(DEST), TASK)
122
123
124
125extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task);
126#define ELF_CORE_COPY_FPREGS(TASK, DEST) \
127 dump_elf_task_fp(*(DEST), TASK)
128
129
130
131
132
133#define ELF_HWCAP (~amask(-1))
134
135
136
137
138
139#define ELF_PLATFORM \
140({ \
141 enum implver_enum i_ = implver(); \
142 ( i_ == IMPLVER_EV4 ? "ev4" \
143 : i_ == IMPLVER_EV5 \
144 ? (amask(AMASK_BWX) ? "ev5" : "ev56") \
145 : amask (AMASK_CIX) ? "ev6" : "ev67"); \
146})
147
148#define SET_PERSONALITY(EX) \
149 set_personality(((EX).e_flags & EF_ALPHA_32BIT) \
150 ? PER_LINUX_32BIT : PER_LINUX)
151
152extern int alpha_l1i_cacheshape;
153extern int alpha_l1d_cacheshape;
154extern int alpha_l2_cacheshape;
155extern int alpha_l3_cacheshape;
156
157
158#define ARCH_DLINFO \
159 do { \
160 NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \
161 NEW_AUX_ENT(AT_L1D_CACHESHAPE, alpha_l1d_cacheshape); \
162 NEW_AUX_ENT(AT_L2_CACHESHAPE, alpha_l2_cacheshape); \
163 NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape); \
164 } while (0)
165
166#endif
167