gdb/mips-linux-tdep.h - gdb

Data types defined

Macros defined

Source code

  1. /* Target-dependent code for GNU/Linux on MIPS processors.

  2.    Copyright (C) 2006-2015 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. /* Copied from <asm/elf.h>.  */
  15. #define ELF_NGREG       45
  16. #define ELF_NFPREG      33

  17. typedef unsigned char mips_elf_greg_t[4];
  18. typedef mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG];

  19. typedef unsigned char mips_elf_fpreg_t[8];
  20. typedef mips_elf_fpreg_t mips_elf_fpregset_t[ELF_NFPREG];

  21. /* 0 - 31 are integer registers, 32 - 63 are fp registers.  */
  22. #define FPR_BASE        32
  23. #define PC                64
  24. #define CAUSE                65
  25. #define BADVADDR        66
  26. #define MMHI                67
  27. #define MMLO                68
  28. #define FPC_CSR                69
  29. #define FPC_EIR                70
  30. #define DSP_BASE        71
  31. #define DSP_CONTROL        77

  32. #define EF_REG0                        6
  33. #define EF_REG31                37
  34. #define EF_LO                        38
  35. #define EF_HI                        39
  36. #define EF_CP0_EPC                40
  37. #define EF_CP0_BADVADDR                41
  38. #define EF_CP0_STATUS                42
  39. #define EF_CP0_CAUSE                43

  40. #define EF_SIZE                        180

  41. void mips_supply_gregset (struct regcache *, const mips_elf_gregset_t *);
  42. void mips_fill_gregset (const struct regcache *, mips_elf_gregset_t *, int);
  43. void mips_supply_fpregset (struct regcache *, const mips_elf_fpregset_t *);
  44. void mips_fill_fpregset (const struct regcache *, mips_elf_fpregset_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);