diff options
Diffstat (limited to 'include/asm-powerpc/elf.h')
-rw-r--r-- | include/asm-powerpc/elf.h | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index 9080d85cb9d0..89664675b469 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -109,6 +109,7 @@ typedef elf_gregset_t32 compat_elf_gregset_t; | |||
109 | #ifdef __powerpc64__ | 109 | #ifdef __powerpc64__ |
110 | # define ELF_NVRREG32 33 /* includes vscr & vrsave stuffed together */ | 110 | # define ELF_NVRREG32 33 /* includes vscr & vrsave stuffed together */ |
111 | # define ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */ | 111 | # define ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */ |
112 | # define ELF_NVSRHALFREG 32 /* Half the vsx registers */ | ||
112 | # define ELF_GREG_TYPE elf_greg_t64 | 113 | # define ELF_GREG_TYPE elf_greg_t64 |
113 | #else | 114 | #else |
114 | # define ELF_NEVRREG 34 /* includes acc (as 2) */ | 115 | # define ELF_NEVRREG 34 /* includes acc (as 2) */ |
@@ -158,6 +159,7 @@ typedef __vector128 elf_vrreg_t; | |||
158 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; | 159 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; |
159 | #ifdef __powerpc64__ | 160 | #ifdef __powerpc64__ |
160 | typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; | 161 | typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; |
162 | typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG]; | ||
161 | #endif | 163 | #endif |
162 | 164 | ||
163 | #ifdef __KERNEL__ | 165 | #ifdef __KERNEL__ |
@@ -202,30 +204,8 @@ static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, | |||
202 | } | 204 | } |
203 | #define ELF_CORE_COPY_REGS(gregs, regs) ppc_elf_core_copy_regs(gregs, regs); | 205 | #define ELF_CORE_COPY_REGS(gregs, regs) ppc_elf_core_copy_regs(gregs, regs); |
204 | 206 | ||
205 | static inline int dump_task_regs(struct task_struct *tsk, | ||
206 | elf_gregset_t *elf_regs) | ||
207 | { | ||
208 | struct pt_regs *regs = tsk->thread.regs; | ||
209 | if (regs) | ||
210 | ppc_elf_core_copy_regs(*elf_regs, regs); | ||
211 | |||
212 | return 1; | ||
213 | } | ||
214 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) | ||
215 | |||
216 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | ||
217 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) | ||
218 | |||
219 | typedef elf_vrregset_t elf_fpxregset_t; | 207 | typedef elf_vrregset_t elf_fpxregset_t; |
220 | 208 | ||
221 | #ifdef CONFIG_ALTIVEC | ||
222 | extern int dump_task_altivec(struct task_struct *, elf_vrregset_t *vrregs); | ||
223 | #define ELF_CORE_COPY_XFPREGS(tsk, regs) dump_task_altivec(tsk, regs) | ||
224 | #define ELF_CORE_XFPREG_TYPE NT_PPC_VMX | ||
225 | #endif | ||
226 | |||
227 | #endif /* __KERNEL__ */ | ||
228 | |||
229 | /* ELF_HWCAP yields a mask that user programs can use to figure out what | 209 | /* ELF_HWCAP yields a mask that user programs can use to figure out what |
230 | instruction set this cpu supports. This could be done in userspace, | 210 | instruction set this cpu supports. This could be done in userspace, |
231 | but it's not easy, and we've already done it here. */ | 211 | but it's not easy, and we've already done it here. */ |
@@ -243,8 +223,6 @@ extern int dump_task_altivec(struct task_struct *, elf_vrregset_t *vrregs); | |||
243 | } while (0) | 223 | } while (0) |
244 | #endif /* __powerpc64__ */ | 224 | #endif /* __powerpc64__ */ |
245 | 225 | ||
246 | #ifdef __KERNEL__ | ||
247 | |||
248 | #ifdef __powerpc64__ | 226 | #ifdef __powerpc64__ |
249 | # define SET_PERSONALITY(ex, ibcs2) \ | 227 | # define SET_PERSONALITY(ex, ibcs2) \ |
250 | do { \ | 228 | do { \ |
@@ -257,7 +235,8 @@ do { \ | |||
257 | else \ | 235 | else \ |
258 | clear_thread_flag(TIF_ABI_PENDING); \ | 236 | clear_thread_flag(TIF_ABI_PENDING); \ |
259 | if (personality(current->personality) != PER_LINUX32) \ | 237 | if (personality(current->personality) != PER_LINUX32) \ |
260 | set_personality(PER_LINUX); \ | 238 | set_personality(PER_LINUX | \ |
239 | (current->personality & (~PER_MASK))); \ | ||
261 | } while (0) | 240 | } while (0) |
262 | /* | 241 | /* |
263 | * An executable for which elf_read_implies_exec() returns TRUE will | 242 | * An executable for which elf_read_implies_exec() returns TRUE will |
@@ -272,8 +251,6 @@ do { \ | |||
272 | # define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) | 251 | # define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) |
273 | #endif /* __powerpc64__ */ | 252 | #endif /* __powerpc64__ */ |
274 | 253 | ||
275 | #endif /* __KERNEL__ */ | ||
276 | |||
277 | extern int dcache_bsize; | 254 | extern int dcache_bsize; |
278 | extern int icache_bsize; | 255 | extern int icache_bsize; |
279 | extern int ucache_bsize; | 256 | extern int ucache_bsize; |
@@ -285,6 +262,8 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, | |||
285 | int executable_stack); | 262 | int executable_stack); |
286 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); | 263 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); |
287 | 264 | ||
265 | #endif /* __KERNEL__ */ | ||
266 | |||
288 | /* | 267 | /* |
289 | * The requirements here are: | 268 | * The requirements here are: |
290 | * - keep the final alignment of sp (sp & 0xf) | 269 | * - keep the final alignment of sp (sp & 0xf) |
@@ -422,6 +401,8 @@ do { \ | |||
422 | /* Keep this the last entry. */ | 401 | /* Keep this the last entry. */ |
423 | #define R_PPC64_NUM 107 | 402 | #define R_PPC64_NUM 107 |
424 | 403 | ||
404 | #ifdef __KERNEL__ | ||
405 | |||
425 | #ifdef CONFIG_SPU_BASE | 406 | #ifdef CONFIG_SPU_BASE |
426 | /* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */ | 407 | /* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */ |
427 | #define NT_SPU 1 | 408 | #define NT_SPU 1 |
@@ -430,4 +411,6 @@ do { \ | |||
430 | 411 | ||
431 | #endif /* CONFIG_SPU_BASE */ | 412 | #endif /* CONFIG_SPU_BASE */ |
432 | 413 | ||
414 | #endif /* __KERNEL */ | ||
415 | |||
433 | #endif /* _ASM_POWERPC_ELF_H */ | 416 | #endif /* _ASM_POWERPC_ELF_H */ |