PI spec will be updated to make it clear that this HOB should describe the stack range before going to DXE.
Therefore, we should update stack Hob in DxeLoad to reflect real stack git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4290 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -751,3 +751,33 @@ Decompress (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
UpdateStackHob (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
EFI_PEI_HOB_POINTERS Hob;
|
||||
|
||||
Hob.Raw = GetHobList ();
|
||||
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw)) != NULL) {
|
||||
if (CompareGuid (&gEfiHobMemoryAllocStackGuid, &(Hob.MemoryAllocationStack->AllocDescriptor.Name))) {
|
||||
//
|
||||
// Build a new memory allocation HOB with old stack info with EfiConventionalMemory type
|
||||
// to be reclaimed by DXE core.
|
||||
//
|
||||
BuildMemoryAllocationHob (
|
||||
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress,
|
||||
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength,
|
||||
EfiConventionalMemory
|
||||
);
|
||||
//
|
||||
// Update the BSP Stack Hob to reflect the new stack info.
|
||||
//
|
||||
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress = BaseAddress;
|
||||
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength = Length;
|
||||
break;
|
||||
}
|
||||
Hob.Raw = GET_NEXT_HOB (Hob);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user