sh-tdep.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* Target-specific definition for a Renesas Super-H.
  2. Copyright (C) 1993-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef SH_TDEP_H
  15. #define SH_TDEP_H
  16. #include "gdbarch.h"
  17. /* Contributed by Steve Chamberlain sac@cygnus.com. */
  18. /* Registers for all SH variants. Used also by sh3-rom.c. */
  19. enum
  20. {
  21. R0_REGNUM = 0,
  22. STRUCT_RETURN_REGNUM = 2,
  23. ARG0_REGNUM = 4,
  24. ARGLAST_REGNUM = 7,
  25. FP_REGNUM = 14,
  26. PC_REGNUM = 16,
  27. PR_REGNUM = 17,
  28. GBR_REGNUM = 18,
  29. VBR_REGNUM = 19,
  30. MACH_REGNUM = 20,
  31. MACL_REGNUM = 21,
  32. SR_REGNUM = 22,
  33. FPUL_REGNUM = 23,
  34. /* Floating point registers */
  35. FPSCR_REGNUM = 24,
  36. FR0_REGNUM = 25,
  37. FLOAT_ARG0_REGNUM = 29,
  38. FLOAT_ARGLAST_REGNUM = 36,
  39. FP_LAST_REGNUM = 40,
  40. /* sh3,sh4 registers */
  41. SSR_REGNUM = 41,
  42. SPC_REGNUM = 42,
  43. /* DSP registers */
  44. DSR_REGNUM = 24,
  45. A0G_REGNUM = 25,
  46. A0_REGNUM = 26,
  47. A1G_REGNUM = 27,
  48. A1_REGNUM = 28,
  49. M0_REGNUM = 29,
  50. M1_REGNUM = 30,
  51. X0_REGNUM = 31,
  52. X1_REGNUM = 32,
  53. Y0_REGNUM = 33,
  54. Y1_REGNUM = 34,
  55. MOD_REGNUM = 40,
  56. RS_REGNUM = 43,
  57. RE_REGNUM = 44,
  58. DSP_R0_BANK_REGNUM = 51,
  59. DSP_R7_BANK_REGNUM = 58,
  60. /* sh2a register */
  61. R0_BANK0_REGNUM = 43,
  62. MACHB_REGNUM = 58,
  63. IVNB_REGNUM = 59,
  64. PRB_REGNUM = 60,
  65. GBRB_REGNUM = 61,
  66. MACLB_REGNUM = 62,
  67. BANK_REGNUM = 63,
  68. IBCR_REGNUM = 64,
  69. IBNR_REGNUM = 65,
  70. TBR_REGNUM = 66,
  71. PSEUDO_BANK_REGNUM = 67,
  72. /* Floating point pseudo registers */
  73. DR0_REGNUM = 68,
  74. DR_LAST_REGNUM = 75,
  75. FV0_REGNUM = 76,
  76. FV_LAST_REGNUM = 79
  77. };
  78. /* This structure describes a register in a core-file. */
  79. struct sh_corefile_regmap
  80. {
  81. int regnum;
  82. unsigned int offset;
  83. };
  84. struct sh_gdbarch_tdep : gdbarch_tdep
  85. {
  86. /* Non-NULL when debugging from a core file. Provides the offset
  87. where each general-purpose register is stored inside the associated
  88. core file section. */
  89. struct sh_corefile_regmap *core_gregmap = nullptr;
  90. int sizeof_gregset = 0;
  91. /* Non-NULL when debugging from a core file and when FP registers are
  92. available. Provides the offset where each FP register is stored
  93. inside the associated core file section. */
  94. struct sh_corefile_regmap *core_fpregmap = nullptr;
  95. int sizeof_fpregset = 0;
  96. /* ISA-specific data types. */
  97. struct type *sh_littlebyte_bigword_type = nullptr;
  98. };
  99. extern const struct regset sh_corefile_gregset;
  100. void sh_corefile_supply_regset (const struct regset *regset,
  101. struct regcache *regcache,
  102. int regnum, const void *regs, size_t len);
  103. void sh_corefile_collect_regset (const struct regset *regset,
  104. const struct regcache *regcache,
  105. int regnum, void *regs, size_t len);
  106. #endif /* SH_TDEP_H */