[edk2] [PATCH 3/5] MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages

Star Zeng posted 5 patches 7 years, 4 months ago
[edk2] [PATCH 3/5] MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages
Posted by Star Zeng 7 years, 4 months ago
Update Free(Aligned)Pages to use PeiServicesFreePages.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 .../Library/PeiMemoryAllocationLib/MemoryAllocationLib.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
index a6cce6c23550..37273dde561a 100644
--- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
@@ -2,7 +2,7 @@
   Support routines for memory allocation routines 
   based on PeiService for PEI phase drivers.
 
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2017, 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        
@@ -148,10 +148,11 @@ FreePages (
   IN UINTN  Pages
   )
 {
+  EFI_STATUS  Status;
+
   ASSERT (Pages != 0);
-  //
-  // PEI phase does not support to free pages, so leave it as NOP.
-  //
+  Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
+  ASSERT_EFI_ERROR (Status);
 }
 
 /**
@@ -444,10 +445,11 @@ FreeAlignedPages (
   IN UINTN  Pages
   )
 {
+  EFI_STATUS  Status;
+
   ASSERT (Pages != 0);
-  //
-  // PEI phase does not support to free pages, so leave it as NOP.
-  //
+  Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
+  ASSERT_EFI_ERROR (Status);
 }
 
 /**
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel