Skip to content

Commit 2650f7d

Browse files
committed
make code compilable
1 parent adcbc02 commit 2650f7d

File tree

14 files changed

+1042
-492
lines changed

14 files changed

+1042
-492
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ axvcpu = "0.1.0"
3333
x86_vlapic = "0.1.0"
3434
axdevice_base = "0.1.0"
3535
axvisor_api = "0.1.0"
36+
tock-registers = "0.10"
3637

3738
spin = { version = "0.9", default-features = false }
3839

3940
[features]
40-
default = ["vmx"]
41+
default = ["svm"]
42+
# default = ["vmx"]
4143
tracing = []
4244
vmx = []
4345
svm = []

src/frame.rs

Lines changed: 0 additions & 137 deletions
This file was deleted.

src/lib.rs

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,40 @@
11
#![no_std]
22
#![feature(doc_cfg)]
33
#![feature(concat_idents)]
4-
#![feature(naked_functions)]
54
#![doc = include_str!("../README.md")]
65

76
#[macro_use]
87
extern crate log;
98

109
extern crate alloc;
1110

11+
#[cfg(test)]
12+
mod test_utils;
13+
1214
pub(crate) mod msr;
1315
#[macro_use]
1416
pub(crate) mod regs;
1517
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.");
1721

1822
cfg_if::cfg_if! {
1923
if #[cfg(feature = "vmx")] {
2024
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")] {
2630
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,
3034
};
3135
}
3236
}
3337

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-
5038
pub use ept::GuestPageWalkInfo;
5139
pub use regs::GeneralRegisters;
52-
pub use vender::has_hardware_support;
40+
pub use vendor::has_hardware_support;

0 commit comments

Comments
 (0)