1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 12 /* 13 * Copyright 2019 Joyent, Inc. 14 */ 15 16 #ifndef _MDB_X86UTIL_H 17 #define _MDB_X86UTIL_H 18 19 #include <sys/types.h> 20 #include <inttypes.h> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 typedef struct mdb_x86_desc { 27 uint64_t d_base; 28 uint32_t d_lim; 29 uint32_t d_acc; 30 } mdb_x86_desc_t; 31 32 struct sysregs { 33 uint64_t sr_cr0; 34 uint64_t sr_cr2; 35 uint64_t sr_cr3; 36 uint64_t sr_cr4; 37 uint64_t sr_dr0; 38 uint64_t sr_dr1; 39 uint64_t sr_dr2; 40 uint64_t sr_dr3; 41 uint64_t sr_dr6; 42 uint64_t sr_dr7; 43 uint64_t sr_efer; 44 uint64_t sr_pdpte0; 45 uint64_t sr_pdpte1; 46 uint64_t sr_pdpte2; 47 uint64_t sr_pdpte3; 48 uint64_t sr_intr_shadow; 49 mdb_x86_desc_t sr_gdtr; 50 mdb_x86_desc_t sr_idtr; 51 mdb_x86_desc_t sr_ldtr; 52 mdb_x86_desc_t sr_tr; 53 mdb_x86_desc_t sr_cs; 54 mdb_x86_desc_t sr_ss; 55 mdb_x86_desc_t sr_ds; 56 mdb_x86_desc_t sr_es; 57 mdb_x86_desc_t sr_fs; 58 mdb_x86_desc_t sr_gs; 59 }; 60 61 extern void mdb_x86_print_sysregs(struct sysregs *, boolean_t); 62 63 64 #ifdef __cplusplus 65 } 66 #endif 67 68 #endif /* _MDB_X86UTIL_H */ 69