mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
UefiCpuPkg/PiSmmCpuDxeSmm: Impl GetSmmProfileData for MM
MM CPU can not use the dynamic PCD (PcdCpuSmmProfileSize), so it consumes the gMmProfileDataHobGuid memory allocation hob for SmmProfile base address & size. 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
cc996831bd
commit
502a9122a4
@ -6,3 +6,42 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
#include "PiSmmCpuCommon.h"
|
#include "PiSmmCpuCommon.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get SmmProfileData.
|
||||||
|
|
||||||
|
@param[in, out] Size Return Size of SmmProfileData.
|
||||||
|
|
||||||
|
@return Address of SmmProfileData
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_PHYSICAL_ADDRESS
|
||||||
|
GetSmmProfileData (
|
||||||
|
IN OUT UINT64 *Size
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_PEI_HOB_POINTERS SmmProfileDataHob;
|
||||||
|
|
||||||
|
ASSERT (Size != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get Smm Profile Base from Memory Allocation HOB
|
||||||
|
//
|
||||||
|
SmmProfileDataHob.Raw = GetFirstHob (EFI_HOB_TYPE_MEMORY_ALLOCATION);
|
||||||
|
while (SmmProfileDataHob.Raw != NULL) {
|
||||||
|
//
|
||||||
|
// Find gMmProfileDataHobGuid
|
||||||
|
//
|
||||||
|
if (CompareGuid (&SmmProfileDataHob.MemoryAllocation->AllocDescriptor.Name, &gMmProfileDataHobGuid)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SmmProfileDataHob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, GET_NEXT_HOB (SmmProfileDataHob));
|
||||||
|
}
|
||||||
|
|
||||||
|
ASSERT (SmmProfileDataHob.Raw != NULL);
|
||||||
|
|
||||||
|
*Size = SmmProfileDataHob.MemoryAllocation->AllocDescriptor.MemoryLength;
|
||||||
|
|
||||||
|
return SmmProfileDataHob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress;
|
||||||
|
}
|
||||||
|
@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include <Guid/SmramMemoryReserve.h>
|
#include <Guid/SmramMemoryReserve.h>
|
||||||
#include <Guid/SmmBaseHob.h>
|
#include <Guid/SmmBaseHob.h>
|
||||||
#include <Guid/MpInformation2.h>
|
#include <Guid/MpInformation2.h>
|
||||||
|
#include <Guid/MmProfileData.h>
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/IoLib.h>
|
#include <Library/IoLib.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user