summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei/MemTypeInfo.c
diff options
context:
space:
mode:
authorMin Xu <min.m.xu@intel.com>2022-03-06 10:20:36 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-02 08:15:12 +0000
commit9a9b33b3d6f58c306e8352dd8b685b5b147727a3 (patch)
tree9aa556ede5fbcb5a2f5ed03b76e0df6fac340a5f /OvmfPkg/PlatformPei/MemTypeInfo.c
parent102cafedade13a718088e370ca42e0b87d10db71 (diff)
downloadedk2-9a9b33b3d6f58c306e8352dd8b685b5b147727a3.tar.gz
edk2-9a9b33b3d6f58c306e8352dd8b685b5b147727a3.tar.bz2
edk2-9a9b33b3d6f58c306e8352dd8b685b5b147727a3.zip
OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 The intention of PlatformInitLib is to extract the common function used in OvmfPkg/PlatformPei. This lib will be used not only in PEI phase but also in SEC phase. SEC phase cannot use global variables between different functions. So PlatformInfoHob is created to hold the informations shared between functions. For example, HostBridgeDevId corespond to mHostBridgeDevId in PlatformPei. In this patch we will first move below global variables to PlatformInfoHob. - mBootMode - mS3Supported - mPhysMemAddressWidth - mMaxCpuCount - mHostBridgeDevId - mQ35SmramAtDefaultSmbase - mQemuUc32Base - mS3AcpiReservedMemorySize - mS3AcpiReservedMemoryBase PlatformInfoHob also holds other information, for example, PciIoBase / PciIoSize. This is because in SEC phase, PcdSetxxx doesn't work. So we will restruct the functions which set PCDs into two, one for PlatformInfoLib, one for PlatformPei. So in this patch we first move global variables and PCDs to PlatformInfoHob. All the changes are in OvmfPkg/PlatformPei. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Sebastien Boeuf <sebastien.boeuf@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
Diffstat (limited to 'OvmfPkg/PlatformPei/MemTypeInfo.c')
-rw-r--r--OvmfPkg/PlatformPei/MemTypeInfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/MemTypeInfo.c
index fc5ccfaf11..c8fcf17326 100644
--- a/OvmfPkg/PlatformPei/MemTypeInfo.c
+++ b/OvmfPkg/PlatformPei/MemTypeInfo.c
@@ -208,7 +208,7 @@ MemTypeInfoInitialization (
{
EFI_STATUS Status;
- if (!FeaturePcdGet (PcdSmmSmramRequire)) {
+ if (!mPlatformInfoHob.SmmSmramRequire) {
//
// EFI_PEI_READ_ONLY_VARIABLE2_PPI will never be available; install
// the default memory type information HOB right away.