File: /usr/src/linux/include/asm-cris/elf.h
1 #ifndef __ASMCRIS_ELF_H
2 #define __ASMCRIS_ELF_H
3
4 /*
5 * ELF register definitions..
6 */
7
8 #include <asm/ptrace.h>
9
10 typedef unsigned long elf_greg_t;
11
12 /* These probably need fixing. */
13 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
14 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
15
16 /* A placeholder; CRIS does not have any fp regs. */
17 typedef unsigned long elf_fpregset_t;
18
19 /*
20 * This is used to ensure we don't load something for the wrong architecture.
21 */
22 #define elf_check_arch(x) ( (x)->e_machine == EM_CRIS )
23
24 /*
25 * These are used to set parameters in the core dumps.
26 */
27 #define ELF_CLASS ELFCLASS32
28 #define ELF_DATA ELFDATA2LSB;
29 #define ELF_ARCH EM_CRIS
30
31 /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program
32 starts (a register; assume first param register for CRIS)
33 contains a pointer to a function which might be
34 registered using `atexit'. This provides a mean for the
35 dynamic linker to call DT_FINI functions for shared libraries
36 that have been loaded before the code runs.
37
38 A value of 0 tells we have no such handler. */
39
40 /* Explicitly set registers to 0 to increase determinism. */
41 #define ELF_PLAT_INIT(_r) do { \
42 (_r)->r13 = 0; (_r)->r12 = 0; (_r)->r11 = 0; (_r)->r10 = 0; \
43 (_r)->r9 = 0; (_r)->r8 = 0; (_r)->r7 = 0; (_r)->r6 = 0; \
44 (_r)->r5 = 0; (_r)->r4 = 0; (_r)->r3 = 0; (_r)->r2 = 0; \
45 (_r)->r1 = 0; (_r)->r0 = 0; (_r)->mof = 0; (_r)->srp = 0; \
46 } while (0)
47
48 #undef USE_ELF_CORE_DUMP
49 #define ELF_EXEC_PAGESIZE 8192
50
51 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
52 use of this is to invoke "./ld.so someprog" to test out a new version of
53 the loader. We need to make sure that it is out of the way of the program
54 that it will "exec", and that there is sufficient room for the brk. */
55
56 #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
57
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 user space,
60 but it's not easy, and we've already done it here. */
61
62 #define ELF_HWCAP (0)
63
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.
67 */
68
69 #define ELF_PLATFORM (NULL)
70
71 #ifdef __KERNEL__
72 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
73 #endif
74
75 #endif
76