aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/elf.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-sparc64/elf.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-sparc64/elf.h')
-rw-r--r--include/asm-sparc64/elf.h181
1 files changed, 181 insertions, 0 deletions
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h
new file mode 100644
index 000000000000..91458118277e
--- /dev/null
+++ b/include/asm-sparc64/elf.h
@@ -0,0 +1,181 @@
1/* $Id: elf.h,v 1.32 2002/02/09 19:49:31 davem Exp $ */
2#ifndef __ASM_SPARC64_ELF_H
3#define __ASM_SPARC64_ELF_H
4
5/*
6 * ELF register definitions..
7 */
8
9#include <asm/ptrace.h>
10#ifdef __KERNEL__
11#include <asm/processor.h>
12#include <asm/uaccess.h>
13#endif
14
15/*
16 * Sparc section types
17 */
18#define STT_REGISTER 13
19
20/*
21 * Sparc ELF relocation types
22 */
23#define R_SPARC_NONE 0
24#define R_SPARC_8 1
25#define R_SPARC_16 2
26#define R_SPARC_32 3
27#define R_SPARC_DISP8 4
28#define R_SPARC_DISP16 5
29#define R_SPARC_DISP32 6
30#define R_SPARC_WDISP30 7
31#define R_SPARC_WDISP22 8
32#define R_SPARC_HI22 9
33#define R_SPARC_22 10
34#define R_SPARC_13 11
35#define R_SPARC_LO10 12
36#define R_SPARC_GOT10 13
37#define R_SPARC_GOT13 14
38#define R_SPARC_GOT22 15
39#define R_SPARC_PC10 16
40#define R_SPARC_PC22 17
41#define R_SPARC_WPLT30 18
42#define R_SPARC_COPY 19
43#define R_SPARC_GLOB_DAT 20
44#define R_SPARC_JMP_SLOT 21
45#define R_SPARC_RELATIVE 22
46#define R_SPARC_UA32 23
47#define R_SPARC_PLT32 24
48#define R_SPARC_HIPLT22 25
49#define R_SPARC_LOPLT10 26
50#define R_SPARC_PCPLT32 27
51#define R_SPARC_PCPLT22 28
52#define R_SPARC_PCPLT10 29
53#define R_SPARC_10 30
54#define R_SPARC_11 31
55#define R_SPARC_64 32
56#define R_SPARC_OLO10 33
57#define R_SPARC_WDISP16 40
58#define R_SPARC_WDISP19 41
59#define R_SPARC_7 43
60#define R_SPARC_5 44
61#define R_SPARC_6 45
62
63/* Bits present in AT_HWCAP, primarily for Sparc32. */
64
65#define HWCAP_SPARC_FLUSH 1 /* CPU supports flush instruction. */
66#define HWCAP_SPARC_STBAR 2
67#define HWCAP_SPARC_SWAP 4
68#define HWCAP_SPARC_MULDIV 8
69#define HWCAP_SPARC_V9 16
70#define HWCAP_SPARC_ULTRA3 32
71
72/*
73 * These are used to set parameters in the core dumps.
74 */
75#ifndef ELF_ARCH
76#define ELF_ARCH EM_SPARCV9
77#define ELF_CLASS ELFCLASS64
78#define ELF_DATA ELFDATA2MSB
79
80typedef unsigned long elf_greg_t;
81
82#define ELF_NGREG 36
83typedef elf_greg_t elf_gregset_t[ELF_NGREG];
84/* Format of 64-bit elf_gregset_t is:
85 * G0 --> G7
86 * O0 --> O7
87 * L0 --> L7
88 * I0 --> I7
89 * TSTATE
90 * TPC
91 * TNPC
92 * Y
93 */
94#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \
95do { unsigned long *dest = &(__elf_regs[0]); \
96 struct pt_regs *src = (__pt_regs); \
97 unsigned long __user *sp; \
98 int i; \
99 for(i = 0; i < 16; i++) \
100 dest[i] = src->u_regs[i]; \
101 /* Don't try this at home kids... */ \
102 sp = (unsigned long __user *) \
103 ((src->u_regs[14] + STACK_BIAS) \
104 & 0xfffffffffffffff8UL); \
105 for(i = 0; i < 16; i++) \
106 __get_user(dest[i+16], &sp[i]); \
107 dest[32] = src->tstate; \
108 dest[33] = src->tpc; \
109 dest[34] = src->tnpc; \
110 dest[35] = src->y; \
111} while (0);
112
113typedef struct {
114 unsigned long pr_regs[32];
115 unsigned long pr_fsr;
116 unsigned long pr_gsr;
117 unsigned long pr_fprs;
118} elf_fpregset_t;
119#endif
120
121#define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \
122 ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread_info->kregs); 1; })
123
124/*
125 * This is used to ensure we don't load something for the wrong architecture.
126 */
127#ifndef elf_check_arch
128#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) /* Might be EM_SPARCV9 or EM_SPARC */
129#endif
130
131#define USE_ELF_CORE_DUMP
132#define ELF_EXEC_PAGESIZE PAGE_SIZE
133
134/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
135 use of this is to invoke "./ld.so someprog" to test out a new version of
136 the loader. We need to make sure that it is out of the way of the program
137 that it will "exec", and that there is sufficient room for the brk. */
138
139#ifndef ELF_ET_DYN_BASE
140#define ELF_ET_DYN_BASE 0x0000010000000000UL
141#endif
142
143
144/* This yields a mask that user programs can use to figure out what
145 instruction set this cpu supports. */
146
147/* On Ultra, we support all of the v8 capabilities. */
148#define ELF_HWCAP ((HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
149 HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV | \
150 HWCAP_SPARC_V9) | \
151 ((tlb_type == cheetah || tlb_type == cheetah_plus) ? \
152 HWCAP_SPARC_ULTRA3 : 0))
153
154/* This yields a string that ld.so will use to load implementation
155 specific libraries for optimization. This is more specific in
156 intent than poking at uname or /proc/cpuinfo. */
157
158#define ELF_PLATFORM (NULL)
159
160#ifdef __KERNEL__
161#define SET_PERSONALITY(ex, ibcs2) \
162do { unsigned long new_flags = current_thread_info()->flags; \
163 new_flags &= _TIF_32BIT; \
164 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
165 new_flags |= _TIF_32BIT; \
166 else \
167 new_flags &= ~_TIF_32BIT; \
168 if ((current_thread_info()->flags & _TIF_32BIT) \
169 != new_flags) \
170 set_thread_flag(TIF_ABI_PENDING); \
171 else \
172 clear_thread_flag(TIF_ABI_PENDING); \
173 /* flush_thread will update pgd cache */ \
174 if (ibcs2) \
175 set_personality(PER_SVR4); \
176 else if (current->personality != PER_LINUX32) \
177 set_personality(PER_LINUX); \
178} while (0)
179#endif
180
181#endif /* !(__ASM_SPARC64_ELF_H) */