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/hw-pci-dev.ads b/common/hw-pci-dev.ads
index 5b20aa1..130515c 100644
--- a/common/hw-pci-dev.ads
+++ b/common/hw-pci-dev.ads
@@ -14,6 +14,7 @@
generic
Dev : PCI.Address := (0, 0, 0);
+ MMConf_Base : Word64 := 0;
package HW.PCI.Dev
with
Abstract_State => (Address_State, (PCI_State with External)),
@@ -50,7 +51,9 @@
pragma Warnings (GNATprove, Off, "unused variable ""MMConf_Base""*",
Reason => "Used for a common interface");
- procedure Initialize (Success : out Boolean; MMConf_Base : Word64 := 0);
+ procedure Initialize
+ (Success : out Boolean;
+ MMConf_Base : in Word64 := PCI.Dev.MMConf_Base);
pragma Warnings (GNATprove, On, "unused variable ""MMConf_Base""*");
end HW.PCI.Dev;