elf_32.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #ifndef __ASMSPARC_ELF_H
  2. #define __ASMSPARC_ELF_H
  3. /*
  4. * ELF register definitions..
  5. */
  6. #include <asm/ptrace.h>
  7. /*
  8. * Sparc section types
  9. */
  10. #define STT_REGISTER 13
  11. /*
  12. * Sparc ELF relocation types
  13. */
  14. #define R_SPARC_NONE 0
  15. #define R_SPARC_8 1
  16. #define R_SPARC_16 2
  17. #define R_SPARC_32 3
  18. #define R_SPARC_DISP8 4
  19. #define R_SPARC_DISP16 5
  20. #define R_SPARC_DISP32 6
  21. #define R_SPARC_WDISP30 7
  22. #define R_SPARC_WDISP22 8
  23. #define R_SPARC_HI22 9
  24. #define R_SPARC_22 10
  25. #define R_SPARC_13 11
  26. #define R_SPARC_LO10 12
  27. #define R_SPARC_GOT10 13
  28. #define R_SPARC_GOT13 14
  29. #define R_SPARC_GOT22 15
  30. #define R_SPARC_PC10 16
  31. #define R_SPARC_PC22 17
  32. #define R_SPARC_WPLT30 18
  33. #define R_SPARC_COPY 19
  34. #define R_SPARC_GLOB_DAT 20
  35. #define R_SPARC_JMP_SLOT 21
  36. #define R_SPARC_RELATIVE 22
  37. #define R_SPARC_UA32 23
  38. #define R_SPARC_PLT32 24
  39. #define R_SPARC_HIPLT22 25
  40. #define R_SPARC_LOPLT10 26
  41. #define R_SPARC_PCPLT32 27
  42. #define R_SPARC_PCPLT22 28
  43. #define R_SPARC_PCPLT10 29
  44. #define R_SPARC_10 30
  45. #define R_SPARC_11 31
  46. #define R_SPARC_64 32
  47. #define R_SPARC_OLO10 33
  48. #define R_SPARC_WDISP16 40
  49. #define R_SPARC_WDISP19 41
  50. #define R_SPARC_7 43
  51. #define R_SPARC_5 44
  52. #define R_SPARC_6 45
  53. /* Bits present in AT_HWCAP, primarily for Sparc32. */
  54. #define HWCAP_SPARC_FLUSH 1 /* CPU supports flush instruction. */
  55. #define HWCAP_SPARC_STBAR 2
  56. #define HWCAP_SPARC_SWAP 4
  57. #define HWCAP_SPARC_MULDIV 8
  58. #define HWCAP_SPARC_V9 16
  59. #define HWCAP_SPARC_ULTRA3 32
  60. #define CORE_DUMP_USE_REGSET
  61. /* Format is:
  62. * G0 --> G7
  63. * O0 --> O7
  64. * L0 --> L7
  65. * I0 --> I7
  66. * PSR, PC, nPC, Y, WIM, TBR
  67. */
  68. typedef unsigned long elf_greg_t;
  69. #define ELF_NGREG 38
  70. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  71. typedef struct {
  72. union {
  73. unsigned long pr_regs[32];
  74. double pr_dregs[16];
  75. } pr_fr;
  76. unsigned long __unused;
  77. unsigned long pr_fsr;
  78. unsigned char pr_qcnt;
  79. unsigned char pr_q_entrysize;
  80. unsigned char pr_en;
  81. unsigned int pr_q[64];
  82. } elf_fpregset_t;
  83. #include <asm/mbus.h>
  84. /*
  85. * This is used to ensure we don't load something for the wrong architecture.
  86. */
  87. #define elf_check_arch(x) ((x)->e_machine == EM_SPARC)
  88. /*
  89. * These are used to set parameters in the core dumps.
  90. */
  91. #define ELF_ARCH EM_SPARC
  92. #define ELF_CLASS ELFCLASS32
  93. #define ELF_DATA ELFDATA2MSB
  94. #define USE_ELF_CORE_DUMP
  95. #define ELF_EXEC_PAGESIZE 4096
  96. /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
  97. use of this is to invoke "./ld.so someprog" to test out a new version of
  98. the loader. We need to make sure that it is out of the way of the program
  99. that it will "exec", and that there is sufficient room for the brk. */
  100. #define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE)
  101. /* This yields a mask that user programs can use to figure out what
  102. instruction set this cpu supports. This can NOT be done in userspace
  103. on Sparc. */
  104. /* Sun4c has none of the capabilities, most sun4m's have them all.
  105. * XXX This is gross, set some global variable at boot time. -DaveM
  106. */
  107. #define ELF_HWCAP ((ARCH_SUN4C) ? 0 : \
  108. (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \
  109. HWCAP_SPARC_SWAP | \
  110. ((srmmu_modtype != Cypress && \
  111. srmmu_modtype != Cypress_vE && \
  112. srmmu_modtype != Cypress_vD) ? \
  113. HWCAP_SPARC_MULDIV : 0)))
  114. /* This yields a string that ld.so will use to load implementation
  115. specific libraries for optimization. This is more specific in
  116. intent than poking at uname or /proc/cpuinfo. */
  117. #define ELF_PLATFORM (NULL)
  118. #define SET_PERSONALITY(ex) set_personality(PER_LINUX)
  119. #endif /* !(__ASMSPARC_ELF_H) */