cleanup
[linux-2.4.21-pre4.git] / include / asm-s390 / elf.h
1 /*
2  *  include/asm-s390/elf.h
3  *
4  *  S390 version
5  *
6  *  Derived from "include/asm-i386/elf.h"
7  */
8
9 #ifndef __ASMS390_ELF_H
10 #define __ASMS390_ELF_H
11
12 /*
13  * ELF register definitions..
14  */
15
16 #include <asm/ptrace.h>
17 #include <asm/user.h>
18
19
20 typedef s390_fp_regs elf_fpregset_t;
21 typedef s390_regs elf_gregset_t;
22
23 /*
24  * These are used to set parameters in the core dumps.
25  */
26 #define ELF_CLASS       ELFCLASS32
27 #define ELF_DATA        ELFDATA2MSB
28 #define ELF_ARCH        EM_S390
29
30 /*
31  * This is used to ensure we don't load something for the wrong architecture.
32  */
33 #define elf_check_arch(x) \
34         (((x)->e_machine == EM_S390 || (x)->e_machine == EM_S390_OLD) \
35          && (x)->e_ident[EI_CLASS] == ELF_CLASS) 
36
37 /* For SVR4/S390 the function pointer to be registered with `atexit` is
38    passed in R14. */
39 #define ELF_PLAT_INIT(_r) \
40         _r->gprs[14] = 0
41
42 #define USE_ELF_CORE_DUMP
43 #define ELF_EXEC_PAGESIZE       4096
44
45 /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
46    use of this is to invoke "./ld.so someprog" to test out a new version of
47    the loader.  We need to make sure that it is out of the way of the program
48    that it will "exec", and that there is sufficient room for the brk.  */
49
50 #define ELF_ET_DYN_BASE         ((TASK_SIZE & 0x80000000) \
51                                 ? TASK_SIZE / 3 * 2 \
52                                 : 2 * TASK_SIZE / 3)
53
54 /* Wow, the "main" arch needs arch dependent functions too.. :) */
55
56 /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
57    now struct_user_regs, they are different) */
58
59 #define ELF_CORE_COPY_REGS(pr_reg, regs)        \
60         memcpy(&pr_reg,regs,sizeof(elf_gregset_t)); \
61
62
63
64 /* This yields a mask that user programs can use to figure out what
65    instruction set this CPU supports. */
66
67 #define ELF_HWCAP (0)
68
69 /* This yields a string that ld.so will use to load implementation
70    specific libraries for optimization.  This is more specific in
71    intent than poking at uname or /proc/cpuinfo.
72
73    For the moment, we have only optimizations for the Intel generations,
74    but that could change... */
75
76 #define ELF_PLATFORM (NULL)
77
78 #ifdef __KERNEL__
79 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
80 #endif
81
82 #endif