From 2132ef05c47bf455eb1da8d3377a29baf0dd64a7 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Fri, 3 Mar 2017 16:45:37 +0800 Subject: [PATCH] MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages Update Free(Aligned)Pages to use PeiServicesFreePages. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Liming Gao --- .../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 a6cce6c235..37273dde56 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.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
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.39.2