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.adb b/common/hw-pci-mmconf.adb
index 180f2d7..f7da219 100644
--- a/common/hw-pci-mmconf.adb
+++ b/common/hw-pci-mmconf.adb
@@ -12,8 +12,6 @@
-- GNU General Public License for more details.
--
-with HW.Config;
-
package body HW.PCI.MMConf
with
Refined_State =>
@@ -24,7 +22,7 @@
is
Default_Base_Address : constant Word64 :=
- Calc_Base_Address (Config.Default_MMConf_Base, Dev);
+ Calc_Base_Address (MMConf_Base, Dev);
type Index16 is new Index range 0 .. Index'Last / 2;
type Index32 is new Index range 0 .. Index'Last / 4;