From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0948A2095B9D7 for ; Fri, 18 Aug 2017 08:58:36 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Aug 2017 09:00:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,393,1498546800"; d="scan'208";a="1005243130" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.22]) by orsmga003.jf.intel.com with ESMTP; 18 Aug 2017 09:00:50 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Liming Gao Date: Sat, 19 Aug 2017 00:00:36 +0800 Message-Id: <1503072038-134760-4-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1503072038-134760-1-git-send-email-star.zeng@intel.com> References: <1503072038-134760-1-git-send-email-star.zeng@intel.com> Subject: [PATCH 3/5] MdePkg PeiMemoryAllocationLib: Update Free(Aligned)Pages X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2017 15:58:37 -0000 Update Free(Aligned)Pages to use PeiServicesFreePages. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- .../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.
+ 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.7.0.windows.1