mirror of https://github.com/acidanthera/audk.git
The BaseAddress and Length should be align PAGE according to PI specification for EFI_MEMORY_ALLOCATION_HOB
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4162 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
454e9f6593
commit
0a7d0741b6
|
@ -224,7 +224,7 @@ DxeLoadCore (
|
||||||
BuildModuleHob (
|
BuildModuleHob (
|
||||||
&DxeCoreFileName,
|
&DxeCoreFileName,
|
||||||
DxeCoreAddress,
|
DxeCoreAddress,
|
||||||
DxeCoreSize,
|
EFI_SIZE_TO_PAGES ((UINT32) DxeCoreSize) * EFI_PAGE_SIZE,
|
||||||
DxeCoreEntryPoint
|
DxeCoreEntryPoint
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ Returns:
|
||||||
//
|
//
|
||||||
BuildMemoryAllocationHob (
|
BuildMemoryAllocationHob (
|
||||||
Hob.HandoffInformationTable->EfiFreeMemoryTop,
|
Hob.HandoffInformationTable->EfiFreeMemoryTop,
|
||||||
Pages * EFI_PAGE_SIZE + Offset,
|
Pages * EFI_PAGE_SIZE,
|
||||||
MemoryType
|
MemoryType
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -254,6 +254,9 @@ BuildModuleHob (
|
||||||
{
|
{
|
||||||
EFI_HOB_MEMORY_ALLOCATION_MODULE *Hob;
|
EFI_HOB_MEMORY_ALLOCATION_MODULE *Hob;
|
||||||
|
|
||||||
|
ASSERT (((MemoryAllocationModule & (EFI_PAGE_SIZE - 1)) == 0) &&
|
||||||
|
((ModuleLength & (EFI_PAGE_SIZE - 1)) == 0));
|
||||||
|
|
||||||
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE));
|
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE));
|
||||||
|
|
||||||
CopyGuid (&(Hob->MemoryAllocationHeader.Name), &gEfiHobMemoryAllocModuleGuid);
|
CopyGuid (&(Hob->MemoryAllocationHeader.Name), &gEfiHobMemoryAllocModuleGuid);
|
||||||
|
@ -512,6 +515,9 @@ BuildStackHob (
|
||||||
{
|
{
|
||||||
EFI_HOB_MEMORY_ALLOCATION_STACK *Hob;
|
EFI_HOB_MEMORY_ALLOCATION_STACK *Hob;
|
||||||
|
|
||||||
|
ASSERT (((BaseAddress & (EFI_PAGE_SIZE - 1)) == 0) &&
|
||||||
|
((Length & (EFI_PAGE_SIZE - 1)) == 0));
|
||||||
|
|
||||||
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_STACK));
|
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_STACK));
|
||||||
|
|
||||||
CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocStackGuid);
|
CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocStackGuid);
|
||||||
|
@ -548,6 +554,9 @@ BuildBspStoreHob (
|
||||||
{
|
{
|
||||||
EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *Hob;
|
EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *Hob;
|
||||||
|
|
||||||
|
ASSERT (((BaseAddress & (EFI_PAGE_SIZE - 1)) == 0) &&
|
||||||
|
((Length & (EFI_PAGE_SIZE - 1)) == 0));
|
||||||
|
|
||||||
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_BSP_STORE));
|
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION_BSP_STORE));
|
||||||
|
|
||||||
CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocBspStoreGuid);
|
CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocBspStoreGuid);
|
||||||
|
@ -584,6 +593,9 @@ BuildMemoryAllocationHob (
|
||||||
{
|
{
|
||||||
EFI_HOB_MEMORY_ALLOCATION *Hob;
|
EFI_HOB_MEMORY_ALLOCATION *Hob;
|
||||||
|
|
||||||
|
ASSERT (((BaseAddress & (EFI_PAGE_SIZE - 1)) == 0) &&
|
||||||
|
((Length & (EFI_PAGE_SIZE - 1)) == 0));
|
||||||
|
|
||||||
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION));
|
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION));
|
||||||
|
|
||||||
ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID));
|
ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID));
|
||||||
|
|
Loading…
Reference in New Issue