[edk2-devel] [PATCH 2/4] OvmfPkg/PlatformPei: hoist PciBase assignment above the i440fx/q35 branching

Ard Biesheuvel ard.biesheuvel at linaro.org
Thu May 16 07:53:55 UTC 2019


On Sat, 4 May 2019 at 02:07, Laszlo Ersek <lersek at redhat.com> wrote:
>
> 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 at linaro.org>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> Cc: Jordan Justen <jordan.l.justen at intel.com>
> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1666941
> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1701710
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Laszlo Ersek <lersek at redhat.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>

> ---
>  OvmfPkg/PlatformPei/Platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
> index 5e0a15484230..9c013613a1a0 100644
> --- a/OvmfPkg/PlatformPei/Platform.c
> +++ b/OvmfPkg/PlatformPei/Platform.c
> @@ -181,6 +181,7 @@ MemMapInitialization (
>
>      TopOfLowRam = GetSystemMemorySizeBelow4gb ();
>      PciExBarBase = 0;
> +    PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
>      if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
>        //
>        // The MMCONFIG area is expected to fall between the top of low RAM and
> @@ -192,7 +193,6 @@ MemMapInitialization (
>        PciBase = (UINT32)(PciExBarBase + SIZE_256MB);
>        PciSize = 0xFC000000 - PciBase;
>      } else {
> -      PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;
>        PciSize = 0xFC000000 - PciBase;
>      }
>
> --
> 2.19.1.3.g30247aa5d201
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#40760): https://edk2.groups.io/g/devel/message/40760
Mute This Topic: https://groups.io/mt/31489697/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list