From c865f93c9b683c3407443d1d4814450a866987bb Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 28 Oct 2019 08:47:35 -0700 Subject: [PATCH] pci: Extend PciDevice trait with move_bar() function In order to support PCI BAR reprogramming, the PciDevice trait defines a new method move_bar() dedicated for taking appropriate action when a BAR is moved to a different guest address. Signed-off-by: Sebastien Boeuf --- pci/src/device.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pci/src/device.rs b/pci/src/device.rs index 47041fe42..eb9599d22 100755 --- a/pci/src/device.rs +++ b/pci/src/device.rs @@ -90,6 +90,8 @@ pub trait PciDevice: BusDevice { /// * `addr` - The guest address inside the BAR. /// * `data` - The data to write. fn write_bar(&mut self, _base: u64, _offset: u64, _data: &[u8]) {} + /// Relocates the BAR to a different address in guest address space. + fn move_bar(&mut self, _old_base: u64, _new_base: u64) {} } /// This trait defines a set of functions which can be triggered whenever a