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