mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 05:34:31 +02:00
UefiCpuPkg/PiSmmCpuDxeSmm: Use SMM Variable to set SmmProfileBase
MM can not use the gRT service, so use SMM Variable protocol to set SmmProfileBase instead of gRT->SetVariable for both SMM and MM. 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:
parent
c8a1295d3e
commit
89fe9c5d79
@ -20,6 +20,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include <Protocol/SmmCpuService.h>
|
#include <Protocol/SmmCpuService.h>
|
||||||
#include <Protocol/SmmMemoryAttribute.h>
|
#include <Protocol/SmmMemoryAttribute.h>
|
||||||
#include <Protocol/MmMp.h>
|
#include <Protocol/MmMp.h>
|
||||||
|
#include <Protocol/SmmVariable.h>
|
||||||
|
|
||||||
#include <Guid/AcpiS3Context.h>
|
#include <Guid/AcpiS3Context.h>
|
||||||
#include <Guid/MemoryAttributesTable.h>
|
#include <Guid/MemoryAttributesTable.h>
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
gEfiMmMpProtocolGuid ## PRODUCES
|
gEfiMmMpProtocolGuid ## PRODUCES
|
||||||
gEdkiiSmmCpuRendezvousProtocolGuid ## PRODUCES
|
gEdkiiSmmCpuRendezvousProtocolGuid ## PRODUCES
|
||||||
gEfiMpServiceProtocolGuid ## CONSUMES
|
gEfiMpServiceProtocolGuid ## CONSUMES
|
||||||
|
gEfiSmmVariableProtocolGuid ## CONSUMES
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiAcpiVariableGuid ## SOMETIMES_CONSUMES ## HOB # it is used for S3 boot.
|
gEfiAcpiVariableGuid ## SOMETIMES_CONSUMES ## HOB # it is used for S3 boot.
|
||||||
|
@ -753,16 +753,25 @@ InitSmmProfileCallBack (
|
|||||||
IN EFI_HANDLE Handle
|
IN EFI_HANDLE Handle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_SMM_VARIABLE_PROTOCOL *SmmProfileVariable;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Locate SmmVariableProtocol.
|
||||||
|
//
|
||||||
|
Status = gMmst->MmLocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **)&SmmProfileVariable);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Save to variable so that SMM profile data can be found.
|
// Save to variable so that SMM profile data can be found.
|
||||||
//
|
//
|
||||||
gRT->SetVariable (
|
SmmProfileVariable->SmmSetVariable (
|
||||||
SMM_PROFILE_NAME,
|
SMM_PROFILE_NAME,
|
||||||
&gEfiCallerIdGuid,
|
&gEfiCallerIdGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof (mSmmProfileBase),
|
sizeof (mSmmProfileBase),
|
||||||
&mSmmProfileBase
|
&mSmmProfileBase
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get Software SMI from FADT
|
// Get Software SMI from FADT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user