summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei/Platform.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2022-12-02 14:10:04 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-12-14 17:45:41 +0000
commit4bc2c748516e5c4a8bb86093cd5e1b80a9f35c0f (patch)
treead166cda9dd858ea835195e546162790151a3f61 /OvmfPkg/PlatformPei/Platform.c
parent7dbb8a24d1a3403f85d959bc1234b9f4a92bfbf0 (diff)
downloadedk2-4bc2c748516e5c4a8bb86093cd5e1b80a9f35c0f.tar.gz
edk2-4bc2c748516e5c4a8bb86093cd5e1b80a9f35c0f.tar.bz2
edk2-4bc2c748516e5c4a8bb86093cd5e1b80a9f35c0f.zip
OvmfPkg/PlatformPei: Verification: stop using mPlatformInfoHob
Stop using the mPlatformInfoHob global variable in S3Verification() and Q35BoardVerification() functions. Pass a pointer to the PlatformInfoHob instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Tom Lendacky <thomas.lendacky@amd.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'OvmfPkg/PlatformPei/Platform.c')
-rw-r--r--OvmfPkg/PlatformPei/Platform.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 7f3a260926..d8c4499804 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -231,13 +231,14 @@ ReserveEmuVariableNvStore (
ASSERT_RETURN_ERROR (PcdStatus);
}
+STATIC
VOID
S3Verification (
- VOID
+ IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob
)
{
#if defined (MDE_CPU_X64)
- if (mPlatformInfoHob.SmmSmramRequire && mPlatformInfoHob.S3Supported) {
+ if (PlatformInfoHob->SmmSmramRequire && PlatformInfoHob->S3Supported) {
DEBUG ((
DEBUG_ERROR,
"%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n",
@@ -260,12 +261,13 @@ S3Verification (
#endif
}
+STATIC
VOID
Q35BoardVerification (
- VOID
+ IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob
)
{
- if (mPlatformInfoHob.HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
+ if (PlatformInfoHob->HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
return;
}
@@ -274,7 +276,7 @@ Q35BoardVerification (
"%a: no TSEG (SMRAM) on host bridge DID=0x%04x; "
"only DID=0x%04x (Q35) is supported\n",
__FUNCTION__,
- mPlatformInfoHob.HostBridgeDevId,
+ PlatformInfoHob->HostBridgeDevId,
INTEL_Q35_MCH_DEVICE_ID
));
ASSERT (FALSE);
@@ -345,7 +347,7 @@ InitializePlatform (
ASSERT_EFI_ERROR (Status);
}
- S3Verification ();
+ S3Verification (&mPlatformInfoHob);
BootModeInitialization (&mPlatformInfoHob);
//
@@ -357,7 +359,7 @@ InitializePlatform (
MaxCpuCountInitialization (&mPlatformInfoHob);
if (mPlatformInfoHob.SmmSmramRequire) {
- Q35BoardVerification ();
+ Q35BoardVerification (&mPlatformInfoHob);
Q35TsegMbytesInitialization (&mPlatformInfoHob);
Q35SmramAtDefaultSmbaseInitialization (&mPlatformInfoHob);
}