diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-18 06:09:03 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-18 06:09:03 +0000 |
commit | 0a7d0741b624ef927dce432c4ccd72a7b855732f (patch) | |
tree | 149ab567d24ea8c0c5766ed1736c1fc2dfc6135b /MdePkg | |
parent | 454e9f6593cd2d35c84e9cd445e68a2f68d6e201 (diff) | |
download | edk2-0a7d0741b624ef927dce432c4ccd72a7b855732f.zip edk2-0a7d0741b624ef927dce432c4ccd72a7b855732f.tar.gz edk2-0a7d0741b624ef927dce432c4ccd72a7b855732f.tar.bz2 |
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
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Library/PeiHobLib/HobLib.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c index f971e59..d18d355 100644 --- a/MdePkg/Library/PeiHobLib/HobLib.c +++ b/MdePkg/Library/PeiHobLib/HobLib.c @@ -254,6 +254,9 @@ BuildModuleHob ( {
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));
CopyGuid (&(Hob->MemoryAllocationHeader.Name), &gEfiHobMemoryAllocModuleGuid);
@@ -512,6 +515,9 @@ BuildStackHob ( {
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));
CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocStackGuid);
@@ -548,6 +554,9 @@ BuildBspStoreHob ( {
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));
CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocBspStoreGuid);
@@ -584,8 +593,11 @@ BuildMemoryAllocationHob ( {
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));
-
+
ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID));
Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
Hob->AllocDescriptor.MemoryLength = Length;
|