Skip to content

Commit 49d4753

Browse files
kuqin12mergify[bot]
authored andcommitted
MdeModulePkg: CoreDxe: Handle multilple MemoryAllocationModules
The current implementation from Dxe/Image/Image.c does not handle the configuration where there might be multiple MemoryAllocationModules. Given that the `ModuleName` is included in the hob data and used for targetting the consumer, DXE core should specify the GUID when looking up for its own MemoryAllocationModule. This change adds a check to ensure the located hob is targetting DXE core. Signed-off-by: Kun Qin <[email protected]>
1 parent a3a180e commit 49d4753

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

MdeModulePkg/Core/Dxe/Image/Image.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ CoreInitializeImageServices (
200200
//
201201
// Find Dxe Core HOB
202202
//
203-
break;
203+
if (CompareGuid (&DxeCoreHob.MemoryAllocationModule->ModuleName, &gEfiCallerIdGuid)) {
204+
break;
205+
}
204206
}
205207

206208
DxeCoreHob.Raw = GET_NEXT_HOB (DxeCoreHob);

MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,9 @@ RegisterDxeCore (
549549
//
550550
// Find Dxe Core HOB
551551
//
552-
break;
552+
if (CompareGuid (&DxeCoreHob.MemoryAllocationModule->ModuleName, &gEfiCallerIdGuid)) {
553+
break;
554+
}
553555
}
554556

555557
DxeCoreHob.Raw = GET_NEXT_HOB (DxeCoreHob);

0 commit comments

Comments
 (0)