1 /* Target-dependent code for GDB, the GNU debugger.
2 Copyright (C) 2003-2015 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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/>. */
22 /* Hardware capabilities. */
24 #ifndef HWCAP_S390_HIGH_GPRS
25 #define HWCAP_S390_HIGH_GPRS 512
29 #define HWCAP_S390_TE 1024
33 #define HWCAP_S390_VX 2048
36 /* Register information. */
38 /* Program Status Word. */
39 #define S390_PSWM_REGNUM 0
40 #define S390_PSWA_REGNUM 1
41 /* General Purpose Registers. */
42 #define S390_R0_REGNUM 2
43 #define S390_R1_REGNUM 3
44 #define S390_R2_REGNUM 4
45 #define S390_R3_REGNUM 5
46 #define S390_R4_REGNUM 6
47 #define S390_R5_REGNUM 7
48 #define S390_R6_REGNUM 8
49 #define S390_R7_REGNUM 9
50 #define S390_R8_REGNUM 10
51 #define S390_R9_REGNUM 11
52 #define S390_R10_REGNUM 12
53 #define S390_R11_REGNUM 13
54 #define S390_R12_REGNUM 14
55 #define S390_R13_REGNUM 15
56 #define S390_R14_REGNUM 16
57 #define S390_R15_REGNUM 17
58 /* Access Registers. */
59 #define S390_A0_REGNUM 18
60 #define S390_A1_REGNUM 19
61 #define S390_A2_REGNUM 20
62 #define S390_A3_REGNUM 21
63 #define S390_A4_REGNUM 22
64 #define S390_A5_REGNUM 23
65 #define S390_A6_REGNUM 24
66 #define S390_A7_REGNUM 25
67 #define S390_A8_REGNUM 26
68 #define S390_A9_REGNUM 27
69 #define S390_A10_REGNUM 28
70 #define S390_A11_REGNUM 29
71 #define S390_A12_REGNUM 30
72 #define S390_A13_REGNUM 31
73 #define S390_A14_REGNUM 32
74 #define S390_A15_REGNUM 33
75 /* Floating Point Control Word. */
76 #define S390_FPC_REGNUM 34
77 /* Floating Point Registers. */
78 #define S390_F0_REGNUM 35
79 #define S390_F1_REGNUM 36
80 #define S390_F2_REGNUM 37
81 #define S390_F3_REGNUM 38
82 #define S390_F4_REGNUM 39
83 #define S390_F5_REGNUM 40
84 #define S390_F6_REGNUM 41
85 #define S390_F7_REGNUM 42
86 #define S390_F8_REGNUM 43
87 #define S390_F9_REGNUM 44
88 #define S390_F10_REGNUM 45
89 #define S390_F11_REGNUM 46
90 #define S390_F12_REGNUM 47
91 #define S390_F13_REGNUM 48
92 #define S390_F14_REGNUM 49
93 #define S390_F15_REGNUM 50
94 /* General Purpose Register Upper Halves. */
95 #define S390_R0_UPPER_REGNUM 51
96 #define S390_R1_UPPER_REGNUM 52
97 #define S390_R2_UPPER_REGNUM 53
98 #define S390_R3_UPPER_REGNUM 54
99 #define S390_R4_UPPER_REGNUM 55
100 #define S390_R5_UPPER_REGNUM 56
101 #define S390_R6_UPPER_REGNUM 57
102 #define S390_R7_UPPER_REGNUM 58
103 #define S390_R8_UPPER_REGNUM 59
104 #define S390_R9_UPPER_REGNUM 60
105 #define S390_R10_UPPER_REGNUM 61
106 #define S390_R11_UPPER_REGNUM 62
107 #define S390_R12_UPPER_REGNUM 63
108 #define S390_R13_UPPER_REGNUM 64
109 #define S390_R14_UPPER_REGNUM 65
110 #define S390_R15_UPPER_REGNUM 66
111 /* GNU/Linux-specific optional registers. */
112 #define S390_ORIG_R2_REGNUM 67
113 #define S390_LAST_BREAK_REGNUM 68
114 #define S390_SYSTEM_CALL_REGNUM 69
115 /* Transaction diagnostic block. */
116 #define S390_TDB_DWORD0_REGNUM 70
117 #define S390_TDB_ABORT_CODE_REGNUM 71
118 #define S390_TDB_CONFLICT_TOKEN_REGNUM 72
119 #define S390_TDB_ATIA_REGNUM 73
120 #define S390_TDB_R0_REGNUM 74
121 #define S390_TDB_R1_REGNUM 75
122 #define S390_TDB_R2_REGNUM 76
123 #define S390_TDB_R3_REGNUM 77
124 #define S390_TDB_R4_REGNUM 78
125 #define S390_TDB_R5_REGNUM 79
126 #define S390_TDB_R6_REGNUM 80
127 #define S390_TDB_R7_REGNUM 81
128 #define S390_TDB_R8_REGNUM 82
129 #define S390_TDB_R9_REGNUM 83
130 #define S390_TDB_R10_REGNUM 84
131 #define S390_TDB_R11_REGNUM 85
132 #define S390_TDB_R12_REGNUM 86
133 #define S390_TDB_R13_REGNUM 87
134 #define S390_TDB_R14_REGNUM 88
135 #define S390_TDB_R15_REGNUM 89
136 /* Vector registers. */
137 #define S390_V0_LOWER_REGNUM 90
138 #define S390_V1_LOWER_REGNUM 91
139 #define S390_V2_LOWER_REGNUM 92
140 #define S390_V3_LOWER_REGNUM 93
141 #define S390_V4_LOWER_REGNUM 94
142 #define S390_V5_LOWER_REGNUM 95
143 #define S390_V6_LOWER_REGNUM 96
144 #define S390_V7_LOWER_REGNUM 97
145 #define S390_V8_LOWER_REGNUM 98
146 #define S390_V9_LOWER_REGNUM 99
147 #define S390_V10_LOWER_REGNUM 100
148 #define S390_V11_LOWER_REGNUM 101
149 #define S390_V12_LOWER_REGNUM 102
150 #define S390_V13_LOWER_REGNUM 103
151 #define S390_V14_LOWER_REGNUM 104
152 #define S390_V15_LOWER_REGNUM 105
153 #define S390_V16_REGNUM 106
154 #define S390_V17_REGNUM 107
155 #define S390_V18_REGNUM 108
156 #define S390_V19_REGNUM 109
157 #define S390_V20_REGNUM 110
158 #define S390_V21_REGNUM 111
159 #define S390_V22_REGNUM 112
160 #define S390_V23_REGNUM 113
161 #define S390_V24_REGNUM 114
162 #define S390_V25_REGNUM 115
163 #define S390_V26_REGNUM 116
164 #define S390_V27_REGNUM 117
165 #define S390_V28_REGNUM 118
166 #define S390_V29_REGNUM 119
167 #define S390_V30_REGNUM 120
168 #define S390_V31_REGNUM 121
170 #define S390_NUM_REGS 122
172 /* Special register usage. */
173 #define S390_SP_REGNUM S390_R15_REGNUM
174 #define S390_RETADDR_REGNUM S390_R14_REGNUM
175 #define S390_FRAME_REGNUM S390_R11_REGNUM
177 #define S390_IS_GREGSET_REGNUM(i) \
178 (((i) >= S390_PSWM_REGNUM && (i) <= S390_A15_REGNUM) \
179 || ((i) >= S390_R0_UPPER_REGNUM && (i) <= S390_R15_UPPER_REGNUM) \
180 || (i) == S390_ORIG_R2_REGNUM)
182 #define S390_IS_FPREGSET_REGNUM(i) \
183 ((i) >= S390_FPC_REGNUM && (i) <= S390_F15_REGNUM)
185 #define S390_IS_TDBREGSET_REGNUM(i) \
186 ((i) >= S390_TDB_DWORD0_REGNUM && (i) <= S390_TDB_R15_REGNUM)
188 /* Core file register sets, defined in s390-tdep.c. */
189 #define s390_sizeof_gregset 0x90
190 #define s390x_sizeof_gregset 0xd8
191 extern const struct regset s390_gregset;
192 #define s390_sizeof_fpregset 0x88
193 extern const struct regset s390_fpregset;
194 extern const struct regset s390_last_break_regset;
195 extern const struct regset s390x_last_break_regset;
196 extern const struct regset s390_system_call_regset;
197 extern const struct regset s390_tdb_regset;
198 #define s390_sizeof_tdbregset 0x100
199 extern const struct regset s390_vxrs_low_regset;
200 extern const struct regset s390_vxrs_high_regset;
202 /* GNU/Linux target descriptions. */
203 extern struct target_desc *tdesc_s390_linux32;
204 extern struct target_desc *tdesc_s390_linux32v1;
205 extern struct target_desc *tdesc_s390_linux32v2;
206 extern struct target_desc *tdesc_s390_linux64;
207 extern struct target_desc *tdesc_s390_linux64v1;
208 extern struct target_desc *tdesc_s390_linux64v2;
209 extern struct target_desc *tdesc_s390_te_linux64;
210 extern struct target_desc *tdesc_s390_vx_linux64;
211 extern struct target_desc *tdesc_s390_tevx_linux64;
212 extern struct target_desc *tdesc_s390x_linux64;
213 extern struct target_desc *tdesc_s390x_linux64v1;
214 extern struct target_desc *tdesc_s390x_linux64v2;
215 extern struct target_desc *tdesc_s390x_te_linux64;
216 extern struct target_desc *tdesc_s390x_vx_linux64;
217 extern struct target_desc *tdesc_s390x_tevx_linux64;