mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
pci: Extend the Device trait to carry the device BARs
When reading from or writing to a PCI BAR to handle a VM exit, we need to have the BAR address itself to be able to support multiple BARs PCI devices. Fixes: #87 Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
@@ -90,11 +90,11 @@ pub trait PciDevice: BusDevice {
|
||||
/// Reads from a BAR region mapped in to the device.
|
||||
/// * `addr` - The guest address inside the BAR.
|
||||
/// * `data` - Filled with the data from `addr`.
|
||||
fn read_bar(&mut self, addr: u64, data: &mut [u8]);
|
||||
fn read_bar(&mut self, base: u64, offset: u64, data: &mut [u8]);
|
||||
/// Writes to a BAR region mapped in to the device.
|
||||
/// * `addr` - The guest address inside the BAR.
|
||||
/// * `data` - The data to write.
|
||||
fn write_bar(&mut self, addr: u64, data: &[u8]);
|
||||
fn write_bar(&mut self, base: u64, offset: u64, data: &[u8]);
|
||||
/// Invoked when the device is sandboxed.
|
||||
fn on_device_sandboxed(&mut self) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user