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-mmconf.ads b/common/hw-pci-mmconf.ads
index 597ebfa..7a3777d 100644
--- a/common/hw-pci-mmconf.ads
+++ b/common/hw-pci-mmconf.ads
@@ -13,12 +13,14 @@
--
with System;
+with HW.Config;
with HW.MMIO_Range;
pragma Elaborate_All (HW.MMIO_Range);
generic
Dev : Address := (0, 0, 0);
+ MMConf_Base : Word64 := Config.Default_MMConf_Base;
package HW.PCI.MMConf
with
Abstract_State => (Address_State, (PCI_State with External)),