]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PlatformPei: hoist PciBase assignment above the i440fx/q35 branching
authorLaszlo Ersek <lersek@redhat.com>
Tue, 22 Jan 2019 19:44:47 +0000 (20:44 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 16 May 2019 19:18:52 +0000 (21:18 +0200)
In the MemMapInitialization() function, we currently assign PciBase
different values, on both branches of the board type check. Hoist the
PciBase assignment from the i440fx branch in front of the "if". This is a
no-op for the i440fx branch. On the q35 branch, we overwrite this value,
hence the change is a no-op on q35 as well.

This is another refactoring for simplifying the rest of this series.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1814
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1666941
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1701710
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
OvmfPkg/PlatformPei/Platform.c

index 5e0a15484230607876334c14e9e1c1db093b1d9e..9c013613a1a0b35517bd5b7da039a5ede5c304b8 100644 (file)
@@ -181,6 +181,7 @@ MemMapInitialization (
 \r
     TopOfLowRam = GetSystemMemorySizeBelow4gb ();\r
     PciExBarBase = 0;\r
+    PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;\r
     if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {\r
       //\r
       // The MMCONFIG area is expected to fall between the top of low RAM and\r
@@ -192,7 +193,6 @@ MemMapInitialization (
       PciBase = (UINT32)(PciExBarBase + SIZE_256MB);\r
       PciSize = 0xFC000000 - PciBase;\r
     } else {\r
-      PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;\r
       PciSize = 0xFC000000 - PciBase;\r
     }\r
 \r