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

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

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

  1 /* $Id: elf.h,v 1.25 2000/07/12 01:27:08 davem Exp $ */
  2 #ifndef __ASM_SPARC64_ELF_H
  3 #define __ASM_SPARC64_ELF_H
  4 
  5 /*
  6  * ELF register definitions..
  7  */
  8 
  9 #include <asm/ptrace.h>
 10 #ifdef __KERNEL__
 11 #include <asm/processor.h>
 12 #endif
 13 
 14 /*
 15  * These are used to set parameters in the core dumps.
 16  */
 17 #ifndef ELF_ARCH
 18 #define ELF_ARCH                EM_SPARCV9
 19 #define ELF_CLASS               ELFCLASS64
 20 #define ELF_DATA                ELFDATA2MSB
 21 
 22 typedef unsigned long elf_greg_t;
 23 
 24 #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
 25 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 26 
 27 typedef struct {
 28         unsigned long   pr_regs[32];
 29         unsigned long   pr_fsr;
 30         unsigned long   pr_gsr;
 31         unsigned long   pr_fprs;
 32 } elf_fpregset_t;
 33 #endif
 34 
 35 /*
 36  * This is used to ensure we don't load something for the wrong architecture.
 37  */
 38 #ifndef elf_check_arch
 39 #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH)  /* Might be EM_SPARCV9 or EM_SPARC */
 40 #endif
 41 
 42 #define USE_ELF_CORE_DUMP
 43 #define ELF_EXEC_PAGESIZE       8192
 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 #ifndef ELF_ET_DYN_BASE
 51 #define ELF_ET_DYN_BASE         0x0000010000000000UL
 52 #endif
 53 
 54 
 55 /* This yields a mask that user programs can use to figure out what
 56    instruction set this cpu supports.  */
 57 
 58 /* On Ultra, we support all of the v8 capabilities. */
 59 #define ELF_HWCAP       (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
 60                          HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV | \
 61                          HWCAP_SPARC_V9)
 62 
 63 /* This yields a string that ld.so will use to load implementation
 64    specific libraries for optimization.  This is more specific in
 65    intent than poking at uname or /proc/cpuinfo.  */
 66 
 67 #define ELF_PLATFORM    (NULL)
 68 
 69 #ifdef __KERNEL__
 70 #define SET_PERSONALITY(ex, ibcs2)                      \
 71 do {    unsigned char flags = current->thread.flags;    \
 72         if ((ex).e_ident[EI_CLASS] == ELFCLASS32)       \
 73                 flags |= SPARC_FLAG_32BIT;              \
 74         else                                            \
 75                 flags &= ~SPARC_FLAG_32BIT;             \
 76         if (flags != current->thread.flags) {           \
 77                 unsigned long pgd_cache = 0UL;          \
 78                 if (flags & SPARC_FLAG_32BIT) {         \
 79                   pgd_t *pgd0 = &current->mm->pgd[0];   \
 80                   if (pgd_none (*pgd0)) {               \
 81                     pmd_t *page = get_pmd_fast();       \
 82                     if (!page)                          \
 83                       (void) get_pmd_slow(pgd0, 0);     \
 84                     else                                \
 85                       pgd_set(pgd0, page);              \
 86                   }                                     \
 87                   pgd_cache = pgd_val(*pgd0) << 11UL;   \
 88                 }                                       \
 89                 __asm__ __volatile__(                   \
 90                         "stxa\t%0, [%1] %2"             \
 91                         : /* no outputs */              \
 92                         : "r" (pgd_cache),              \
 93                           "r" (TSB_REG),                \
 94                           "i" (ASI_DMMU));              \
 95                 current->thread.flags = flags;          \
 96         }                                               \
 97                                                         \
 98         if (ibcs2)                                      \
 99                 set_personality(PER_SVR4);              \
100         else if (current->personality != PER_LINUX32)   \
101                 set_personality(PER_LINUX);             \
102 } while (0)
103 #endif
104 
105 #endif /* !(__ASM_SPARC64_ELF_H) */
106 

~ [ 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.