1 #ifndef __ASMPARISC_ELF_H
2 #define __ASMPARISC_ELF_H
5 * ELF register definitions..
8 #include <asm/ptrace.h>
13 * The following definitions are those for 32-bit ELF binaries on a 32-bit kernel
14 * and for 64-bit binaries on a 64-bit kernel. To run 32-bit binaries on a 64-bit
15 * kernel, arch/parisc64/kernel/binfmt_elf32.c defines these macros appropriately
16 * and then #includes binfmt_elf.c, which then includes this file.
21 * This is used to ensure we don't load something for the wrong architecture.
23 * Note that this header file is used by default in fs/binfmt_elf.c. So
24 * the following macros are for the default case. However, for the 64
25 * bit kernel we also support 32 bit parisc binaries. To do that
26 * arch/parisc64/kernel/binfmt_elf32.c defines its own set of these
27 * macros, and then it includes fs/binfmt_elf.c to provide an alternate
28 * elf binary handler for 32 bit binaries (on the 64 bit kernel).
31 #define ELF_CLASS ELFCLASS64
33 #define ELF_CLASS ELFCLASS32
36 typedef unsigned long elf_greg_t;
38 /* This yields a string that ld.so will use to load implementation
39 specific libraries for optimization. This is more specific in
40 intent than poking at uname or /proc/cpuinfo.
42 For the moment, we have only optimizations for the Intel generations,
43 but that could change... */
45 #define ELF_PLATFORM ("PARISC\0" /*+((boot_cpu_data.x86-3)*5) */)
48 #define SET_PERSONALITY(ex, ibcs2) \
49 current->personality = PER_LINUX
53 * Fill in general registers in a core dump. This saves pretty
54 * much the same registers as hp-ux, although in a different order.
55 * Registers marked # below are not currently saved in pt_regs, so
56 * we use their current values here.
67 * # cr0 (recovery counter)
68 * # cr24..cr31 (temporary registers)
69 * # cr8,9,12,13 (protection IDs)
71 * # cr15 (ext int enable mask)
75 #define ELF_CORE_COPY_REGS(dst, pt) \
76 memset(dst, 0, sizeof(dst)); /* don't leak any "random" bits */ \
77 memcpy(dst + 0, pt->gr, 32 * sizeof(elf_greg_t)); \
78 memcpy(dst + 32, pt->sr, 8 * sizeof(elf_greg_t)); \
79 memcpy(dst + 40, pt->iaoq, 2 * sizeof(elf_greg_t)); \
80 memcpy(dst + 42, pt->iasq, 2 * sizeof(elf_greg_t)); \
81 dst[44] = pt->sar; dst[45] = pt->iir; \
82 dst[46] = pt->isr; dst[47] = pt->ior; \
83 dst[48] = mfctl(22); dst[49] = mfctl(0); \
84 dst[50] = mfctl(24); dst[51] = mfctl(25); \
85 dst[52] = mfctl(26); dst[53] = mfctl(27); \
86 dst[54] = mfctl(28); dst[55] = mfctl(29); \
87 dst[56] = mfctl(30); dst[57] = mfctl(31); \
88 dst[58] = mfctl( 8); dst[59] = mfctl( 9); \
89 dst[60] = mfctl(12); dst[61] = mfctl(13); \
90 dst[62] = mfctl(10); dst[63] = mfctl(15);
92 #endif /* ! ELF_CLASS */
94 #define ELF_NGREG 80 /* We only need 64 at present, but leave space
96 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
99 typedef double elf_fpreg_t;
100 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
102 struct pt_regs; /* forward declaration... */
105 #define elf_check_arch(x) ((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELF_CLASS)
108 * These are used to set parameters in the core dumps.
110 #define ELF_DATA ELFDATA2MSB
111 #define ELF_ARCH EM_PARISC
113 /* %r23 is set by ld.so to a pointer to a function which might be
114 registered using atexit. This provides a mean for the dynamic
115 linker to call DT_FINI functions for shared libraries that have
116 been loaded before the code runs.
118 So that we can use the same startup file with static executables,
119 we start programs with a value of 0 to indicate that there is no
121 #define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0
123 #define USE_ELF_CORE_DUMP
124 #define ELF_EXEC_PAGESIZE 4096
126 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
127 use of this is to invoke "./ld.so someprog" to test out a new version of
128 the loader. We need to make sure that it is out of the way of the program
129 that it will "exec", and that there is sufficient room for the brk.
131 (2 * TASK_SIZE / 3) turns into something undefined when run through a
132 32 bit preprocessor and in some cases results in the kernel trying to map
133 ld.so to the kernel virtual base. Use a sane value instead. /Jes
136 #define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x01000000)
138 /* This yields a mask that user programs can use to figure out what
139 instruction set this CPU supports. This could be done in user space,
140 but it's not easy, and we've already done it here. */
143 /* (boot_cpu_data.x86_capability) */