1 //===-- MachRegisterStatesI386.h --------------------------------*- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Created by Sean Callanan on 3/16/11. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_I386_MACHREGISTERSTATESI386_H 14 #define LLDB_TOOLS_DEBUGSERVER_SOURCE_MACOSX_I386_MACHREGISTERSTATESI386_H 15 16 #include <inttypes.h> 17 18 #define __i386_THREAD_STATE 1 19 #define __i386_FLOAT_STATE 2 20 #define __i386_EXCEPTION_STATE 3 21 #define __i386_DEBUG_STATE 10 22 #define __i386_AVX_STATE 16 23 #define __i386_AVX512F_STATE 19 24 25 typedef struct { 26 uint32_t __eax; 27 uint32_t __ebx; 28 uint32_t __ecx; 29 uint32_t __edx; 30 uint32_t __edi; 31 uint32_t __esi; 32 uint32_t __ebp; 33 uint32_t __esp; 34 uint32_t __ss; 35 uint32_t __eflags; 36 uint32_t __eip; 37 uint32_t __cs; 38 uint32_t __ds; 39 uint32_t __es; 40 uint32_t __fs; 41 uint32_t __gs; 42 } __i386_thread_state_t; 43 44 typedef struct { 45 uint16_t __invalid : 1; 46 uint16_t __denorm : 1; 47 uint16_t __zdiv : 1; 48 uint16_t __ovrfl : 1; 49 uint16_t __undfl : 1; 50 uint16_t __precis : 1; 51 uint16_t __PAD1 : 2; 52 uint16_t __pc : 2; 53 uint16_t __rc : 2; 54 uint16_t __PAD2 : 1; 55 uint16_t __PAD3 : 3; 56 } __i386_fp_control_t; 57 58 typedef struct { 59 uint16_t __invalid : 1; 60 uint16_t __denorm : 1; 61 uint16_t __zdiv : 1; 62 uint16_t __ovrfl : 1; 63 uint16_t __undfl : 1; 64 uint16_t __precis : 1; 65 uint16_t __stkflt : 1; 66 uint16_t __errsumm : 1; 67 uint16_t __c0 : 1; 68 uint16_t __c1 : 1; 69 uint16_t __c2 : 1; 70 uint16_t __tos : 3; 71 uint16_t __c3 : 1; 72 uint16_t __busy : 1; 73 } __i386_fp_status_t; 74 75 typedef struct { 76 uint8_t __mmst_reg[10]; 77 uint8_t __mmst_rsrv[6]; 78 } __i386_mmst_reg; 79 80 typedef struct { uint8_t __xmm_reg[16]; } __i386_xmm_reg; 81 82 typedef struct { 83 uint32_t __fpu_reserved[2]; 84 __i386_fp_control_t __fpu_fcw; 85 __i386_fp_status_t __fpu_fsw; 86 uint8_t __fpu_ftw; 87 uint8_t __fpu_rsrv1; 88 uint16_t __fpu_fop; 89 uint32_t __fpu_ip; 90 uint16_t __fpu_cs; 91 uint16_t __fpu_rsrv2; 92 uint32_t __fpu_dp; 93 uint16_t __fpu_ds; 94 uint16_t __fpu_rsrv3; 95 uint32_t __fpu_mxcsr; 96 uint32_t __fpu_mxcsrmask; 97 __i386_mmst_reg __fpu_stmm0; 98 __i386_mmst_reg __fpu_stmm1; 99 __i386_mmst_reg __fpu_stmm2; 100 __i386_mmst_reg __fpu_stmm3; 101 __i386_mmst_reg __fpu_stmm4; 102 __i386_mmst_reg __fpu_stmm5; 103 __i386_mmst_reg __fpu_stmm6; 104 __i386_mmst_reg __fpu_stmm7; 105 __i386_xmm_reg __fpu_xmm0; 106 __i386_xmm_reg __fpu_xmm1; 107 __i386_xmm_reg __fpu_xmm2; 108 __i386_xmm_reg __fpu_xmm3; 109 __i386_xmm_reg __fpu_xmm4; 110 __i386_xmm_reg __fpu_xmm5; 111 __i386_xmm_reg __fpu_xmm6; 112 __i386_xmm_reg __fpu_xmm7; 113 uint8_t __fpu_rsrv4[14 * 16]; 114 uint32_t __fpu_reserved1; 115 } __i386_float_state_t; 116 117 typedef struct { 118 uint32_t __fpu_reserved[2]; 119 __i386_fp_control_t __fpu_fcw; 120 __i386_fp_status_t __fpu_fsw; 121 uint8_t __fpu_ftw; 122 uint8_t __fpu_rsrv1; 123 uint16_t __fpu_fop; 124 uint32_t __fpu_ip; 125 uint16_t __fpu_cs; 126 uint16_t __fpu_rsrv2; 127 uint32_t __fpu_dp; 128 uint16_t __fpu_ds; 129 uint16_t __fpu_rsrv3; 130 uint32_t __fpu_mxcsr; 131 uint32_t __fpu_mxcsrmask; 132 __i386_mmst_reg __fpu_stmm0; 133 __i386_mmst_reg __fpu_stmm1; 134 __i386_mmst_reg __fpu_stmm2; 135 __i386_mmst_reg __fpu_stmm3; 136 __i386_mmst_reg __fpu_stmm4; 137 __i386_mmst_reg __fpu_stmm5; 138 __i386_mmst_reg __fpu_stmm6; 139 __i386_mmst_reg __fpu_stmm7; 140 __i386_xmm_reg __fpu_xmm0; 141 __i386_xmm_reg __fpu_xmm1; 142 __i386_xmm_reg __fpu_xmm2; 143 __i386_xmm_reg __fpu_xmm3; 144 __i386_xmm_reg __fpu_xmm4; 145 __i386_xmm_reg __fpu_xmm5; 146 __i386_xmm_reg __fpu_xmm6; 147 __i386_xmm_reg __fpu_xmm7; 148 uint8_t __fpu_rsrv4[14 * 16]; 149 uint32_t __fpu_reserved1; 150 uint8_t __avx_reserved1[64]; 151 __i386_xmm_reg __fpu_ymmh0; 152 __i386_xmm_reg __fpu_ymmh1; 153 __i386_xmm_reg __fpu_ymmh2; 154 __i386_xmm_reg __fpu_ymmh3; 155 __i386_xmm_reg __fpu_ymmh4; 156 __i386_xmm_reg __fpu_ymmh5; 157 __i386_xmm_reg __fpu_ymmh6; 158 __i386_xmm_reg __fpu_ymmh7; 159 } __i386_avx_state_t; 160 161 typedef struct { uint8_t __ymm_reg[32]; } __i386_ymm_reg; 162 typedef struct { uint8_t __opmask_reg[8]; } __i386_opmask_reg; 163 164 typedef struct { 165 uint32_t __fpu_reserved[2]; 166 __i386_fp_control_t __fpu_fcw; 167 __i386_fp_status_t __fpu_fsw; 168 uint8_t __fpu_ftw; 169 uint8_t __fpu_rsrv1; 170 uint16_t __fpu_fop; 171 uint32_t __fpu_ip; 172 uint16_t __fpu_cs; 173 uint16_t __fpu_rsrv2; 174 uint32_t __fpu_dp; 175 uint16_t __fpu_ds; 176 uint16_t __fpu_rsrv3; 177 uint32_t __fpu_mxcsr; 178 uint32_t __fpu_mxcsrmask; 179 __i386_mmst_reg __fpu_stmm0; 180 __i386_mmst_reg __fpu_stmm1; 181 __i386_mmst_reg __fpu_stmm2; 182 __i386_mmst_reg __fpu_stmm3; 183 __i386_mmst_reg __fpu_stmm4; 184 __i386_mmst_reg __fpu_stmm5; 185 __i386_mmst_reg __fpu_stmm6; 186 __i386_mmst_reg __fpu_stmm7; 187 __i386_xmm_reg __fpu_xmm0; 188 __i386_xmm_reg __fpu_xmm1; 189 __i386_xmm_reg __fpu_xmm2; 190 __i386_xmm_reg __fpu_xmm3; 191 __i386_xmm_reg __fpu_xmm4; 192 __i386_xmm_reg __fpu_xmm5; 193 __i386_xmm_reg __fpu_xmm6; 194 __i386_xmm_reg __fpu_xmm7; 195 uint8_t __fpu_rsrv4[14 * 16]; 196 uint32_t __fpu_reserved1; 197 uint8_t __avx_reserved1[64]; 198 __i386_xmm_reg __fpu_ymmh0; 199 __i386_xmm_reg __fpu_ymmh1; 200 __i386_xmm_reg __fpu_ymmh2; 201 __i386_xmm_reg __fpu_ymmh3; 202 __i386_xmm_reg __fpu_ymmh4; 203 __i386_xmm_reg __fpu_ymmh5; 204 __i386_xmm_reg __fpu_ymmh6; 205 __i386_xmm_reg __fpu_ymmh7; 206 __i386_opmask_reg __fpu_k0; 207 __i386_opmask_reg __fpu_k1; 208 __i386_opmask_reg __fpu_k2; 209 __i386_opmask_reg __fpu_k3; 210 __i386_opmask_reg __fpu_k4; 211 __i386_opmask_reg __fpu_k5; 212 __i386_opmask_reg __fpu_k6; 213 __i386_opmask_reg __fpu_k7; 214 __i386_ymm_reg __fpu_zmmh0; 215 __i386_ymm_reg __fpu_zmmh1; 216 __i386_ymm_reg __fpu_zmmh2; 217 __i386_ymm_reg __fpu_zmmh3; 218 __i386_ymm_reg __fpu_zmmh4; 219 __i386_ymm_reg __fpu_zmmh5; 220 __i386_ymm_reg __fpu_zmmh6; 221 __i386_ymm_reg __fpu_zmmh7; 222 } __i386_avx512f_state_t; 223 224 typedef struct { 225 uint32_t __trapno; 226 uint32_t __err; 227 uint32_t __faultvaddr; 228 } __i386_exception_state_t; 229 230 typedef struct { 231 uint32_t __dr0; 232 uint32_t __dr1; 233 uint32_t __dr2; 234 uint32_t __dr3; 235 uint32_t __dr4; 236 uint32_t __dr5; 237 uint32_t __dr6; 238 uint32_t __dr7; 239 } __i386_debug_state_t; 240 241 #endif 242