1//===-- MachRegisterStatesX86_64.h --------------------------------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// Created by Sean Callanan on 3/16/11.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_X86_64_MACHREGISTERSTATESX86_64_H
15#define LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_X86_64_MACHREGISTERSTATESX86_64_H
16
17#include <cinttypes>
18
19#define __x86_64_THREAD_STATE 4
20#define __x86_64_FLOAT_STATE 5
21#define __x86_64_EXCEPTION_STATE 6
22#define __x86_64_DEBUG_STATE 11
23#define __x86_64_AVX_STATE 17
24#define __x86_64_AVX512F_STATE 20
25
26typedef struct {
27 uint64_t __rax;
28 uint64_t __rbx;
29 uint64_t __rcx;
30 uint64_t __rdx;
31 uint64_t __rdi;
32 uint64_t __rsi;
33 uint64_t __rbp;
34 uint64_t __rsp;
35 uint64_t __r8;
36 uint64_t __r9;
37 uint64_t __r10;
38 uint64_t __r11;
39 uint64_t __r12;
40 uint64_t __r13;
41 uint64_t __r14;
42 uint64_t __r15;
43 uint64_t __rip;
44 uint64_t __rflags;
45 uint64_t __cs;
46 uint64_t __fs;
47 uint64_t __gs;
48} __x86_64_thread_state_t;
49
50typedef struct {
51 uint16_t __invalid : 1;
52 uint16_t __denorm : 1;
53 uint16_t __zdiv : 1;
54 uint16_t __ovrfl : 1;
55 uint16_t __undfl : 1;
56 uint16_t __precis : 1;
57 uint16_t __PAD1 : 2;
58 uint16_t __pc : 2;
59 uint16_t __rc : 2;
60 uint16_t __PAD2 : 1;
61 uint16_t __PAD3 : 3;
62} __x86_64_fp_control_t;
63
64typedef struct {
65 uint16_t __invalid : 1;
66 uint16_t __denorm : 1;
67 uint16_t __zdiv : 1;
68 uint16_t __ovrfl : 1;
69 uint16_t __undfl : 1;
70 uint16_t __precis : 1;
71 uint16_t __stkflt : 1;
72 uint16_t __errsumm : 1;
73 uint16_t __c0 : 1;
74 uint16_t __c1 : 1;
75 uint16_t __c2 : 1;
76 uint16_t __tos : 3;
77 uint16_t __c3 : 1;
78 uint16_t __busy : 1;
79} __x86_64_fp_status_t;
80
81typedef struct {
82 uint8_t __mmst_reg[10];
83 uint8_t __mmst_rsrv[6];
84} __x86_64_mmst_reg;
85
86typedef struct { uint8_t __xmm_reg[16]; } __x86_64_xmm_reg;
87
88typedef struct {
89 uint32_t __fpu_reserved[2];
90 __x86_64_fp_control_t __fpu_fcw;
91 __x86_64_fp_status_t __fpu_fsw;
92 uint8_t __fpu_ftw;
93 uint8_t __fpu_rsrv1;
94 uint16_t __fpu_fop;
95 uint32_t __fpu_ip;
96 uint16_t __fpu_cs;
97 uint16_t __fpu_rsrv2;
98 uint32_t __fpu_dp;
99 uint16_t __fpu_ds;
100 uint16_t __fpu_rsrv3;
101 uint32_t __fpu_mxcsr;
102 uint32_t __fpu_mxcsrmask;
103 __x86_64_mmst_reg __fpu_stmm0;
104 __x86_64_mmst_reg __fpu_stmm1;
105 __x86_64_mmst_reg __fpu_stmm2;
106 __x86_64_mmst_reg __fpu_stmm3;
107 __x86_64_mmst_reg __fpu_stmm4;
108 __x86_64_mmst_reg __fpu_stmm5;
109 __x86_64_mmst_reg __fpu_stmm6;
110 __x86_64_mmst_reg __fpu_stmm7;
111 __x86_64_xmm_reg __fpu_xmm0;
112 __x86_64_xmm_reg __fpu_xmm1;
113 __x86_64_xmm_reg __fpu_xmm2;
114 __x86_64_xmm_reg __fpu_xmm3;
115 __x86_64_xmm_reg __fpu_xmm4;
116 __x86_64_xmm_reg __fpu_xmm5;
117 __x86_64_xmm_reg __fpu_xmm6;
118 __x86_64_xmm_reg __fpu_xmm7;
119 __x86_64_xmm_reg __fpu_xmm8;
120 __x86_64_xmm_reg __fpu_xmm9;
121 __x86_64_xmm_reg __fpu_xmm10;
122 __x86_64_xmm_reg __fpu_xmm11;
123 __x86_64_xmm_reg __fpu_xmm12;
124 __x86_64_xmm_reg __fpu_xmm13;
125 __x86_64_xmm_reg __fpu_xmm14;
126 __x86_64_xmm_reg __fpu_xmm15;
127 uint8_t __fpu_rsrv4[6 * 16];
128 uint32_t __fpu_reserved1;
129} __x86_64_float_state_t;
130
131typedef struct {
132 uint32_t __fpu_reserved[2];
133 __x86_64_fp_control_t __fpu_fcw;
134 __x86_64_fp_status_t __fpu_fsw;
135 uint8_t __fpu_ftw;
136 uint8_t __fpu_rsrv1;
137 uint16_t __fpu_fop;
138 uint32_t __fpu_ip;
139 uint16_t __fpu_cs;
140 uint16_t __fpu_rsrv2;
141 uint32_t __fpu_dp;
142 uint16_t __fpu_ds;
143 uint16_t __fpu_rsrv3;
144 uint32_t __fpu_mxcsr;
145 uint32_t __fpu_mxcsrmask;
146 __x86_64_mmst_reg __fpu_stmm0;
147 __x86_64_mmst_reg __fpu_stmm1;
148 __x86_64_mmst_reg __fpu_stmm2;
149 __x86_64_mmst_reg __fpu_stmm3;
150 __x86_64_mmst_reg __fpu_stmm4;
151 __x86_64_mmst_reg __fpu_stmm5;
152 __x86_64_mmst_reg __fpu_stmm6;
153 __x86_64_mmst_reg __fpu_stmm7;
154 __x86_64_xmm_reg __fpu_xmm0;
155 __x86_64_xmm_reg __fpu_xmm1;
156 __x86_64_xmm_reg __fpu_xmm2;
157 __x86_64_xmm_reg __fpu_xmm3;
158 __x86_64_xmm_reg __fpu_xmm4;
159 __x86_64_xmm_reg __fpu_xmm5;
160 __x86_64_xmm_reg __fpu_xmm6;
161 __x86_64_xmm_reg __fpu_xmm7;
162 __x86_64_xmm_reg __fpu_xmm8;
163 __x86_64_xmm_reg __fpu_xmm9;
164 __x86_64_xmm_reg __fpu_xmm10;
165 __x86_64_xmm_reg __fpu_xmm11;
166 __x86_64_xmm_reg __fpu_xmm12;
167 __x86_64_xmm_reg __fpu_xmm13;
168 __x86_64_xmm_reg __fpu_xmm14;
169 __x86_64_xmm_reg __fpu_xmm15;
170 uint8_t __fpu_rsrv4[6 * 16];
171 uint32_t __fpu_reserved1;
172 uint8_t __avx_reserved1[64];
173 __x86_64_xmm_reg __fpu_ymmh0;
174 __x86_64_xmm_reg __fpu_ymmh1;
175 __x86_64_xmm_reg __fpu_ymmh2;
176 __x86_64_xmm_reg __fpu_ymmh3;
177 __x86_64_xmm_reg __fpu_ymmh4;
178 __x86_64_xmm_reg __fpu_ymmh5;
179 __x86_64_xmm_reg __fpu_ymmh6;
180 __x86_64_xmm_reg __fpu_ymmh7;
181 __x86_64_xmm_reg __fpu_ymmh8;
182 __x86_64_xmm_reg __fpu_ymmh9;
183 __x86_64_xmm_reg __fpu_ymmh10;
184 __x86_64_xmm_reg __fpu_ymmh11;
185 __x86_64_xmm_reg __fpu_ymmh12;
186 __x86_64_xmm_reg __fpu_ymmh13;
187 __x86_64_xmm_reg __fpu_ymmh14;
188 __x86_64_xmm_reg __fpu_ymmh15;
189} __x86_64_avx_state_t;
190
191typedef struct { uint8_t __ymm_reg[32]; } __x86_64_ymm_reg;
192typedef struct { uint8_t __zmm_reg[64]; } __x86_64_zmm_reg;
193typedef struct { uint8_t __opmask_reg[8]; } __x86_64_opmask_reg;
194
195typedef struct {
196 uint32_t __fpu_reserved[2];
197 __x86_64_fp_control_t __fpu_fcw;
198 __x86_64_fp_status_t __fpu_fsw;
199 uint8_t __fpu_ftw;
200 uint8_t __fpu_rsrv1;
201 uint16_t __fpu_fop;
202 uint32_t __fpu_ip;
203 uint16_t __fpu_cs;
204 uint16_t __fpu_rsrv2;
205 uint32_t __fpu_dp;
206 uint16_t __fpu_ds;
207 uint16_t __fpu_rsrv3;
208 uint32_t __fpu_mxcsr;
209 uint32_t __fpu_mxcsrmask;
210 __x86_64_mmst_reg __fpu_stmm0;
211 __x86_64_mmst_reg __fpu_stmm1;
212 __x86_64_mmst_reg __fpu_stmm2;
213 __x86_64_mmst_reg __fpu_stmm3;
214 __x86_64_mmst_reg __fpu_stmm4;
215 __x86_64_mmst_reg __fpu_stmm5;
216 __x86_64_mmst_reg __fpu_stmm6;
217 __x86_64_mmst_reg __fpu_stmm7;
218 __x86_64_xmm_reg __fpu_xmm0;
219 __x86_64_xmm_reg __fpu_xmm1;
220 __x86_64_xmm_reg __fpu_xmm2;
221 __x86_64_xmm_reg __fpu_xmm3;
222 __x86_64_xmm_reg __fpu_xmm4;
223 __x86_64_xmm_reg __fpu_xmm5;
224 __x86_64_xmm_reg __fpu_xmm6;
225 __x86_64_xmm_reg __fpu_xmm7;
226 __x86_64_xmm_reg __fpu_xmm8;
227 __x86_64_xmm_reg __fpu_xmm9;
228 __x86_64_xmm_reg __fpu_xmm10;
229 __x86_64_xmm_reg __fpu_xmm11;
230 __x86_64_xmm_reg __fpu_xmm12;
231 __x86_64_xmm_reg __fpu_xmm13;
232 __x86_64_xmm_reg __fpu_xmm14;
233 __x86_64_xmm_reg __fpu_xmm15;
234 uint8_t __fpu_rsrv4[6 * 16];
235 uint32_t __fpu_reserved1;
236 uint8_t __avx_reserved1[64];
237 __x86_64_xmm_reg __fpu_ymmh0;
238 __x86_64_xmm_reg __fpu_ymmh1;
239 __x86_64_xmm_reg __fpu_ymmh2;
240 __x86_64_xmm_reg __fpu_ymmh3;
241 __x86_64_xmm_reg __fpu_ymmh4;
242 __x86_64_xmm_reg __fpu_ymmh5;
243 __x86_64_xmm_reg __fpu_ymmh6;
244 __x86_64_xmm_reg __fpu_ymmh7;
245 __x86_64_xmm_reg __fpu_ymmh8;
246 __x86_64_xmm_reg __fpu_ymmh9;
247 __x86_64_xmm_reg __fpu_ymmh10;
248 __x86_64_xmm_reg __fpu_ymmh11;
249 __x86_64_xmm_reg __fpu_ymmh12;
250 __x86_64_xmm_reg __fpu_ymmh13;
251 __x86_64_xmm_reg __fpu_ymmh14;
252 __x86_64_xmm_reg __fpu_ymmh15;
253 __x86_64_opmask_reg __fpu_k0;
254 __x86_64_opmask_reg __fpu_k1;
255 __x86_64_opmask_reg __fpu_k2;
256 __x86_64_opmask_reg __fpu_k3;
257 __x86_64_opmask_reg __fpu_k4;
258 __x86_64_opmask_reg __fpu_k5;
259 __x86_64_opmask_reg __fpu_k6;
260 __x86_64_opmask_reg __fpu_k7;
261 __x86_64_ymm_reg __fpu_zmmh0;
262 __x86_64_ymm_reg __fpu_zmmh1;
263 __x86_64_ymm_reg __fpu_zmmh2;
264 __x86_64_ymm_reg __fpu_zmmh3;
265 __x86_64_ymm_reg __fpu_zmmh4;
266 __x86_64_ymm_reg __fpu_zmmh5;
267 __x86_64_ymm_reg __fpu_zmmh6;
268 __x86_64_ymm_reg __fpu_zmmh7;
269 __x86_64_ymm_reg __fpu_zmmh8;
270 __x86_64_ymm_reg __fpu_zmmh9;
271 __x86_64_ymm_reg __fpu_zmmh10;
272 __x86_64_ymm_reg __fpu_zmmh11;
273 __x86_64_ymm_reg __fpu_zmmh12;
274 __x86_64_ymm_reg __fpu_zmmh13;
275 __x86_64_ymm_reg __fpu_zmmh14;
276 __x86_64_ymm_reg __fpu_zmmh15;
277 __x86_64_zmm_reg __fpu_zmm16;
278 __x86_64_zmm_reg __fpu_zmm17;
279 __x86_64_zmm_reg __fpu_zmm18;
280 __x86_64_zmm_reg __fpu_zmm19;
281 __x86_64_zmm_reg __fpu_zmm20;
282 __x86_64_zmm_reg __fpu_zmm21;
283 __x86_64_zmm_reg __fpu_zmm22;
284 __x86_64_zmm_reg __fpu_zmm23;
285 __x86_64_zmm_reg __fpu_zmm24;
286 __x86_64_zmm_reg __fpu_zmm25;
287 __x86_64_zmm_reg __fpu_zmm26;
288 __x86_64_zmm_reg __fpu_zmm27;
289 __x86_64_zmm_reg __fpu_zmm28;
290 __x86_64_zmm_reg __fpu_zmm29;
291 __x86_64_zmm_reg __fpu_zmm30;
292 __x86_64_zmm_reg __fpu_zmm31;
293
294} __x86_64_avx512f_state_t;
295
296typedef struct {
297 uint32_t __trapno;
298 uint32_t __err;
299 uint64_t __faultvaddr;
300} __x86_64_exception_state_t;
301
302typedef struct {
303 uint64_t __dr0;
304 uint64_t __dr1;
305 uint64_t __dr2;
306 uint64_t __dr3;
307 uint64_t __dr4;
308 uint64_t __dr5;
309 uint64_t __dr6;
310 uint64_t __dr7;
311} __x86_64_debug_state_t;
312
313#endif
314

source code of lldb/tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h