1use hvdef::Vtl;
5use std::future::Future;
6use vm_topology::processor::VpIndex;
7
8pub trait CpuIo {
11 fn is_mmio(&self, address: u64) -> bool;
13
14 fn acknowledge_pic_interrupt(&self) -> Option<u8>;
17
18 fn handle_eoi(&self, irq: u32);
22
23 fn signal_synic_event(&self, vtl: Vtl, connection_id: u32, flag: u16) -> hvdef::HvResult<()>;
25
26 fn post_synic_message(
28 &self,
29 vtl: Vtl,
30 connection_id: u32,
31 secure: bool,
32 message: &[u8],
33 ) -> hvdef::HvResult<()>;
34
35 #[must_use]
37 fn read_mmio(&self, vp: VpIndex, address: u64, data: &mut [u8]) -> impl Future<Output = ()>;
38
39 #[must_use]
41 fn write_mmio(&self, vp: VpIndex, address: u64, data: &[u8]) -> impl Future<Output = ()>;
42
43 #[must_use]
45 fn read_io(&self, vp: VpIndex, port: u16, data: &mut [u8]) -> impl Future<Output = ()>;
46
47 #[must_use]
49 fn write_io(&self, vp: VpIndex, port: u16, data: &[u8]) -> impl Future<Output = ()>;
50}