summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-08 03:57:04 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-08 03:57:04 +0000
commit30c8f8616d9f2c764e4b8c3566bef4f562115005 (patch)
treecad63742fb7dae15a2af4c2cd0ba1e33c1bd3b37 /MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
parentf942f107607e18944bd44f1d223670d190156f2b (diff)
downloadedk2-platforms-30c8f8616d9f2c764e4b8c3566bef4f562115005.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Core/DxeIplPeim/DxeLoad.c')
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeLoad.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index 28c9ececd2..d593e30c74 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -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);
+ }
+}