pci direct: Allow a preset MMConf address per `Dev` instance
In virtualized environments (e.g. PCI pass-through), it's possible
that the MMConf/ECAM space might not be fully mapped into the guest,
so allow to override it per device.
Change-Id: I2447cec8e413e746f492c0e32126b34a7bfb2195
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/libhwbase/+/550
Tested-by: Ada SPARK <gnatbot@sourcearcade.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
diff --git a/common/linux/hw-pci-dev.adb b/common/linux/hw-pci-dev.adb
index 0017abf..841bbf9 100644
--- a/common/linux/hw-pci-dev.adb
+++ b/common/linux/hw-pci-dev.adb
@@ -142,7 +142,7 @@
File.Size (Length, Path);
end Resource_Size;
- procedure Initialize (Success : out Boolean; MMConf_Base : Word64 := 0)
+ procedure Initialize (Success : out Boolean; MMConf_Base : Word64 := PCI.Dev.MMConf_Base)
is
Addr : Word64;
Path : String (1 .. 43) := "/sys/devices/pci0000:xx/0000:xx:xx.x/config";