pub struct PciConfigPassthrough {
pub vendor_id: u16,
pub device_id: u16,
pub bdf: u32,
pub bars: Vec<PciBar>,
pub config_space: [u8; 256],
pub writable_mask: [u8; 256],
}Expand description
PCI configuration space passthrough
Fields§
§vendor_id: u16Vendor ID
device_id: u16Device ID
bdf: u32BDF (bus:device:function)
bars: Vec<PciBar>BARs
config_space: [u8; 256]Emulated config space (256 bytes for type 0)
writable_mask: [u8; 256]Which config registers are writable by guest
Implementations§
Source§impl PciConfigPassthrough
impl PciConfigPassthrough
pub fn new(vendor_id: u16, device_id: u16, bdf: u32) -> Self
Sourcepub fn read_config(&self, offset: u8) -> u8
pub fn read_config(&self, offset: u8) -> u8
Read from config space
Sourcepub fn write_config(&mut self, offset: u8, value: u8)
pub fn write_config(&mut self, offset: u8, value: u8)
Write to config space (respecting writable mask)
Sourcepub fn read_config32(&self, offset: u8) -> u32
pub fn read_config32(&self, offset: u8) -> u32
Read 32-bit config space value
Trait Implementations§
Source§impl Clone for PciConfigPassthrough
impl Clone for PciConfigPassthrough
Source§fn clone(&self) -> PciConfigPassthrough
fn clone(&self) -> PciConfigPassthrough
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PciConfigPassthrough
impl RefUnwindSafe for PciConfigPassthrough
impl Send for PciConfigPassthrough
impl Sync for PciConfigPassthrough
impl Unpin for PciConfigPassthrough
impl UnwindSafe for PciConfigPassthrough
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)