1#ifndef __PPC_ELF_H
2#define __PPC_ELF_H
3
4
5
6
7#include <asm/types.h>
8#include <asm/ptrace.h>
9#include <asm/cputable.h>
10
11#define ELF_NGREG 48
12#define ELF_NFPREG 33
13#define ELF_NVRREG 33
14
15
16
17
18#define ELF_ARCH EM_PPC
19#define ELF_CLASS ELFCLASS32
20#define ELF_DATA ELFDATA2MSB
21
22
23typedef unsigned long elf_greg_t;
24typedef elf_greg_t elf_gregset_t[ELF_NGREG];
25
26
27typedef double elf_fpreg_t;
28typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
29
30
31typedef __vector128 elf_vrreg_t;
32typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
33
34#ifdef __KERNEL__
35
36
37
38
39
40#define elf_check_arch(x) ((x)->e_machine == EM_PPC)
41
42
43
44
45
46
47#define ELF_ET_DYN_BASE (0x08000000)
48
49#define USE_ELF_CORE_DUMP
50#define ELF_EXEC_PAGESIZE 4096
51
52#define ELF_CORE_COPY_REGS(gregs, regs) \
53 memcpy(gregs, regs, \
54 sizeof(struct pt_regs) < sizeof(elf_gregset_t)? \
55 sizeof(struct pt_regs): sizeof(elf_gregset_t));
56
57
58
59
60
61
62#define ELF_HWCAP (cur_cpu_spec[0]->cpu_user_features)
63
64
65
66
67
68
69
70
71#define ELF_PLATFORM (NULL)
72
73#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
74
75
76
77
78
79#define AT_DCACHEBSIZE 19
80#define AT_ICACHEBSIZE 20
81#define AT_UCACHEBSIZE 21
82
83#define AT_IGNOREPPC 22
84
85extern int dcache_bsize;
86extern int icache_bsize;
87extern int ucache_bsize;
88
89
90
91
92
93
94
95
96
97
98#define DLINFO_ARCH_ITEMS 3
99#define ARCH_DLINFO \
100do { \
101 sp -= DLINFO_ARCH_ITEMS * 2; \
102 NEW_AUX_ENT(0, AT_DCACHEBSIZE, dcache_bsize); \
103 NEW_AUX_ENT(1, AT_ICACHEBSIZE, icache_bsize); \
104 NEW_AUX_ENT(2, AT_UCACHEBSIZE, ucache_bsize); \
105
106
107 \
108 sp -= 2*2; \
109 NEW_AUX_ENT(0, AT_IGNOREPPC, AT_IGNOREPPC); \
110 NEW_AUX_ENT(1, AT_IGNOREPPC, AT_IGNOREPPC); \
111 } while (0)
112
113#endif
114#endif
115