From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 F108E1A1E24 for ; Thu, 27 Oct 2016 09:47:32 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 27 Oct 2016 09:47:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,553,1473145200"; d="scan'208";a="24813907" Received: from gdong1-mobl4.ccr.corp.intel.com ([10.34.84.36]) by orsmga004.jf.intel.com with ESMTP; 27 Oct 2016 09:47:32 -0700 From: gdong1 To: edk2-devel@lists.01.org Cc: maurice.ma@intel.com, prince.agyeman@intel.com, guo.dong@intel.com Date: Thu, 27 Oct 2016 09:47:26 -0700 Message-Id: <19a43b3638c30bdb720f00b852b894c0e915aebb.1477586777.git.guo.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH v3] CorebootModulePkgPkg: Expose FindCbTag API from CbParseLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 16:47:33 -0000 CbPlatformSupportLib might use FindCbTag() API to parse platform specific information. So expose this API. And add EFIAPI to all functions in CbParseLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Dong --- CorebootModulePkg/Include/Library/CbParseLib.h | 28 ++++++++++++++++++++++- CorebootModulePkg/Library/CbParseLib/CbParseLib.c | 10 ++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h b/CorebootModulePkg/Include/Library/CbParseLib.h index 064baf3..12dd4fa 100644 --- a/CorebootModulePkg/Include/Library/CbParseLib.h +++ b/CorebootModulePkg/Include/Library/CbParseLib.h @@ -2,7 +2,7 @@ This library will parse the coreboot table in memory and extract those required information. - Copyright (c) 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2016, 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 @@ -18,6 +18,24 @@ typedef RETURN_STATUS \ (*CB_MEM_INFO_CALLBACK) (UINT64 Base, UINT64 Size, UINT32 Type, VOID *Param); /** + Find coreboot record with given Tag from the memory Start in 4096 + bytes range. + + @param Start The start memory to be searched in + @param Tag The tag id to be found + + @retval NULL The Tag is not found. + @retval Others The poiter to the record found. + +**/ +VOID * +EFIAPI +FindCbTag ( + IN VOID *Start, + IN UINT32 Tag + ); + +/** Acquire the memory information from the coreboot table in memory. @param MemInfoCallback The callback routine @@ -28,6 +46,7 @@ typedef RETURN_STATUS \ **/ RETURN_STATUS +EFIAPI CbParseMemoryInfo ( IN CB_MEM_INFO_CALLBACK MemInfoCallback, IN VOID *pParam @@ -46,6 +65,7 @@ CbParseMemoryInfo ( **/ RETURN_STATUS +EFIAPI CbParseCbMemTable ( IN UINT32 TableId, IN VOID** pMemTable, @@ -64,6 +84,7 @@ CbParseCbMemTable ( **/ RETURN_STATUS +EFIAPI CbParseAcpiTable ( IN VOID** pMemTable, IN UINT32* pMemTableSize @@ -81,6 +102,7 @@ CbParseAcpiTable ( **/ RETURN_STATUS +EFIAPI CbParseSmbiosTable ( IN VOID** pMemTable, IN UINT32* pMemTableSize @@ -101,6 +123,7 @@ CbParseSmbiosTable ( **/ RETURN_STATUS +EFIAPI CbParseFadtInfo ( IN UINTN* pPmCtrlReg, IN UINTN* pPmTimerReg, @@ -125,6 +148,7 @@ CbParseFadtInfo ( **/ RETURN_STATUS +EFIAPI CbParseSerialInfo ( OUT UINT32 *pRegBase, OUT UINT32 *pRegAccessType, @@ -145,6 +169,7 @@ CbParseSerialInfo ( **/ RETURN_STATUS +EFIAPI CbParseGetCbHeader ( IN UINTN Level, IN VOID** HeaderPtr @@ -160,6 +185,7 @@ CbParseGetCbHeader ( **/ RETURN_STATUS +EFIAPI CbParseFbInfo ( IN FRAME_BUFFER_INFO* pFbInfo ); diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c index 305e38f..0909b0f 100644 --- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c +++ b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c @@ -94,6 +94,7 @@ CbCheckSum16 ( **/ VOID * +EFIAPI FindCbTag ( IN VOID *Start, IN UINT32 Tag @@ -175,6 +176,7 @@ FindCbTag ( **/ RETURN_STATUS +EFIAPI FindCbMemTable ( IN struct cbmem_root *Root, IN UINT32 TableId, @@ -237,6 +239,7 @@ FindCbMemTable ( **/ RETURN_STATUS +EFIAPI CbParseMemoryInfo ( IN CB_MEM_INFO_CALLBACK MemInfoCallback, IN VOID *pParam @@ -287,6 +290,7 @@ CbParseMemoryInfo ( **/ RETURN_STATUS +EFIAPI CbParseCbMemTable ( IN UINT32 TableId, OUT VOID **pMemTable, @@ -343,6 +347,7 @@ CbParseCbMemTable ( **/ RETURN_STATUS +EFIAPI CbParseAcpiTable ( OUT VOID **pMemTable, OUT UINT32 *pMemTableSize @@ -363,6 +368,7 @@ CbParseAcpiTable ( **/ RETURN_STATUS +EFIAPI CbParseSmbiosTable ( OUT VOID **pMemTable, OUT UINT32 *pMemTableSize @@ -386,6 +392,7 @@ CbParseSmbiosTable ( **/ RETURN_STATUS +EFIAPI CbParseFadtInfo ( OUT UINTN *pPmCtrlReg, OUT UINTN *pPmTimerReg, @@ -533,6 +540,7 @@ CbParseFadtInfo ( **/ RETURN_STATUS +EFIAPI CbParseSerialInfo ( OUT UINT32 *pRegBase, OUT UINT32 *pRegAccessType, @@ -591,6 +599,7 @@ CbParseSerialInfo ( **/ RETURN_STATUS +EFIAPI CbParseGetCbHeader ( IN UINTN Level, OUT VOID **HeaderPtr @@ -629,6 +638,7 @@ CbParseGetCbHeader ( **/ RETURN_STATUS +EFIAPI CbParseFbInfo ( OUT FRAME_BUFFER_INFO *pFbInfo ) -- 2.7.0.windows.1