]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages
authorStar Zeng <star.zeng@intel.com>
Fri, 3 Mar 2017 08:45:37 +0000 (16:45 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 4 Sep 2017 05:45:47 +0000 (13:45 +0800)
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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c

index a6cce6c23550788d905b10007822ab61a516d1ca..37273dde561ac45e889e8ecc33c0ef089349faf2 100644 (file)
@@ -2,7 +2,7 @@
   Support routines for memory allocation routines \r
   based on PeiService for PEI phase drivers.\r
 \r
   Support routines for memory allocation routines \r
   based on PeiService for PEI phase drivers.\r
 \r
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -148,10 +148,11 @@ FreePages (
   IN UINTN  Pages\r
   )\r
 {\r
   IN UINTN  Pages\r
   )\r
 {\r
+  EFI_STATUS  Status;\r
+\r
   ASSERT (Pages != 0);\r
   ASSERT (Pages != 0);\r
-  //\r
-  // PEI phase does not support to free pages, so leave it as NOP.\r
-  //\r
+  Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);\r
+  ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
@@ -444,10 +445,11 @@ FreeAlignedPages (
   IN UINTN  Pages\r
   )\r
 {\r
   IN UINTN  Pages\r
   )\r
 {\r
+  EFI_STATUS  Status;\r
+\r
   ASSERT (Pages != 0);\r
   ASSERT (Pages != 0);\r
-  //\r
-  // PEI phase does not support to free pages, so leave it as NOP.\r
-  //\r
+  Status = PeiServicesFreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);\r
+  ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r