mips-linux-tdep.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /* Target-dependent code for GNU/Linux on MIPS processors.
  2. Copyright (C) 2006-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 MIPS_LINUX_TDEP_H
  15. #define MIPS_LINUX_TDEP_H
  16. /* Copied from <asm/elf.h>. */
  17. #define ELF_NGREG 45
  18. #define ELF_NFPREG 33
  19. typedef unsigned char mips_elf_greg_t[4];
  20. typedef mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG];
  21. typedef unsigned char mips_elf_fpreg_t[8];
  22. typedef mips_elf_fpreg_t mips_elf_fpregset_t[ELF_NFPREG];
  23. /* 0 - 31 are integer registers, 32 - 63 are fp registers. */
  24. #define FPR_BASE 32
  25. #define PC 64
  26. #define CAUSE 65
  27. #define BADVADDR 66
  28. #define MMHI 67
  29. #define MMLO 68
  30. #define FPC_CSR 69
  31. #define FPC_EIR 70
  32. #define DSP_BASE 71
  33. #define DSP_CONTROL 77
  34. #define EF_REG0 6
  35. #define EF_REG31 37
  36. #define EF_LO 38
  37. #define EF_HI 39
  38. #define EF_CP0_EPC 40
  39. #define EF_CP0_BADVADDR 41
  40. #define EF_CP0_STATUS 42
  41. #define EF_CP0_CAUSE 43
  42. #define EF_SIZE 180
  43. void mips_supply_gregset (struct regcache *, const mips_elf_gregset_t *);
  44. void mips_fill_gregset (const struct regcache *, mips_elf_gregset_t *, int);
  45. /* 64-bit support. */
  46. /* Copied from <asm/elf.h>. */
  47. #define MIPS64_ELF_NGREG 45
  48. #define MIPS64_ELF_NFPREG 33
  49. typedef unsigned char mips64_elf_greg_t[8];
  50. typedef mips64_elf_greg_t mips64_elf_gregset_t[MIPS64_ELF_NGREG];
  51. typedef unsigned char mips64_elf_fpreg_t[8];
  52. typedef mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG];
  53. /* 0 - 31 are integer registers, 32 - 63 are fp registers. */
  54. #define MIPS64_FPR_BASE 32
  55. #define MIPS64_PC 64
  56. #define MIPS64_CAUSE 65
  57. #define MIPS64_BADVADDR 66
  58. #define MIPS64_MMHI 67
  59. #define MIPS64_MMLO 68
  60. #define MIPS64_FPC_CSR 69
  61. #define MIPS64_FPC_EIR 70
  62. #define MIPS64_EF_REG0 0
  63. #define MIPS64_EF_REG31 31
  64. #define MIPS64_EF_LO 32
  65. #define MIPS64_EF_HI 33
  66. #define MIPS64_EF_CP0_EPC 34
  67. #define MIPS64_EF_CP0_BADVADDR 35
  68. #define MIPS64_EF_CP0_STATUS 36
  69. #define MIPS64_EF_CP0_CAUSE 37
  70. #define MIPS64_EF_SIZE 304
  71. void mips64_supply_gregset (struct regcache *, const mips64_elf_gregset_t *);
  72. void mips64_fill_gregset (const struct regcache *,
  73. mips64_elf_gregset_t *, int);
  74. void mips64_supply_fpregset (struct regcache *,
  75. const mips64_elf_fpregset_t *);
  76. void mips64_fill_fpregset (const struct regcache *,
  77. mips64_elf_fpregset_t *, int);
  78. enum {
  79. /* The Linux kernel stores an error code from any interrupted
  80. syscall in a "register" (in $0's save slot). */
  81. MIPS_RESTART_REGNUM = 79
  82. };
  83. /* Return 1 if MIPS_RESTART_REGNUM is usable. */
  84. int mips_linux_restart_reg_p (struct gdbarch *gdbarch);
  85. /* Target descriptions. */
  86. extern struct target_desc *tdesc_mips_linux;
  87. extern struct target_desc *tdesc_mips64_linux;
  88. extern struct target_desc *tdesc_mips_dsp_linux;
  89. extern struct target_desc *tdesc_mips64_dsp_linux;
  90. #endif /* MIPS_LINUX_TDEP_H */