The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/asm-alpha/elf.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef __ASM_ALPHA_ELF_H
    2 #define __ASM_ALPHA_ELF_H
    3 
    4 /*
    5  * ELF register definitions..
    6  */
    7 
    8 /*
    9  * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
   10  * I have no idea why that is so.  For now, we just leave it at 33
   11  * (32 general regs + processor status word). 
   12  */
   13 #define ELF_NGREG       33
   14 #define ELF_NFPREG      32
   15 
   16 typedef unsigned long elf_greg_t;
   17 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
   18 
   19 typedef double elf_fpreg_t;
   20 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
   21 
   22 /*
   23  * This is used to ensure we don't load something for the wrong architecture.
   24  */
   25 #define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
   26 
   27 /*
   28  * These are used to set parameters in the core dumps.
   29  */
   30 #define ELF_CLASS       ELFCLASS64
   31 #define ELF_DATA        ELFDATA2LSB
   32 #define ELF_ARCH        EM_ALPHA
   33 
   34 #define USE_ELF_CORE_DUMP
   35 #define ELF_EXEC_PAGESIZE       8192
   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         (TASK_UNMAPPED_BASE + 0x1000000)
   43 
   44 /* $0 is set by ld.so to a pointer to a function which might be 
   45    registered using atexit.  This provides a mean for the dynamic
   46    linker to call DT_FINI functions for shared libraries that have
   47    been loaded before the code runs.
   48 
   49    So that we can use the same startup file with static executables,
   50    we start programs with a value of 0 to indicate that there is no
   51    such function.  */
   52 
   53 #define ELF_PLAT_INIT(_r)       _r->r0 = 0
   54 
   55 #ifdef __KERNEL__
   56 /* The registers are layed out in pt_regs for PAL and syscall
   57    convenience.  Re-order them for the linear elf_gregset_t.  */
   58 
   59 extern void dump_elf_thread(elf_greg_t *, struct pt_regs *,
   60                             struct task_struct *);
   61 #define ELF_CORE_COPY_REGS(DEST, REGS) \
   62         dump_elf_thread(DEST, REGS, current);
   63 #endif /* __KERNEL__ */
   64 
   65 /* This yields a mask that user programs can use to figure out what
   66    instruction set this CPU supports.  This is trivial on Alpha, 
   67    but not so on other machines. */
   68 
   69 #define ELF_HWCAP                                                       \
   70 ({                                                                      \
   71         /* Sadly, most folks don't yet have assemblers that know about  \
   72            amask.  This is "amask v0, v0" */                            \
   73         register long _v0 __asm("$0") = -1;                             \
   74         __asm(".long 0x47e00c20" : "=r"(_v0) : ""(_v0));               \
   75         ~_v0;                                                           \
   76 })
   77 
   78 /* This yields a string that ld.so will use to load implementation
   79    specific libraries for optimization.  This is more specific in
   80    intent than poking at uname or /proc/cpuinfo.  
   81 
   82    This might do with checking bwx simultaneously...  */
   83 
   84 #define ELF_PLATFORM                            \
   85 ({                                              \
   86         /* Or "implver v0" ... */               \
   87         register long _v0 __asm("$0");          \
   88         __asm(".long 0x47e03d80" : "=r"(_v0));  \
   89         _v0 == 0 ? "ev4" : "ev5";               \
   90 })
   91 
   92 #ifdef __KERNEL__
   93 #define SET_PERSONALITY(EX, IBCS2)                              \
   94         set_personality(((EX).e_flags & EF_ALPHA_32BIT)         \
   95            ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
   96 #endif
   97 
   98 #endif

Cache object: fd7e1f280cdfb1e3834713b9bdd7c4ce


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.