From nobody Fri Dec 27 03:06:07 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1503072071180845.7850798536488; Fri, 18 Aug 2017 09:01:11 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9EE0A21CFA5FC; Fri, 18 Aug 2017 08:58:37 -0700 (PDT) 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 4A6392095DFE9 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:49 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.22]) by orsmga003.jf.intel.com with ESMTP; 18 Aug 2017 09:00:48 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,393,1498546800"; d="scan'208";a="1005243104" From: Star Zeng To: edk2-devel@lists.01.org Date: Sat, 19 Aug 2017 00:00:34 +0800 Message-Id: <1503072038-134760-2-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: [edk2] [PATCH 1/5] MdePkg PiPeiCis.h: Add FreePages definition 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: , Cc: Liming Gao , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Follow PI 1.6 spec to add FreePages definition and comments for AllocatePages that will support pre permanent memory page allocation. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng --- MdePkg/Include/Pi/PiPeiCis.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/MdePkg/Include/Pi/PiPeiCis.h b/MdePkg/Include/Pi/PiPeiCis.h index eda814a8701a..aebe3eacf442 100644 --- a/MdePkg/Include/Pi/PiPeiCis.h +++ b/MdePkg/Include/Pi/PiPeiCis.h @@ -452,6 +452,11 @@ EFI_STATUS The purpose of the service is to publish an interface that allows=20 PEIMs to allocate memory ranges that are managed by the PEI Foundation. =20 + Prior to InstallPeiMemory() being called, PEI will allocate pages from t= he heap. + After InstallPeiMemory() is called, PEI will allocate pages within the r= egion + of memory provided by InstallPeiMemory() service in a best-effort fashio= n. + Location-specific allocations are not managed by the PEI foundation code. + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES tab= le published by the PEI Foundation. @param MemoryType The type of memory to allocate. @param Pages The number of contiguous 4 KB pages to allocate. @@ -475,6 +480,27 @@ EFI_STATUS ); =20 /** + Frees memory pages. + + @param[in] PeiServices An indirect pointer to the EFI_PEI_SERVICE= S table published by the PEI Foundation. + @param[in] Memory The base physical address of the pages to = be freed. + @param[in] Pages The number of contiguous 4 KB pages to fre= e. + + @retval EFI_SUCCESS The requested pages were freed. + @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pa= ges is invalid. + @retval EFI_NOT_FOUND The requested memory pages were not alloca= ted with + AllocatePages(). + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FREE_PAGES) ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_PHYSICAL_ADDRESS Memory, + IN UINTN Pages + ); + +/** The purpose of this service is to publish an interface that=20 allows PEIMs to allocate memory ranges that are managed by the PEI Found= ation. =20 @@ -929,6 +955,7 @@ struct _EFI_PEI_SERVICES { EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3; EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2; EFI_PEI_RESET2_SYSTEM ResetSystem2; + EFI_PEI_FREE_PAGES FreePages; }; =20 =20 --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel