xref: /netbsd-src/external/gpl3/binutils/dist/include/sim/sim-sh.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1*cb63e24eSchristos /* This file defines the interface between the sh simulator and gdb.
2*cb63e24eSchristos    Copyright (C) 2000-2024 Free Software Foundation, Inc.
3*cb63e24eSchristos 
4*cb63e24eSchristos    This file is part of GDB.
5*cb63e24eSchristos 
6*cb63e24eSchristos    This program is free software; you can redistribute it and/or modify
7*cb63e24eSchristos    it under the terms of the GNU General Public License as published by
8*cb63e24eSchristos    the Free Software Foundation; either version 3 of the License, or
9*cb63e24eSchristos    (at your option) any later version.
10*cb63e24eSchristos 
11*cb63e24eSchristos    This program is distributed in the hope that it will be useful,
12*cb63e24eSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*cb63e24eSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*cb63e24eSchristos    GNU General Public License for more details.
15*cb63e24eSchristos 
16*cb63e24eSchristos    You should have received a copy of the GNU General Public License
17*cb63e24eSchristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18*cb63e24eSchristos 
19*cb63e24eSchristos #if !defined (SIM_SH_H)
20*cb63e24eSchristos #define SIM_SH_H
21*cb63e24eSchristos 
22*cb63e24eSchristos /* The simulator makes use of the following register information. */
23*cb63e24eSchristos 
24*cb63e24eSchristos enum
25*cb63e24eSchristos {
26*cb63e24eSchristos   SIM_SH_R0_REGNUM = 0,
27*cb63e24eSchristos   SIM_SH_R1_REGNUM,
28*cb63e24eSchristos   SIM_SH_R2_REGNUM,
29*cb63e24eSchristos   SIM_SH_R3_REGNUM,
30*cb63e24eSchristos   SIM_SH_R4_REGNUM,
31*cb63e24eSchristos   SIM_SH_R5_REGNUM,
32*cb63e24eSchristos   SIM_SH_R6_REGNUM,
33*cb63e24eSchristos   SIM_SH_R7_REGNUM,
34*cb63e24eSchristos   SIM_SH_R8_REGNUM,
35*cb63e24eSchristos   SIM_SH_R9_REGNUM,
36*cb63e24eSchristos   SIM_SH_R10_REGNUM,
37*cb63e24eSchristos   SIM_SH_R11_REGNUM,
38*cb63e24eSchristos   SIM_SH_R12_REGNUM,
39*cb63e24eSchristos   SIM_SH_R13_REGNUM,
40*cb63e24eSchristos   SIM_SH_R14_REGNUM,
41*cb63e24eSchristos   SIM_SH_R15_REGNUM,
42*cb63e24eSchristos   SIM_SH_PC_REGNUM,
43*cb63e24eSchristos   SIM_SH_PR_REGNUM,
44*cb63e24eSchristos   SIM_SH_GBR_REGNUM,
45*cb63e24eSchristos   SIM_SH_VBR_REGNUM,
46*cb63e24eSchristos   SIM_SH_MACH_REGNUM,
47*cb63e24eSchristos   SIM_SH_MACL_REGNUM,
48*cb63e24eSchristos   SIM_SH_SR_REGNUM,
49*cb63e24eSchristos   SIM_SH_FPUL_REGNUM,
50*cb63e24eSchristos   SIM_SH_FPSCR_REGNUM,
51*cb63e24eSchristos   SIM_SH_FR0_REGNUM, /* FRn registers: sh3e / sh4 */
52*cb63e24eSchristos   SIM_SH_FR1_REGNUM,
53*cb63e24eSchristos   SIM_SH_FR2_REGNUM,
54*cb63e24eSchristos   SIM_SH_FR3_REGNUM,
55*cb63e24eSchristos   SIM_SH_FR4_REGNUM,
56*cb63e24eSchristos   SIM_SH_FR5_REGNUM,
57*cb63e24eSchristos   SIM_SH_FR6_REGNUM,
58*cb63e24eSchristos   SIM_SH_FR7_REGNUM,
59*cb63e24eSchristos   SIM_SH_FR8_REGNUM,
60*cb63e24eSchristos   SIM_SH_FR9_REGNUM,
61*cb63e24eSchristos   SIM_SH_FR10_REGNUM,
62*cb63e24eSchristos   SIM_SH_FR11_REGNUM,
63*cb63e24eSchristos   SIM_SH_FR12_REGNUM,
64*cb63e24eSchristos   SIM_SH_FR13_REGNUM,
65*cb63e24eSchristos   SIM_SH_FR14_REGNUM,
66*cb63e24eSchristos   SIM_SH_FR15_REGNUM,
67*cb63e24eSchristos   SIM_SH_SSR_REGNUM, /* sh3{,e,-dsp}, sh4 */
68*cb63e24eSchristos   SIM_SH_SPC_REGNUM, /* sh3{,e,-dsp}, sh4 */
69*cb63e24eSchristos   SIM_SH_R0_BANK0_REGNUM, /* SIM_SH_Rn_BANKm_REGNUM: sh3[e] / sh4 */
70*cb63e24eSchristos   SIM_SH_R1_BANK0_REGNUM,
71*cb63e24eSchristos   SIM_SH_R2_BANK0_REGNUM,
72*cb63e24eSchristos   SIM_SH_R3_BANK0_REGNUM,
73*cb63e24eSchristos   SIM_SH_R4_BANK0_REGNUM,
74*cb63e24eSchristos   SIM_SH_R5_BANK0_REGNUM,
75*cb63e24eSchristos   SIM_SH_R6_BANK0_REGNUM,
76*cb63e24eSchristos   SIM_SH_R7_BANK0_REGNUM,
77*cb63e24eSchristos   SIM_SH_R0_BANK1_REGNUM,
78*cb63e24eSchristos   SIM_SH_R1_BANK1_REGNUM,
79*cb63e24eSchristos   SIM_SH_R2_BANK1_REGNUM,
80*cb63e24eSchristos   SIM_SH_R3_BANK1_REGNUM,
81*cb63e24eSchristos   SIM_SH_R4_BANK1_REGNUM,
82*cb63e24eSchristos   SIM_SH_R5_BANK1_REGNUM,
83*cb63e24eSchristos   SIM_SH_R6_BANK1_REGNUM,
84*cb63e24eSchristos   SIM_SH_R7_BANK1_REGNUM,
85*cb63e24eSchristos   SIM_SH_XF0_REGNUM,
86*cb63e24eSchristos   SIM_SH_XF1_REGNUM,
87*cb63e24eSchristos   SIM_SH_XF2_REGNUM,
88*cb63e24eSchristos   SIM_SH_XF3_REGNUM,
89*cb63e24eSchristos   SIM_SH_XF4_REGNUM,
90*cb63e24eSchristos   SIM_SH_XF5_REGNUM,
91*cb63e24eSchristos   SIM_SH_XF6_REGNUM,
92*cb63e24eSchristos   SIM_SH_XF7_REGNUM,
93*cb63e24eSchristos   SIM_SH_XF8_REGNUM,
94*cb63e24eSchristos   SIM_SH_XF9_REGNUM,
95*cb63e24eSchristos   SIM_SH_XF10_REGNUM,
96*cb63e24eSchristos   SIM_SH_XF11_REGNUM,
97*cb63e24eSchristos   SIM_SH_XF12_REGNUM,
98*cb63e24eSchristos   SIM_SH_XF13_REGNUM,
99*cb63e24eSchristos   SIM_SH_XF14_REGNUM,
100*cb63e24eSchristos   SIM_SH_XF15_REGNUM,
101*cb63e24eSchristos   SIM_SH_SGR_REGNUM,
102*cb63e24eSchristos   SIM_SH_DBR_REGNUM,
103*cb63e24eSchristos   SIM_SH4_NUM_REGS, /* 77 */
104*cb63e24eSchristos 
105*cb63e24eSchristos   /* sh[3]-dsp */
106*cb63e24eSchristos   SIM_SH_DSR_REGNUM,
107*cb63e24eSchristos   SIM_SH_A0G_REGNUM,
108*cb63e24eSchristos   SIM_SH_A0_REGNUM,
109*cb63e24eSchristos   SIM_SH_A1G_REGNUM,
110*cb63e24eSchristos   SIM_SH_A1_REGNUM,
111*cb63e24eSchristos   SIM_SH_M0_REGNUM,
112*cb63e24eSchristos   SIM_SH_M1_REGNUM,
113*cb63e24eSchristos   SIM_SH_X0_REGNUM,
114*cb63e24eSchristos   SIM_SH_X1_REGNUM,
115*cb63e24eSchristos   SIM_SH_Y0_REGNUM,
116*cb63e24eSchristos   SIM_SH_Y1_REGNUM,
117*cb63e24eSchristos   SIM_SH_MOD_REGNUM,
118*cb63e24eSchristos   SIM_SH_RS_REGNUM,
119*cb63e24eSchristos   SIM_SH_RE_REGNUM,
120*cb63e24eSchristos   SIM_SH_R0_BANK_REGNUM,
121*cb63e24eSchristos   SIM_SH_R1_BANK_REGNUM,
122*cb63e24eSchristos   SIM_SH_R2_BANK_REGNUM,
123*cb63e24eSchristos   SIM_SH_R3_BANK_REGNUM,
124*cb63e24eSchristos   SIM_SH_R4_BANK_REGNUM,
125*cb63e24eSchristos   SIM_SH_R5_BANK_REGNUM,
126*cb63e24eSchristos   SIM_SH_R6_BANK_REGNUM,
127*cb63e24eSchristos   SIM_SH_R7_BANK_REGNUM,
128*cb63e24eSchristos   /* 109..127: room for expansion.  */
129*cb63e24eSchristos   SIM_SH_TBR_REGNUM,
130*cb63e24eSchristos   SIM_SH_IBNR_REGNUM,
131*cb63e24eSchristos   SIM_SH_IBCR_REGNUM,
132*cb63e24eSchristos   SIM_SH_BANK_REGNUM,
133*cb63e24eSchristos   SIM_SH_BANK_MACL_REGNUM,
134*cb63e24eSchristos   SIM_SH_BANK_GBR_REGNUM,
135*cb63e24eSchristos   SIM_SH_BANK_PR_REGNUM,
136*cb63e24eSchristos   SIM_SH_BANK_IVN_REGNUM,
137*cb63e24eSchristos   SIM_SH_BANK_MACH_REGNUM
138*cb63e24eSchristos };
139*cb63e24eSchristos 
140*cb63e24eSchristos enum
141*cb63e24eSchristos {
142*cb63e24eSchristos   SIM_SH64_R0_REGNUM = 0,
143*cb63e24eSchristos   SIM_SH64_SP_REGNUM = 15,
144*cb63e24eSchristos   SIM_SH64_PC_REGNUM = 64,
145*cb63e24eSchristos   SIM_SH64_SR_REGNUM = 65,
146*cb63e24eSchristos   SIM_SH64_SSR_REGNUM = 66,
147*cb63e24eSchristos   SIM_SH64_SPC_REGNUM = 67,
148*cb63e24eSchristos   SIM_SH64_TR0_REGNUM = 68,
149*cb63e24eSchristos   SIM_SH64_FPCSR_REGNUM = 76,
150*cb63e24eSchristos   SIM_SH64_FR0_REGNUM = 77
151*cb63e24eSchristos };
152*cb63e24eSchristos 
153*cb63e24eSchristos enum
154*cb63e24eSchristos {
155*cb63e24eSchristos   SIM_SH64_NR_REGS = 141,  /* total number of architectural registers */
156*cb63e24eSchristos   SIM_SH64_NR_R_REGS = 64, /* number of general registers */
157*cb63e24eSchristos   SIM_SH64_NR_TR_REGS = 8, /* number of target registers */
158*cb63e24eSchristos   SIM_SH64_NR_FP_REGS = 64 /* number of floating point registers */
159*cb63e24eSchristos };
160*cb63e24eSchristos 
161*cb63e24eSchristos #endif
162