1 /* $Id: elf.h,v 1.22 2000/07/12 01:27:08 davem Exp $ */
2 #ifndef __ASMSPARC_ELF_H
3 #define __ASMSPARC_ELF_H
6 * ELF register definitions..
9 #include <asm/ptrace.h>
14 #define STT_REGISTER 13
17 * Sparc ELF relocation types
19 #define R_SPARC_NONE 0
23 #define R_SPARC_DISP8 4
24 #define R_SPARC_DISP16 5
25 #define R_SPARC_DISP32 6
26 #define R_SPARC_WDISP30 7
27 #define R_SPARC_WDISP22 8
28 #define R_SPARC_HI22 9
31 #define R_SPARC_LO10 12
32 #define R_SPARC_GOT10 13
33 #define R_SPARC_GOT13 14
34 #define R_SPARC_GOT22 15
35 #define R_SPARC_PC10 16
36 #define R_SPARC_PC22 17
37 #define R_SPARC_WPLT30 18
38 #define R_SPARC_COPY 19
39 #define R_SPARC_GLOB_DAT 20
40 #define R_SPARC_JMP_SLOT 21
41 #define R_SPARC_RELATIVE 22
42 #define R_SPARC_UA32 23
43 #define R_SPARC_PLT32 24
44 #define R_SPARC_HIPLT22 25
45 #define R_SPARC_LOPLT10 26
46 #define R_SPARC_PCPLT32 27
47 #define R_SPARC_PCPLT22 28
48 #define R_SPARC_PCPLT10 29
52 #define R_SPARC_OLO10 33
53 #define R_SPARC_WDISP16 40
54 #define R_SPARC_WDISP19 41
59 /* Bits present in AT_HWCAP, primarily for Sparc32. */
61 #define HWCAP_SPARC_FLUSH 1 /* CPU supports flush instruction. */
62 #define HWCAP_SPARC_STBAR 2
63 #define HWCAP_SPARC_SWAP 4
64 #define HWCAP_SPARC_MULDIV 8
65 #define HWCAP_SPARC_V9 16
66 #define HWCAP_SPARC_ULTRA3 32
68 #define CORE_DUMP_USE_REGSET
75 * PSR, PC, nPC, Y, WIM, TBR
77 typedef unsigned long elf_greg_t
;
79 typedef elf_greg_t elf_gregset_t
[ELF_NGREG
];
83 unsigned long pr_regs
[32];
86 unsigned long __unused
;
88 unsigned char pr_qcnt
;
89 unsigned char pr_q_entrysize
;
91 unsigned int pr_q
[64];
97 * This is used to ensure we don't load something for the wrong architecture.
99 #define elf_check_arch(x) ((x)->e_machine == EM_SPARC)
102 * These are used to set parameters in the core dumps.
104 #define ELF_ARCH EM_SPARC
105 #define ELF_CLASS ELFCLASS32
106 #define ELF_DATA ELFDATA2MSB
108 #define USE_ELF_CORE_DUMP
110 #define ELF_EXEC_PAGESIZE 4096
112 #define ELF_EXEC_PAGESIZE 8192
116 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
117 use of this is to invoke "./ld.so someprog" to test out a new version of
118 the loader. We need to make sure that it is out of the way of the program
119 that it will "exec", and that there is sufficient room for the brk. */
121 #define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE)
123 /* This yields a mask that user programs can use to figure out what
124 instruction set this cpu supports. This can NOT be done in userspace
127 /* Sun4c has none of the capabilities, most sun4m's have them all.
128 * XXX This is gross, set some global variable at boot time. -DaveM
130 #define ELF_HWCAP ((ARCH_SUN4C_SUN4) ? 0 : \
131 (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
133 ((srmmu_modtype != Cypress && \
134 srmmu_modtype != Cypress_vE && \
135 srmmu_modtype != Cypress_vD) ? \
136 HWCAP_SPARC_MULDIV : 0)))
138 /* This yields a string that ld.so will use to load implementation
139 specific libraries for optimization. This is more specific in
140 intent than poking at uname or /proc/cpuinfo. */
142 #define ELF_PLATFORM (NULL)
144 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
146 #endif /* !(__ASMSPARC_ELF_H) */