hypervisor: provide a generic IoEventAddress structure

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-07-14 13:06:26 +00:00
committed by Liu Wei
parent 9810ed4496
commit f9f0a60dcf
3 changed files with 52 additions and 10 deletions

View File

@@ -60,16 +60,14 @@ pub use kvm::{aarch64, GicState};
// Aliased types exposed from both hypervisors
#[cfg(feature = "kvm")]
pub use kvm::{
ClockData, CpuState, CreateDevice, DeviceAttr, DeviceFd, IoEventAddress, IrqRoutingEntry,
VcpuEvents, VmState,
ClockData, CpuState, CreateDevice, DeviceAttr, DeviceFd, IrqRoutingEntry, VcpuEvents, VmState,
};
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
pub use mshv::x86_64;
// Aliased types exposed from both hypervisors
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
pub use mshv::{
CpuState, CreateDevice, DeviceAttr, DeviceFd, IoEventAddress, IrqRoutingEntry, VcpuEvents,
VmState,
CpuState, CreateDevice, DeviceAttr, DeviceFd, IrqRoutingEntry, VcpuEvents, VmState,
};
use std::sync::Arc;
pub use vm::{
@@ -144,3 +142,9 @@ pub enum MpState {
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
Mshv, /* MSHV does not supprt MpState yet */
}
#[derive(Debug, Clone, Copy)]
pub enum IoEventAddress {
Pio(u64),
Mmio(u64),
}