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 <linux/config.h>
10 #include <asm/ptrace.h>
12 #include <asm/uaccess.h>
14 /* For the most part we present code dumps in the format
17 typedef unsigned long elf_greg_t
;
19 typedef elf_greg_t elf_gregset_t
[ELF_NGREG
];
26 * PSR, PC, nPC, Y, WIM, TBR
28 #define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \
29 do { unsigned long *dest = &(__elf_regs[0]); \
30 struct pt_regs *src = (__pt_regs); \
32 memcpy(&dest[0], &src->u_regs[0], \
33 sizeof(unsigned long) * 16); \
34 /* Don't try this at home kids... */ \
36 sp = (unsigned long *) src->u_regs[14]; \
37 copy_from_user(&dest[16], sp, \
38 sizeof(unsigned long) * 16); \
40 dest[32] = src->psr; \
42 dest[34] = src->npc; \
44 dest[36] = dest[37] = 0; /* XXX */ \
45 } while(0); /* Janitors: Don't touch this colon. */
49 unsigned long pr_regs
[32];
52 unsigned long __unused
;
54 unsigned char pr_qcnt
;
55 unsigned char pr_q_entrysize
;
57 unsigned int pr_q
[64];
61 * This is used to ensure we don't load something for the wrong architecture.
63 #define elf_check_arch(x) ((x)->e_machine == EM_SPARC)
66 * These are used to set parameters in the core dumps.
68 #define ELF_ARCH EM_SPARC
69 #define ELF_CLASS ELFCLASS32
70 #define ELF_DATA ELFDATA2MSB
72 #define USE_ELF_CORE_DUMP
74 #define ELF_EXEC_PAGESIZE 4096
76 #define ELF_EXEC_PAGESIZE 8192
80 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
81 use of this is to invoke "./ld.so someprog" to test out a new version of
82 the loader. We need to make sure that it is out of the way of the program
83 that it will "exec", and that there is sufficient room for the brk. */
85 #define ELF_ET_DYN_BASE (0x08000000)
87 /* This yields a mask that user programs can use to figure out what
88 instruction set this cpu supports. This can NOT be done in userspace
91 /* Sun4c has none of the capabilities, most sun4m's have them all.
92 * XXX This is gross, set some global variable at boot time. -DaveM
94 #define ELF_HWCAP ((ARCH_SUN4C_SUN4) ? 0 : \
95 (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
97 ((srmmu_modtype != Cypress && \
98 srmmu_modtype != Cypress_vE && \
99 srmmu_modtype != Cypress_vD) ? \
100 HWCAP_SPARC_MULDIV : 0)))
102 /* This yields a string that ld.so will use to load implementation
103 specific libraries for optimization. This is more specific in
104 intent than poking at uname or /proc/cpuinfo. */
106 #define ELF_PLATFORM (NULL)
109 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
112 #endif /* !(__ASMSPARC_ELF_H) */