~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/asm-mips/elf.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  */
  6 #ifndef __ASM_ELF_H
  7 #define __ASM_ELF_H
  8 
  9 /* ELF register definitions */
 10 #define ELF_NGREG       45
 11 #define ELF_NFPREG      33
 12 
 13 typedef unsigned long elf_greg_t;
 14 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 15 
 16 typedef double elf_fpreg_t;
 17 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 18 
 19 /*
 20  * This is used to ensure we don't load something for the wrong architecture
 21  * and also rejects IRIX binaries.
 22  */
 23 #define elf_check_arch(hdr)                                             \
 24 ({                                                                      \
 25         int __res = 1;                                                  \
 26         struct elfhdr *__h = (hdr);                                     \
 27                                                                         \
 28         if ((__h->e_machine != EM_MIPS) &&                              \
 29             (__h->e_machine != EM_MIPS_RS4_BE))                         \
 30                 __res = 0;                                              \
 31         if (__h->e_flags & EF_MIPS_ARCH)                                \
 32                 __res = 0;                                              \
 33                                                                         \
 34         __res;                                                          \
 35 })
 36 
 37 /* This one accepts IRIX binaries.  */
 38 #define irix_elf_check_arch(hdr)                                        \
 39 ({                                                                      \
 40         int __res = 1;                                                  \
 41         struct elfhdr *__h = (hdr);                                     \
 42                                                                         \
 43         if ((__h->e_machine != EM_MIPS) &&                              \
 44             (__h->e_machine != EM_MIPS_RS4_BE))                         \
 45                 __res = 0;                                              \
 46                                                                         \
 47         __res;                                                          \
 48 })
 49 
 50 /*
 51  * These are used to set parameters in the core dumps.
 52  */
 53 #define ELF_CLASS       ELFCLASS32
 54 #ifdef __MIPSEB__
 55 #define ELF_DATA        ELFDATA2MSB
 56 #elif __MIPSEL__
 57 #define ELF_DATA        ELFDATA2LSB
 58 #endif
 59 #define ELF_ARCH        EM_MIPS
 60 
 61 #define USE_ELF_CORE_DUMP
 62 #define ELF_EXEC_PAGESIZE       4096
 63 
 64 #define ELF_CORE_COPY_REGS(_dest,_regs)                         \
 65         memcpy((char *) &_dest, (char *) _regs,                 \
 66                sizeof(struct pt_regs));
 67 
 68 /* This yields a mask that user programs can use to figure out what
 69    instruction set this cpu supports.  This could be done in userspace,
 70    but it's not easy, and we've already done it here.  */
 71 
 72 #define ELF_HWCAP       (0)
 73 
 74 /* This yields a string that ld.so will use to load implementation
 75    specific libraries for optimization.  This is more specific in
 76    intent than poking at uname or /proc/cpuinfo.
 77 
 78    For the moment, we have only optimizations for the Intel generations,
 79    but that could change... */
 80 
 81 #define ELF_PLATFORM  (NULL)
 82 
 83 /*
 84  * See comments in asm-alpha/elf.h, this is the same thing
 85  * on the MIPS.
 86  */
 87 #define ELF_PLAT_INIT(_r)       do { \
 88         _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0;      \
 89         _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0;      \
 90         _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0;   \
 91         _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0;  \
 92         _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0;  \
 93         _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0;  \
 94         _r->regs[25] = _r->regs[26] = _r->regs[27] = _r->regs[28] = 0;  \
 95         _r->regs[30] = _r->regs[31] = 0;                                \
 96 } while (0)
 97 
 98 /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
 99    use of this is to invoke "./ld.so someprog" to test out a new version of
100    the loader.  We need to make sure that it is out of the way of the program
101    that it will "exec", and that there is sufficient room for the brk.  */
102 
103 #define ELF_ET_DYN_BASE         (2 * TASK_SIZE / 3)
104 
105 #ifdef __KERNEL__
106 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
107 #endif
108 
109 #endif /* __ASM_ELF_H */
110 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.