m68k-tdep.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* Target-dependent code for the Motorola 68000 series.
  2. Copyright (C) 1990-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 M68K_TDEP_H
  15. #define M68K_TDEP_H
  16. #include "gdbarch.h"
  17. struct frame_info;
  18. /* Register numbers of various important registers. */
  19. enum m68k_regnum
  20. {
  21. M68K_D0_REGNUM = 0,
  22. M68K_D1_REGNUM = 1,
  23. M68K_D2_REGNUM = 2,
  24. M68K_D7_REGNUM = 7,
  25. M68K_A0_REGNUM = 8,
  26. M68K_A1_REGNUM = 9,
  27. M68K_A2_REGNUM = 10,
  28. M68K_FP_REGNUM = 14, /* Address of executing stack frame. */
  29. M68K_SP_REGNUM = 15, /* Address of top of stack. */
  30. M68K_PS_REGNUM = 16, /* Processor status. */
  31. M68K_PC_REGNUM = 17, /* Program counter. */
  32. M68K_FP0_REGNUM = 18, /* Floating point register 0. */
  33. M68K_FPC_REGNUM = 26, /* 68881 control register. */
  34. M68K_FPS_REGNUM = 27, /* 68881 status register. */
  35. M68K_FPI_REGNUM = 28
  36. };
  37. /* Number of machine registers. */
  38. #define M68K_NUM_REGS (M68K_FPI_REGNUM + 1)
  39. /* Size of the largest register. */
  40. #define M68K_MAX_REGISTER_SIZE 12
  41. /* Convention for returning structures. */
  42. enum struct_return
  43. {
  44. pcc_struct_return, /* Return "short" structures in memory. */
  45. reg_struct_return /* Return "short" structures in registers. */
  46. };
  47. /* Particular flavour of m68k. */
  48. enum m68k_flavour
  49. {
  50. m68k_no_flavour,
  51. m68k_coldfire_flavour,
  52. m68k_fido_flavour
  53. };
  54. /* Target-dependent structure in gdbarch. */
  55. struct m68k_gdbarch_tdep : gdbarch_tdep
  56. {
  57. /* Offset to PC value in the jump buffer. If this is negative,
  58. longjmp support will be disabled. */
  59. int jb_pc = 0;
  60. /* The size of each entry in the jump buffer. */
  61. size_t jb_elt_size = 0;
  62. /* Register in which the address to store a structure value is
  63. passed to a function. */
  64. int struct_value_regnum = 0;
  65. /* Register in which a pointer value is returned. In the SVR4 ABI,
  66. this is %a0, but in GCC's "embedded" ABI, this is %d0. */
  67. int pointer_result_regnum = 0;
  68. /* Convention for returning structures. */
  69. enum struct_return struct_return {};
  70. /* Convention for returning floats. zero in int regs, non-zero in float. */
  71. int float_return = 0;
  72. /* The particular flavour of m68k. */
  73. enum m68k_flavour flavour {};
  74. /* Flag set if the floating point registers are present, or assumed
  75. to be present. */
  76. int fpregs_present = 0;
  77. /* ISA-specific data types. */
  78. struct type *m68k_ps_type = nullptr;
  79. struct type *m68881_ext_type = nullptr;
  80. };
  81. /* Initialize a SVR4 architecture variant. */
  82. extern void m68k_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
  83. /* Functions exported from m68k-bsd-tdep.c. */
  84. extern int m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum);
  85. #endif /* m68k-tdep.h */