Merge with Linux 2.5.48.
[linux-2.6/linux-mips.git] / include / asm-sparc / elf.h
blob8323474c7fff5a18010f36075cb288b013580257
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
5 /*
6 * ELF register definitions..
7 */
9 #include <linux/config.h>
10 #include <asm/ptrace.h>
11 #include <asm/mbus.h>
12 #include <asm/uaccess.h>
14 /* For the most part we present code dumps in the format
15 * Solaris does.
17 typedef unsigned long elf_greg_t;
18 #define ELF_NGREG 38
19 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
21 /* Format is:
22 * G0 --> G7
23 * O0 --> O7
24 * L0 --> L7
25 * I0 --> I7
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); \
31 unsigned long *sp; \
32 memcpy(&dest[0], &src->u_regs[0], \
33 sizeof(unsigned long) * 16); \
34 /* Don't try this at home kids... */ \
35 set_fs(USER_DS); \
36 sp = (unsigned long *) src->u_regs[14]; \
37 copy_from_user(&dest[16], sp, \
38 sizeof(unsigned long) * 16); \
39 set_fs(KERNEL_DS); \
40 dest[32] = src->psr; \
41 dest[33] = src->pc; \
42 dest[34] = src->npc; \
43 dest[35] = src->y; \
44 dest[36] = dest[37] = 0; /* XXX */ \
45 } while(0); /* Janitors: Don't touch this colon. */
47 typedef struct {
48 union {
49 unsigned long pr_regs[32];
50 double pr_dregs[16];
51 } pr_fr;
52 unsigned long __unused;
53 unsigned long pr_fsr;
54 unsigned char pr_qcnt;
55 unsigned char pr_q_entrysize;
56 unsigned char pr_en;
57 unsigned int pr_q[64];
58 } elf_fpregset_t;
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
73 #ifndef CONFIG_SUN4
74 #define ELF_EXEC_PAGESIZE 4096
75 #else
76 #define ELF_EXEC_PAGESIZE 8192
77 #endif
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
89 on Sparc. */
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 | \
96 HWCAP_SPARC_SWAP | \
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)
108 #ifdef __KERNEL__
109 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
110 #endif
112 #endif /* !(__ASMSPARC_ELF_H) */