elf.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Port on Texas Instruments TMS320C6x architecture
  3. *
  4. * Copyright (C) 2004, 2009, 2010 Texas Instruments Incorporated
  5. * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _ASM_C6X_ELF_H
  12. #define _ASM_C6X_ELF_H
  13. /*
  14. * ELF register definitions..
  15. */
  16. #include <asm/ptrace.h>
  17. typedef unsigned long elf_greg_t;
  18. typedef unsigned long elf_fpreg_t;
  19. #define ELF_NGREG 58
  20. #define ELF_NFPREG 1
  21. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  22. typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  23. /*
  24. * This is used to ensure we don't load something for the wrong architecture.
  25. */
  26. #define elf_check_arch(x) ((x)->e_machine == EM_TI_C6000)
  27. #define elf_check_const_displacement(x) (1)
  28. /*
  29. * These are used to set parameters in the core dumps.
  30. */
  31. #ifdef __LITTLE_ENDIAN__
  32. #define ELF_DATA ELFDATA2LSB
  33. #else
  34. #define ELF_DATA ELFDATA2MSB
  35. #endif
  36. #define ELF_CLASS ELFCLASS32
  37. #define ELF_ARCH EM_TI_C6000
  38. /* Nothing for now. Need to setup DP... */
  39. #define ELF_PLAT_INIT(_r)
  40. #define USE_ELF_CORE_DUMP
  41. #define ELF_EXEC_PAGESIZE 4096
  42. #define ELF_CORE_COPY_REGS(_dest, _regs) \
  43. memcpy((char *) &_dest, (char *) _regs, \
  44. sizeof(struct pt_regs));
  45. /* This yields a mask that user programs can use to figure out what
  46. instruction set this cpu supports. */
  47. #define ELF_HWCAP (0)
  48. /* This yields a string that ld.so will use to load implementation
  49. specific libraries for optimization. This is more specific in
  50. intent than poking at uname or /proc/cpuinfo. */
  51. #define ELF_PLATFORM (NULL)
  52. #define SET_PERSONALITY(ex) set_personality(PER_LINUX)
  53. /* C6X specific section types */
  54. #define SHT_C6000_UNWIND 0x70000001
  55. #define SHT_C6000_PREEMPTMAP 0x70000002
  56. #define SHT_C6000_ATTRIBUTES 0x70000003
  57. /* C6X specific DT_ tags */
  58. #define DT_C6000_DSBT_BASE 0x70000000
  59. #define DT_C6000_DSBT_SIZE 0x70000001
  60. #define DT_C6000_PREEMPTMAP 0x70000002
  61. #define DT_C6000_DSBT_INDEX 0x70000003
  62. /* C6X specific relocs */
  63. #define R_C6000_NONE 0
  64. #define R_C6000_ABS32 1
  65. #define R_C6000_ABS16 2
  66. #define R_C6000_ABS8 3
  67. #define R_C6000_PCR_S21 4
  68. #define R_C6000_PCR_S12 5
  69. #define R_C6000_PCR_S10 6
  70. #define R_C6000_PCR_S7 7
  71. #define R_C6000_ABS_S16 8
  72. #define R_C6000_ABS_L16 9
  73. #define R_C6000_ABS_H16 10
  74. #define R_C6000_SBR_U15_B 11
  75. #define R_C6000_SBR_U15_H 12
  76. #define R_C6000_SBR_U15_W 13
  77. #define R_C6000_SBR_S16 14
  78. #define R_C6000_SBR_L16_B 15
  79. #define R_C6000_SBR_L16_H 16
  80. #define R_C6000_SBR_L16_W 17
  81. #define R_C6000_SBR_H16_B 18
  82. #define R_C6000_SBR_H16_H 19
  83. #define R_C6000_SBR_H16_W 20
  84. #define R_C6000_SBR_GOT_U15_W 21
  85. #define R_C6000_SBR_GOT_L16_W 22
  86. #define R_C6000_SBR_GOT_H16_W 23
  87. #define R_C6000_DSBT_INDEX 24
  88. #define R_C6000_PREL31 25
  89. #define R_C6000_COPY 26
  90. #define R_C6000_ALIGN 253
  91. #define R_C6000_FPHEAD 254
  92. #define R_C6000_NOCMP 255
  93. #endif /*_ASM_C6X_ELF_H */