1 #ifndef __ASM_SH_ELF_H
2 #define __ASM_SH_ELF_H
3 
4 /*
5  * ELF register definitions..
6  */
7 
8 #include <asm/ptrace.h>
9 #include <asm/user.h>
10 
11 typedef unsigned long elf_greg_t;
12 
13 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
14 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
15 
16 typedef struct user_fpu_struct elf_fpregset_t;
17 
18 /*
19  * This is used to ensure we don't load something for the wrong architecture.
20  */
21 #define elf_check_arch(x) ( (x)->e_machine == EM_SH )
22 
23 /*
24  * These are used to set parameters in the core dumps.
25  */
26 #define ELF_CLASS	ELFCLASS32
27 #ifdef __LITTLE_ENDIAN__
28 #define ELF_DATA	ELFDATA2LSB
29 #else
30 #define ELF_DATA	ELFDATA2MSB
31 #endif
32 #define ELF_ARCH	EM_SH
33 
34 #define USE_ELF_CORE_DUMP
35 #define ELF_EXEC_PAGESIZE	4096
36 
37 /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
38    use of this is to invoke "./ld.so someprog" to test out a new version of
39    the loader.  We need to make sure that it is out of the way of the program
40    that it will "exec", and that there is sufficient room for the brk.  */
41 
42 #define ELF_ET_DYN_BASE         (2 * TASK_SIZE / 3)
43 
44 
45 #define ELF_CORE_COPY_REGS(_dest,_regs)				\
46 	memcpy((char *) &_dest, (char *) _regs,			\
47 	       sizeof(struct pt_regs));
48 
49 /* This yields a mask that user programs can use to figure out what
50    instruction set this CPU supports.  This could be done in user space,
51    but it's not easy, and we've already done it here.  */
52 
53 #define ELF_HWCAP	(0)
54 
55 /* This yields a string that ld.so will use to load implementation
56    specific libraries for optimization.  This is more specific in
57    intent than poking at uname or /proc/cpuinfo.
58 
59    For the moment, we have only optimizations for the Intel generations,
60    but that could change... */
61 
62 #define ELF_PLATFORM  (NULL)
63 
64 #define ELF_PLAT_INIT(_r, load_addr) \
65   do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
66        _r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
67        _r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
68        _r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; \
69        _r->sr = SR_FD; } while (0)
70 
71 #ifdef __KERNEL__
72 #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT)
73 #endif
74 
75 #endif /* __ASM_SH_ELF_H */
76