diff options
author | Liming Gao <liming.gao@intel.com> | 2014-01-02 02:38:32 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-01-02 02:38:32 +0000 |
commit | d958a7e0bca33102c27eaa86b07de196b7bba098 (patch) | |
tree | 2f735eec49d37f6380d8601d7e376bc2c752a3eb /MdeModulePkg | |
parent | 91403ce938695e2ea2f27ac1ce796812a0aa22e8 (diff) | |
download | edk2-d958a7e0bca33102c27eaa86b07de196b7bba098.zip edk2-d958a7e0bca33102c27eaa86b07de196b7bba098.tar.gz edk2-d958a7e0bca33102c27eaa86b07de196b7bba098.tar.bz2 |
Correct the RemainingPages calculation in PEI AllocatePages service.
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15035 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index c7a06a3..10f21d5 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -1,7 +1,7 @@ /** @file
EFI PEI Core memory services
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -182,7 +182,7 @@ PeiAllocatePages ( //
// Verify that there is sufficient memory to satisfy the allocation
//
- RemainingPages = EFI_SIZE_TO_PAGES ((UINTN) (*FreeMemoryTop - *FreeMemoryBottom));
+ RemainingPages = (UINTN)(*FreeMemoryTop - *FreeMemoryBottom) >> EFI_PAGE_SHIFT;
//
// For page allocation, the overhead sizeof (EFI_HOB_MEMORY_ALLOCATION) needs one extra page.
// So the number of remaining pages needs to be greater than that of the request pages.
|