netlib.narod.ru< Назад | Оглавление | Далее >

include/asm-i386/elf.h

10615 #ifndef __ASMi386_ELF_H
10616 #define __ASMi386_ELF_H
10617 
10618 /* ELF register definitions.. */
10619 
10620 #include <asm/ptrace.h>
10621 #include <asm/user.h>
10622 
10623 typedef unsigned long elf_greg_t;
10624 
10625 #define ELF_NGREG \
10626   (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
10627 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
10628 
10629 typedef struct user_i387_struct elf_fpregset_t;
10630 
10631 /* This is used to ensure we don't load something for the
10632  * wrong architecture.  */
10633 #define elf_check_arch(x) \
10634   ( ((x) == EM_386) || ((x) == EM_486) )
10635 
10636 /* These are used to set parameters in the core dumps. */
10637 #define ELF_CLASS       ELFCLASS32
10638 #define ELF_DATA        ELFDATA2LSB
10639 #define ELF_ARCH        EM_386
10640 
10641 /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the
10642    program starts %edx contains a pointer to a function
10643    which might be registered using `atexit'.  This
10644    provides a mean for the dynamic linker to call DT_FINI
10645    functions for shared libraries that have been loaded
10646    before the code runs.
10647 
10648    A value of 0 tells we have no such handler. 
10649 
10650    We might as well make sure everything else is cleared
10651    too (except for %esp), just to make things more
10652    deterministic.  */
10653 #define ELF_PLAT_INIT(_r)       do { \
10654   _r->ebx = 0; _r->ecx = 0; _r->edx = 0; \
10655   _r->esi = 0; _r->edi = 0; _r->ebp = 0; \
10656   _r->eax = 0; \
10657 } while (0)
10658 
10659 #define USE_ELF_CORE_DUMP
10660 #define ELF_EXEC_PAGESIZE       4096
10661 
10662 /* This is the location that an ET_DYN program is loaded
10663    if exec'ed.  Typical use of this is to invoke "./ld.so
10664    someprog" to test out a new version of the loader.  We
10665    need to make sure that it is out of the way of the
10666    program that it will "exec", and that there is
10667    sufficient room for the brk.  */
10668 
10669 #define ELF_ET_DYN_BASE         (2 * TASK_SIZE / 3)
10670 
10671 /* Wow, the "main" arch needs arch dependent functions
10672  * too.. :) */
10673 
10674 /* regs is struct pt_regs, pr_reg is elf_gregset_t (which
10675  * is now struct_user_regs, they are different) */
10676 
10677 #define ELF_CORE_COPY_REGS(pr_reg, regs)                \
10678   pr_reg[0] = regs->ebx;                          \
10679   pr_reg[1] = regs->ecx;                          \
10680   pr_reg[2] = regs->edx;                          \
10681   pr_reg[3] = regs->esi;                          \
10682   pr_reg[4] = regs->edi;                          \
10683   pr_reg[5] = regs->ebp;                          \
10684   pr_reg[6] = regs->eax;                          \
10685   pr_reg[7] = regs->xds;                          \
10686   pr_reg[8] = regs->xes;                          \
10687   /* fake once used fs and gs selectors? */       \
10688   pr_reg[9] = regs->xds;  /* was fs and __fs */   \
10689   pr_reg[10] = regs->xds; /* was gs and __gs */   \
10690   pr_reg[11] = regs->orig_eax;                    \
10691   pr_reg[12] = regs->eip;                         \
10692   pr_reg[13] = regs->xcs;                         \
10693   pr_reg[14] = regs->eflags;                      \
10694   pr_reg[15] = regs->esp;                         \
10695   pr_reg[16] = regs->xss;
10696 
10697 /* This yields a mask that user programs can use to
10698    figure out what instruction set this CPU supports.
10699    This could be done in user space, but it's not easy,
10700    and we've already done it here.  */
10701 
10702 #define ELF_HWCAP       (boot_cpu_data.x86_capability)
10703 
10704 /* This yields a string that ld.so will use to load
10705    implementation specific libraries for optimization.
10706    This is more specific in intent than poking at uname
10707    or /proc/cpuinfo.
10708 
10709    For the moment, we have only optimizations for the
10710    Intel generations, but that could change... */
10711 
10712 #define ELF_PLATFORM  \
10713   ("i386\0i486\0i586\0i686"+((boot_cpu_data.x86-3)*5))
10714 
10715 #ifdef __KERNEL__
10716 #define SET_PERSONALITY(ex, ibcs2) \
10717   current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
10718 #endif
10719 
10720 #endif

netlib.narod.ru< Назад | Оглавление | Далее >

Сайт управляется системой uCoz