xref: /DragonOS/kernel/src/arch/x86_64/kvm/vmx/mod.rs (revision e26ca418df7af685226d12d7f22fe1785ba163e4)
1 pub mod ept;
2 pub mod kvm_emulation;
3 pub mod mmu;
4 pub mod seg;
5 pub mod vcpu;
6 pub mod vmcs;
7 pub mod vmexit;
8 pub mod vmx_asm_wrapper;
9 
10 #[allow(dead_code)]
11 pub enum VcpuRegIndex {
12     Rax = 0,
13     Rbx = 1,
14     Rcx = 2,
15     Rdx = 3,
16     Rsi = 4,
17     Rdi = 5,
18     Rsp = 6,
19     Rbp = 7,
20     R8 = 8,
21     R9 = 9,
22     R10 = 10,
23     R11 = 11,
24     R12 = 12,
25     R13 = 13,
26     R14 = 14,
27     R15 = 15,
28 }
29 
30 bitflags! {
31     #[allow(non_camel_case_types)]
32     pub struct X86_CR0: u32{
33         const CR0_PE = 1 << 0; /* Protection Enable */
34         const CR0_MP = 1 << 1; /* Monitor Coprocessor */
35         const CR0_EM = 1 << 2; /* Emulation */
36         const CR0_TS = 1 << 3; /* Task Switched */
37         const CR0_ET = 1 << 4; /* Extension Type */
38         const CR0_NE = 1 << 5; /* Numeric Error */
39         const CR0_WP = 1 << 16; /* Write Protect */
40         const CR0_AM = 1 << 18; /* Alignment Mask */
41         const CR0_NW = 1 << 29; /* Not Write-through */
42         const CR0_CD = 1 << 30; /* Cache Disable */
43         const CR0_PG = 1 << 31; /* Paging */
44     }
45 }
46