UefiCpuPkg/PiSmmCpuDxeSmm: Impl GetAcpiS3EnableFlag for MM

MM CPU can not use the dynamic PCD (PcdAcpiS3Enable), so, it
consumes the gMmAcpiS3EnableHobGuid to get ACPI S3 enable flag.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Dun Tan <dun.tan@intel.com>
Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
Cc: Yuanhao Xie <yuanhao.xie@intel.com>
This commit is contained in:
Jiaxin Wu 2024-06-26 12:43:51 +08:00 committed by mergify[bot]
parent 502a9122a4
commit 1f22b96b11
2 changed files with 29 additions and 0 deletions

View File

@ -29,6 +29,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/SmmBaseHob.h>
#include <Guid/MpInformation2.h>
#include <Guid/MmProfileData.h>
#include <Guid/MmAcpiS3Enable.h>
#include <Library/BaseLib.h>
#include <Library/IoLib.h>

View File

@ -8,3 +8,31 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "PiSmmCpuCommon.h"
/**
Get ACPI S3 enable flag.
**/
VOID
GetAcpiS3EnableFlag (
VOID
)
{
EFI_HOB_GUID_TYPE *GuidHob;
MM_ACPI_S3_ENABLE *MmAcpiS3EnableHob;
MmAcpiS3EnableHob = NULL;
//
// Get MM_ACPI_S3_ENABLE for Standalone MM init.
//
GuidHob = GetFirstGuidHob (&gMmAcpiS3EnableHobGuid);
ASSERT (GuidHob != NULL);
if (GuidHob != NULL) {
MmAcpiS3EnableHob = GET_GUID_HOB_DATA (GuidHob);
}
if (MmAcpiS3EnableHob != NULL) {
mAcpiS3Enable = MmAcpiS3EnableHob->AcpiS3Enable;
}
}