From cc6efda7770b8cabea3ae8c6054d47c4a8e229c3 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 2 Dec 2022 14:10:02 +0100 Subject: OvmfPkg/PlatformPei: MemTypeInfo: stop using mPlatformInfoHob Stop using the mPlatformInfoHob global variable in MemTypeInfoInitialization() function. Pass a pointer to the PlatformInfoHob instead. Signed-off-by: Gerd Hoffmann Tested-by: Tom Lendacky Acked-by: Ard Biesheuvel --- OvmfPkg/PlatformPei/MemTypeInfo.c | 4 ++-- OvmfPkg/PlatformPei/Platform.c | 2 +- OvmfPkg/PlatformPei/Platform.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OvmfPkg/PlatformPei') diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/MemTypeInfo.c index c8fcf17..eb37feb 100644 --- a/OvmfPkg/PlatformPei/MemTypeInfo.c +++ b/OvmfPkg/PlatformPei/MemTypeInfo.c @@ -203,12 +203,12 @@ STATIC CONST EFI_PEI_NOTIFY_DESCRIPTOR mReadOnlyVariable2Notify = { VOID MemTypeInfoInitialization ( - VOID + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { EFI_STATUS Status; - if (!mPlatformInfoHob.SmmSmramRequire) { + if (!PlatformInfoHob->SmmSmramRequire) { // // EFI_PEI_READ_ONLY_VARIABLE2_PPI will never be available; install // the default memory type information HOB right away. diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 4cd77fd..85b47e7 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -373,7 +373,7 @@ InitializePlatform ( } PeiFvInitialization (&mPlatformInfoHob); - MemTypeInfoInitialization (); + MemTypeInfoInitialization (&mPlatformInfoHob); MemMapInitialization (&mPlatformInfoHob); NoexecDxeInitialization (); } diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h index d0c673c..0c0558f 100644 --- a/OvmfPkg/PlatformPei/Platform.h +++ b/OvmfPkg/PlatformPei/Platform.h @@ -67,7 +67,7 @@ PeiFvInitialization ( VOID MemTypeInfoInitialization ( - VOID + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ); VOID -- cgit v1.1