5 * ELF register definitions..
8 #include <asm/ptrace.h>
9 #include <asm/cputable.h>
11 #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */
12 #define ELF_NFPREG 33 /* includes fpscr */
13 #define ELF_NVRREG 33 /* includes vscr */
16 * These are used to set parameters in the core dumps.
18 #define ELF_ARCH EM_PPC
19 #define ELF_CLASS ELFCLASS32
20 #define ELF_DATA ELFDATA2MSB
22 /* General registers */
23 typedef unsigned long elf_greg_t;
24 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
26 /* Floating point registers */
27 typedef double elf_fpreg_t;
28 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
30 /* Altivec registers */
31 typedef __vector128 elf_vrreg_t;
32 typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
37 * This is used to ensure we don't load something for the wrong architecture.
40 #define elf_check_arch(x) ((x)->e_machine == EM_PPC)
42 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
43 use of this is to invoke "./ld.so someprog" to test out a new version of
44 the loader. We need to make sure that it is out of the way of the program
45 that it will "exec", and that there is sufficient room for the brk. */
47 #define ELF_ET_DYN_BASE (0x08000000)
49 #define USE_ELF_CORE_DUMP
50 #define ELF_EXEC_PAGESIZE 4096
52 #define ELF_CORE_COPY_REGS(gregs, regs) \
54 sizeof(struct pt_regs) < sizeof(elf_gregset_t)? \
55 sizeof(struct pt_regs): sizeof(elf_gregset_t));
58 /* This yields a mask that user programs can use to figure out what
59 instruction set this cpu supports. This could be done in userspace,
60 but it's not easy, and we've already done it here. */
62 #define ELF_HWCAP (cur_cpu_spec[0]->cpu_user_features)
64 /* This yields a string that ld.so will use to load implementation
65 specific libraries for optimization. This is more specific in
66 intent than poking at uname or /proc/cpuinfo.
68 For the moment, we have only optimizations for the Intel generations,
69 but that could change... */
71 #define ELF_PLATFORM (NULL)
73 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
76 * We need to put in some extra aux table entries to tell glibc what
77 * the cache block size is, so it can use the dcbz instruction safely.
79 #define AT_DCACHEBSIZE 19
80 #define AT_ICACHEBSIZE 20
81 #define AT_UCACHEBSIZE 21
82 /* A special ignored type value for PPC, for glibc compatibility. */
83 #define AT_IGNOREPPC 22
85 extern int dcache_bsize;
86 extern int icache_bsize;
87 extern int ucache_bsize;
90 * The requirements here are:
91 * - keep the final alignment of sp (sp & 0xf)
92 * - make sure the 32-bit value at the first 16 byte aligned position of
93 * AUXV is greater than 16 for glibc compatibility.
94 * AT_IGNOREPPC is used for that.
95 * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC,
96 * even if DLINFO_ARCH_ITEMS goes to zero or is undefined.
98 #define DLINFO_ARCH_ITEMS 3
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); \
106 * Now handle glibc compatibility. \
109 NEW_AUX_ENT(0, AT_IGNOREPPC, AT_IGNOREPPC); \
110 NEW_AUX_ENT(1, AT_IGNOREPPC, AT_IGNOREPPC); \
113 #endif /* __KERNEL__ */