Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASMSPARC_ELF_H
0003 #define __ASMSPARC_ELF_H
0004 
0005 /*
0006  * ELF register definitions..
0007  */
0008 
0009 #include <asm/ptrace.h>
0010 
0011 /*
0012  * Sparc section types
0013  */
0014 #define STT_REGISTER        13
0015 
0016 /*
0017  * Sparc ELF relocation types
0018  */
0019 #define R_SPARC_NONE        0
0020 #define R_SPARC_8       1
0021 #define R_SPARC_16      2
0022 #define R_SPARC_32      3
0023 #define R_SPARC_DISP8       4
0024 #define R_SPARC_DISP16      5
0025 #define R_SPARC_DISP32      6
0026 #define R_SPARC_WDISP30     7
0027 #define R_SPARC_WDISP22     8
0028 #define R_SPARC_HI22        9
0029 #define R_SPARC_22      10
0030 #define R_SPARC_13      11
0031 #define R_SPARC_LO10        12
0032 #define R_SPARC_GOT10       13
0033 #define R_SPARC_GOT13       14
0034 #define R_SPARC_GOT22       15
0035 #define R_SPARC_PC10        16
0036 #define R_SPARC_PC22        17
0037 #define R_SPARC_WPLT30      18
0038 #define R_SPARC_COPY        19
0039 #define R_SPARC_GLOB_DAT    20
0040 #define R_SPARC_JMP_SLOT    21
0041 #define R_SPARC_RELATIVE    22
0042 #define R_SPARC_UA32        23
0043 #define R_SPARC_PLT32       24
0044 #define R_SPARC_HIPLT22     25
0045 #define R_SPARC_LOPLT10     26
0046 #define R_SPARC_PCPLT32     27
0047 #define R_SPARC_PCPLT22     28
0048 #define R_SPARC_PCPLT10     29
0049 #define R_SPARC_10      30
0050 #define R_SPARC_11      31
0051 #define R_SPARC_64      32
0052 #define R_SPARC_OLO10       33
0053 #define R_SPARC_WDISP16     40
0054 #define R_SPARC_WDISP19     41
0055 #define R_SPARC_7       43
0056 #define R_SPARC_5       44
0057 #define R_SPARC_6       45
0058 
0059 /* Bits present in AT_HWCAP, primarily for Sparc32.  */
0060 
0061 #define HWCAP_SPARC_FLUSH       1    /* CPU supports flush instruction. */
0062 #define HWCAP_SPARC_STBAR       2
0063 #define HWCAP_SPARC_SWAP        4
0064 #define HWCAP_SPARC_MULDIV      8
0065 #define HWCAP_SPARC_V9      16
0066 #define HWCAP_SPARC_ULTRA3  32
0067 
0068 #define CORE_DUMP_USE_REGSET
0069 
0070 /* Format is:
0071  *  G0 --> G7
0072  *  O0 --> O7
0073  *  L0 --> L7
0074  *  I0 --> I7
0075  *  PSR, PC, nPC, Y, WIM, TBR
0076  */
0077 typedef unsigned long elf_greg_t;
0078 #define ELF_NGREG 38
0079 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
0080 
0081 typedef struct {
0082     union {
0083         unsigned long   pr_regs[32];
0084         double      pr_dregs[16];
0085     } pr_fr;
0086     unsigned long __unused;
0087     unsigned long   pr_fsr;
0088     unsigned char   pr_qcnt;
0089     unsigned char   pr_q_entrysize;
0090     unsigned char   pr_en;
0091     unsigned int    pr_q[64];
0092 } elf_fpregset_t;
0093 
0094 #include <asm/mbus.h>
0095 
0096 /*
0097  * This is used to ensure we don't load something for the wrong architecture.
0098  */
0099 #define elf_check_arch(x) ((x)->e_machine == EM_SPARC)
0100 
0101 /*
0102  * These are used to set parameters in the core dumps.
0103  */
0104 #define ELF_ARCH    EM_SPARC
0105 #define ELF_CLASS   ELFCLASS32
0106 #define ELF_DATA    ELFDATA2MSB
0107 
0108 #define ELF_EXEC_PAGESIZE   4096
0109 
0110 
0111 /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
0112    use of this is to invoke "./ld.so someprog" to test out a new version of
0113    the loader.  We need to make sure that it is out of the way of the program
0114    that it will "exec", and that there is sufficient room for the brk.  */
0115 
0116 #define ELF_ET_DYN_BASE         (TASK_UNMAPPED_BASE)
0117 
0118 /* This yields a mask that user programs can use to figure out what
0119    instruction set this cpu supports.  This can NOT be done in userspace
0120    on Sparc.  */
0121 
0122 /* Most sun4m's have them all.  */
0123 #define ELF_HWCAP   (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
0124              HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV)
0125 
0126 /* This yields a string that ld.so will use to load implementation
0127    specific libraries for optimization.  This is more specific in
0128    intent than poking at uname or /proc/cpuinfo. */
0129 
0130 #define ELF_PLATFORM    (NULL)
0131 
0132 #endif /* !(__ASMSPARC_ELF_H) */