26 ASSERT (Size !=
NULL);
31 SmmProfileDataHob.Raw =
GetFirstHob (EFI_HOB_TYPE_MEMORY_ALLOCATION);
32 while (SmmProfileDataHob.Raw !=
NULL) {
40 SmmProfileDataHob.Raw =
GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, GET_NEXT_HOB (SmmProfileDataHob));
43 if (SmmProfileDataHob.Raw ==
NULL) {
68 Hob.Raw =
GetFirstHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR);
69 while (Hob.Raw !=
NULL) {
70 if ((Address >= Hob.ResourceDescriptor->
PhysicalStart) && (Address < Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->
ResourceLength)) {
78 Hob.Raw = GET_NEXT_HOB (Hob);
79 Hob.Raw =
GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw);
100 Hob.Raw =
GetFirstHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR);
101 while (Hob.Raw !=
NULL) {
102 if ((Address >= Hob.ResourceDescriptor->
PhysicalStart) && (Address < Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->
ResourceLength)) {
106 Hob.Raw = GET_NEXT_HOB (Hob);
107 Hob.Raw =
GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw);
129 ASSERT (MemoryRegion !=
NULL && MemoryRegionCount !=
NULL);
131 *MemoryRegion =
NULL;
132 *MemoryRegionCount = 0;
138 Hob.Raw =
GetFirstHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR);
139 while (Hob.Raw !=
NULL) {
148 Hob.Raw = GET_NEXT_HOB (Hob);
149 Hob.Raw =
GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw);
152 *MemoryRegionCount = Count;
155 ASSERT (*MemoryRegion !=
NULL);
158 Hob.Raw =
GetFirstHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR);
159 while (Hob.Raw !=
NULL) {
161 ASSERT (Index < Count);
162 (*MemoryRegion)[Index].Base = Hob.ResourceDescriptor->
PhysicalStart;
163 (*MemoryRegion)[Index].Length = Hob.ResourceDescriptor->
ResourceLength;
164 (*MemoryRegion)[Index].Attribute = EFI_MEMORY_XP;
165 if (Hob.ResourceDescriptor->
ResourceAttribute == EFI_RESOURCE_ATTRIBUTE_READ_ONLY_PROTECTED) {
166 (*MemoryRegion)[Index].Attribute |= EFI_MEMORY_RO;
172 Hob.Raw = GET_NEXT_HOB (Hob);
173 Hob.Raw =
GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw);
208 IN UINT8 PhysicalAddressBits,
VOID *EFIAPI GetFirstHob(IN UINT16 Type)
VOID *EFIAPI GetNextHob(IN UINT16 Type, IN CONST VOID *HobStart)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
#define MM_RESOURCE_ATTRIBUTE_LOGGING
VOID BuildMemoryMapFromResDescHobs(OUT MM_CPU_MEMORY_REGION **MemoryRegion, OUT UINTN *MemoryRegionCount)
BOOLEAN IsNonMmramLoggingAddress(IN UINT64 Address)
VOID CreateExtendedProtectionRange(OUT MM_CPU_MEMORY_REGION **MemoryRegion, OUT UINTN *MemoryRegionCount)
EFI_PHYSICAL_ADDRESS GetSmmProfileData(IN OUT UINT64 *Size)
VOID CreateNonMmramMemMap(IN UINT8 PhysicalAddressBits, OUT MM_CPU_MEMORY_REGION **MemoryRegion, OUT UINTN *MemoryRegionCount)
BOOLEAN IsSmmCommBufferForbiddenAddress(IN UINT64 Address)
UINT64 EFI_PHYSICAL_ADDRESS
EFI_PHYSICAL_ADDRESS MemoryBaseAddress
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor
EFI_PHYSICAL_ADDRESS PhysicalStart
EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute