1 //===-- RegisterInfos_mips64.h ----------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 #include "lldb/Core/dwarf.h"
12 #include "llvm/Support/Compiler.h"
14 #ifdef DECLARE_REGISTER_INFOS_MIPS64_STRUCT
16 // Computes the offset of the given GPR in the user data area.
17 #define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR_freebsd_mips, regname))
19 // Computes the offset of the given FPR in the extended data area.
20 #define FPR_OFFSET(regname) \
21 (sizeof(GPR_freebsd_mips) + \
22 LLVM_EXTENSION offsetof(FPR_freebsd_mips, regname))
24 // RegisterKind: EHFrame, DWARF, Generic, Process Plugin, LLDB
26 // Note that the size and offset will be updated by platform-specific classes.
27 #define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
29 #reg, alt, sizeof(((GPR_freebsd_mips *) 0)->reg), \
30 GPR_OFFSET(reg), eEncodingUint, eFormatHex, \
31 {kind1, kind2, kind3, kind4, \
32 gpr_##reg##_mips64 }, \
36 #define DEFINE_FPR(reg, alt, kind1, kind2, kind3) \
38 #reg, alt, sizeof(((FPR_freebsd_mips *) 0)->reg), \
39 FPR_OFFSET(reg), eEncodingIEEE754, eFormatFloat, \
40 {kind1, kind2, kind3, LLDB_INVALID_REGNUM, \
41 fpr_##reg##_mips64 }, \
45 #define DEFINE_FPR_INFO(reg, alt, kind1, kind2, kind3) \
47 #reg, alt, sizeof(((FPR_freebsd_mips *) 0)->reg), \
48 FPR_OFFSET(reg), eEncodingUint, eFormatHex, \
49 {kind1, kind2, kind3, LLDB_INVALID_REGNUM, \
50 fpr_##reg##_mips64 }, \
55 static RegisterInfo g_register_infos_mips64
[] = {
56 // General purpose registers. EH_Frame, DWARF,
57 // Generic, Process Plugin
58 DEFINE_GPR(zero
, "r0", dwarf_zero_mips64
, dwarf_zero_mips64
,
59 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
60 DEFINE_GPR(r1
, nullptr, dwarf_r1_mips64
, dwarf_r1_mips64
,
61 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
62 DEFINE_GPR(r2
, nullptr, dwarf_r2_mips64
, dwarf_r2_mips64
,
63 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
64 DEFINE_GPR(r3
, nullptr, dwarf_r3_mips64
, dwarf_r3_mips64
,
65 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
66 DEFINE_GPR(r4
, nullptr, dwarf_r4_mips64
, dwarf_r4_mips64
,
67 LLDB_REGNUM_GENERIC_ARG1
, LLDB_INVALID_REGNUM
),
68 DEFINE_GPR(r5
, nullptr, dwarf_r5_mips64
, dwarf_r5_mips64
,
69 LLDB_REGNUM_GENERIC_ARG2
, LLDB_INVALID_REGNUM
),
70 DEFINE_GPR(r6
, nullptr, dwarf_r6_mips64
, dwarf_r6_mips64
,
71 LLDB_REGNUM_GENERIC_ARG3
, LLDB_INVALID_REGNUM
),
72 DEFINE_GPR(r7
, nullptr, dwarf_r7_mips64
, dwarf_r7_mips64
,
73 LLDB_REGNUM_GENERIC_ARG4
, LLDB_INVALID_REGNUM
),
74 DEFINE_GPR(r8
, nullptr, dwarf_r8_mips64
, dwarf_r8_mips64
,
75 LLDB_REGNUM_GENERIC_ARG5
, LLDB_INVALID_REGNUM
),
76 DEFINE_GPR(r9
, nullptr, dwarf_r9_mips64
, dwarf_r9_mips64
,
77 LLDB_REGNUM_GENERIC_ARG6
, LLDB_INVALID_REGNUM
),
78 DEFINE_GPR(r10
, nullptr, dwarf_r10_mips64
, dwarf_r10_mips64
,
79 LLDB_REGNUM_GENERIC_ARG7
, LLDB_INVALID_REGNUM
),
80 DEFINE_GPR(r11
, nullptr, dwarf_r11_mips64
, dwarf_r11_mips64
,
81 LLDB_REGNUM_GENERIC_ARG8
, LLDB_INVALID_REGNUM
),
82 DEFINE_GPR(r12
, nullptr, dwarf_r12_mips64
, dwarf_r12_mips64
,
83 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
84 DEFINE_GPR(r13
, nullptr, dwarf_r13_mips64
, dwarf_r13_mips64
,
85 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
86 DEFINE_GPR(r14
, nullptr, dwarf_r14_mips64
, dwarf_r14_mips64
,
87 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
88 DEFINE_GPR(r15
, nullptr, dwarf_r15_mips64
, dwarf_r15_mips64
,
89 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
90 DEFINE_GPR(r16
, nullptr, dwarf_r16_mips64
, dwarf_r16_mips64
,
91 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
92 DEFINE_GPR(r17
, nullptr, dwarf_r17_mips64
, dwarf_r17_mips64
,
93 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
94 DEFINE_GPR(r18
, nullptr, dwarf_r18_mips64
, dwarf_r18_mips64
,
95 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
96 DEFINE_GPR(r19
, nullptr, dwarf_r19_mips64
, dwarf_r19_mips64
,
97 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
98 DEFINE_GPR(r20
, nullptr, dwarf_r20_mips64
, dwarf_r20_mips64
,
99 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
100 DEFINE_GPR(r21
, nullptr, dwarf_r21_mips64
, dwarf_r21_mips64
,
101 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
102 DEFINE_GPR(r22
, nullptr, dwarf_r22_mips64
, dwarf_r22_mips64
,
103 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
104 DEFINE_GPR(r23
, nullptr, dwarf_r23_mips64
, dwarf_r23_mips64
,
105 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
106 DEFINE_GPR(r24
, nullptr, dwarf_r24_mips64
, dwarf_r24_mips64
,
107 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
108 DEFINE_GPR(r25
, nullptr, dwarf_r25_mips64
, dwarf_r25_mips64
,
109 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
110 DEFINE_GPR(r26
, nullptr, dwarf_r26_mips64
, dwarf_r26_mips64
,
111 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
112 DEFINE_GPR(r27
, nullptr, dwarf_r27_mips64
, dwarf_r27_mips64
,
113 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
114 DEFINE_GPR(gp
, "r28", dwarf_gp_mips64
, dwarf_gp_mips64
, LLDB_INVALID_REGNUM
,
115 LLDB_INVALID_REGNUM
),
116 DEFINE_GPR(sp
, "r29", dwarf_sp_mips64
, dwarf_sp_mips64
,
117 LLDB_REGNUM_GENERIC_SP
, LLDB_INVALID_REGNUM
),
118 DEFINE_GPR(r30
, nullptr, dwarf_r30_mips64
, dwarf_r30_mips64
,
119 LLDB_REGNUM_GENERIC_FP
, LLDB_INVALID_REGNUM
),
120 DEFINE_GPR(ra
, "r31", dwarf_ra_mips64
, dwarf_ra_mips64
,
121 LLDB_REGNUM_GENERIC_RA
, LLDB_INVALID_REGNUM
),
122 DEFINE_GPR(sr
, nullptr, dwarf_sr_mips64
, dwarf_sr_mips64
,
123 LLDB_REGNUM_GENERIC_FLAGS
, LLDB_INVALID_REGNUM
),
124 DEFINE_GPR(mullo
, nullptr, dwarf_lo_mips64
, dwarf_lo_mips64
,
125 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
126 DEFINE_GPR(mulhi
, nullptr, dwarf_hi_mips64
, dwarf_hi_mips64
,
127 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
128 DEFINE_GPR(badvaddr
, nullptr, dwarf_bad_mips64
, dwarf_bad_mips64
,
129 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
130 DEFINE_GPR(cause
, nullptr, dwarf_cause_mips64
, dwarf_cause_mips64
,
131 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
132 DEFINE_GPR(pc
, "pc", dwarf_pc_mips64
, dwarf_pc_mips64
,
133 LLDB_REGNUM_GENERIC_PC
, LLDB_INVALID_REGNUM
),
134 DEFINE_GPR(ic
, nullptr, dwarf_ic_mips64
, dwarf_ic_mips64
,
135 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
136 DEFINE_GPR(dummy
, nullptr, dwarf_dummy_mips64
, dwarf_dummy_mips64
,
137 LLDB_INVALID_REGNUM
, LLDB_INVALID_REGNUM
),
139 DEFINE_FPR(f0
, nullptr, dwarf_f0_mips64
, dwarf_f0_mips64
,
140 LLDB_INVALID_REGNUM
),
141 DEFINE_FPR(f1
, nullptr, dwarf_f1_mips64
, dwarf_f1_mips64
,
142 LLDB_INVALID_REGNUM
),
143 DEFINE_FPR(f2
, nullptr, dwarf_f2_mips64
, dwarf_f2_mips64
,
144 LLDB_INVALID_REGNUM
),
145 DEFINE_FPR(f3
, nullptr, dwarf_f3_mips64
, dwarf_f3_mips64
,
146 LLDB_INVALID_REGNUM
),
147 DEFINE_FPR(f4
, nullptr, dwarf_f4_mips64
, dwarf_f4_mips64
,
148 LLDB_INVALID_REGNUM
),
149 DEFINE_FPR(f5
, nullptr, dwarf_f5_mips64
, dwarf_f5_mips64
,
150 LLDB_INVALID_REGNUM
),
151 DEFINE_FPR(f6
, nullptr, dwarf_f6_mips64
, dwarf_f6_mips64
,
152 LLDB_INVALID_REGNUM
),
153 DEFINE_FPR(f7
, nullptr, dwarf_f7_mips64
, dwarf_f7_mips64
,
154 LLDB_INVALID_REGNUM
),
155 DEFINE_FPR(f8
, nullptr, dwarf_f8_mips64
, dwarf_f8_mips64
,
156 LLDB_INVALID_REGNUM
),
157 DEFINE_FPR(f9
, nullptr, dwarf_f9_mips64
, dwarf_f9_mips64
,
158 LLDB_INVALID_REGNUM
),
159 DEFINE_FPR(f10
, nullptr, dwarf_f10_mips64
, dwarf_f10_mips64
,
160 LLDB_INVALID_REGNUM
),
161 DEFINE_FPR(f11
, nullptr, dwarf_f11_mips64
, dwarf_f11_mips64
,
162 LLDB_INVALID_REGNUM
),
163 DEFINE_FPR(f12
, nullptr, dwarf_f12_mips64
, dwarf_f12_mips64
,
164 LLDB_INVALID_REGNUM
),
165 DEFINE_FPR(f13
, nullptr, dwarf_f13_mips64
, dwarf_f13_mips64
,
166 LLDB_INVALID_REGNUM
),
167 DEFINE_FPR(f14
, nullptr, dwarf_f14_mips64
, dwarf_f14_mips64
,
168 LLDB_INVALID_REGNUM
),
169 DEFINE_FPR(f15
, nullptr, dwarf_f15_mips64
, dwarf_f15_mips64
,
170 LLDB_INVALID_REGNUM
),
171 DEFINE_FPR(f16
, nullptr, dwarf_f16_mips64
, dwarf_f16_mips64
,
172 LLDB_INVALID_REGNUM
),
173 DEFINE_FPR(f17
, nullptr, dwarf_f17_mips64
, dwarf_f17_mips64
,
174 LLDB_INVALID_REGNUM
),
175 DEFINE_FPR(f18
, nullptr, dwarf_f18_mips64
, dwarf_f18_mips64
,
176 LLDB_INVALID_REGNUM
),
177 DEFINE_FPR(f19
, nullptr, dwarf_f19_mips64
, dwarf_f19_mips64
,
178 LLDB_INVALID_REGNUM
),
179 DEFINE_FPR(f20
, nullptr, dwarf_f20_mips64
, dwarf_f20_mips64
,
180 LLDB_INVALID_REGNUM
),
181 DEFINE_FPR(f21
, nullptr, dwarf_f21_mips64
, dwarf_f21_mips64
,
182 LLDB_INVALID_REGNUM
),
183 DEFINE_FPR(f22
, nullptr, dwarf_f22_mips64
, dwarf_f22_mips64
,
184 LLDB_INVALID_REGNUM
),
185 DEFINE_FPR(f23
, nullptr, dwarf_f23_mips64
, dwarf_f23_mips64
,
186 LLDB_INVALID_REGNUM
),
187 DEFINE_FPR(f24
, nullptr, dwarf_f24_mips64
, dwarf_f24_mips64
,
188 LLDB_INVALID_REGNUM
),
189 DEFINE_FPR(f25
, nullptr, dwarf_f25_mips64
, dwarf_f25_mips64
,
190 LLDB_INVALID_REGNUM
),
191 DEFINE_FPR(f26
, nullptr, dwarf_f26_mips64
, dwarf_f26_mips64
,
192 LLDB_INVALID_REGNUM
),
193 DEFINE_FPR(f27
, nullptr, dwarf_f27_mips64
, dwarf_f27_mips64
,
194 LLDB_INVALID_REGNUM
),
195 DEFINE_FPR(f28
, nullptr, dwarf_f28_mips64
, dwarf_f28_mips64
,
196 LLDB_INVALID_REGNUM
),
197 DEFINE_FPR(f29
, nullptr, dwarf_f29_mips64
, dwarf_f29_mips64
,
198 LLDB_INVALID_REGNUM
),
199 DEFINE_FPR(f30
, nullptr, dwarf_f30_mips64
, dwarf_f30_mips64
,
200 LLDB_INVALID_REGNUM
),
201 DEFINE_FPR(f31
, nullptr, dwarf_f31_mips64
, dwarf_f31_mips64
,
202 LLDB_INVALID_REGNUM
),
203 DEFINE_FPR_INFO(fcsr
, nullptr, dwarf_fcsr_mips64
, dwarf_fcsr_mips64
,
204 LLDB_INVALID_REGNUM
),
205 DEFINE_FPR_INFO(fir
, nullptr, dwarf_fir_mips64
, dwarf_fir_mips64
,
206 LLDB_INVALID_REGNUM
),
209 static_assert((sizeof(g_register_infos_mips64
) /
210 sizeof(g_register_infos_mips64
[0])) == k_num_registers_mips64
,
211 "g_register_infos_mips64 has wrong number of register infos");
214 #undef DEFINE_GPR_INFO
216 #undef DEFINE_FPR_INFO
218 #undef DEFINE_MSA_INFO
223 #endif // DECLARE_REGISTER_INFOS_MIPS64_STRUCT