|
1 | 1 | #![no_std] |
2 | 2 | #![feature(doc_cfg)] |
3 | 3 | #![feature(concat_idents)] |
4 | | -#![feature(naked_functions)] |
5 | 4 | #![doc = include_str!("../README.md")] |
6 | 5 |
|
7 | 6 | #[macro_use] |
8 | 7 | extern crate log; |
9 | 8 |
|
10 | 9 | extern crate alloc; |
11 | 10 |
|
| 11 | +#[cfg(test)] |
| 12 | +mod test_utils; |
| 13 | + |
12 | 14 | pub(crate) mod msr; |
13 | 15 | #[macro_use] |
14 | 16 | pub(crate) mod regs; |
15 | 17 | mod ept; |
16 | | -mod frame; |
| 18 | + |
| 19 | +#[cfg(all(feature = "vmx", feature = "svm"))] |
| 20 | +compile_error!("Features 'vmx' and 'svm' are mutually exclusive. Please enable only one of them."); |
17 | 21 |
|
18 | 22 | cfg_if::cfg_if! { |
19 | 23 | if #[cfg(feature = "vmx")] { |
20 | 24 | mod vmx; |
21 | | - use vmx as vender; |
22 | | - pub use vmx::{VmxExitInfo, VmxExitReason, VmxInterruptInfo, VmxIoExitInfo}; |
23 | | - pub use vender::VmxArchVCpu; |
24 | | - pub use vender::VmxArchPerCpuState; |
25 | | - }else if #[cfg(feature = "svm")] { |
| 25 | + use vmx as vendor; |
| 26 | + // pub use vmx::{VmxExitInfo, VmxExitReason, VmxInterruptInfo, VmxIoExitInfo}; |
| 27 | + pub use vendor::VmxArchVCpu as X86ArchVCpu; |
| 28 | + pub use vendor::VmxArchPerCpuState as X86ArchPerCpuState; |
| 29 | + } else if #[cfg(feature = "svm")] { |
26 | 30 | mod svm; |
27 | | - use svm as vender; |
28 | | - pub use vender::{ |
29 | | - SvmArchVCpu,SvmArchPerCpuState, |
| 31 | + use svm as vendor; |
| 32 | + pub use vendor::{ |
| 33 | + SvmArchVCpu as X86ArchVCpu, SvmArchPerCpuState as X86ArchPerCpuState, |
30 | 34 | }; |
31 | 35 | } |
32 | 36 | } |
33 | 37 |
|
34 | | -// |
35 | | -// mod vmx; |
36 | | -// use vmx as vender; |
37 | | -// pub use vmx::{VmxExitInfo, VmxExitReason, VmxInterruptInfo, VmxIoExitInfo}; |
38 | | -// |
39 | | -// pub use vender::VmxArchVCpu; |
40 | | -// pub use vender::VmxArchPerCpuState; |
41 | | -// |
42 | | -// |
43 | | -// mod svm; |
44 | | -// use svm as vendor; |
45 | | -// pub use vendor::{ |
46 | | -// SvmArchVCpu, |
47 | | -// SvmArchPerCpuState, |
48 | | -// }; |
49 | | - |
50 | 38 | pub use ept::GuestPageWalkInfo; |
51 | 39 | pub use regs::GeneralRegisters; |
52 | | -pub use vender::has_hardware_support; |
| 40 | +pub use vendor::has_hardware_support; |
0 commit comments