From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.17731.1577328951776771421 for ; Wed, 25 Dec 2019 18:55:52 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: ethan.tsao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Dec 2019 18:55:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,357,1571727600"; d="scan'208";a="419352460" Received: from unknown (HELO ethantsa-MOBL1.gar.corp.intel.com) ([10.5.240.208]) by fmsmga006.fm.intel.com with ESMTP; 25 Dec 2019 18:55:50 -0800 From: "Ethan Tsao" To: devel@edk2.groups.io Cc: Ray Ni , Rangasai V Chaganty Subject: [Patch V4] IntelSiliconPkg/Include/Library:Add ConfigBlockLib.h Date: Thu, 26 Dec 2019 10:55:33 +0800 Message-Id: <20191226025533.13480-1-ethan.tsao@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2318 Move ConfigBlockLib.h and ConfigBlock.h to InstelSiliconPkg and remove all other ConfigBlockLib.h and ConfigBlock.h Signed-off-by: Ethan Tsao Cc: Ray Ni Cc: Rangasai V Chaganty --- Silicon/Intel/CoffeelakeSiliconPkg/CoffeelakeSiliconPkg.dsc | 2 +- Silicon/Intel/IntelSiliconPkg/Include/ConfigBlock.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Silicon/Intel/{CoffeelakeSiliconPkg => IntelSiliconPkg}/Include/Library/ConfigBlockLib.h | 0 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 4 ++++ Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 1 + Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf | 2 +- Silicon/Intel/KabylakeSiliconPkg/Include/Library/ConfigBlockLib.h | 64 ---------------------------------------------------------------- 7 files changed, 60 insertions(+), 66 deletions(-) diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/CoffeelakeSiliconPkg.dsc b/Silicon/Intel/CoffeelakeSiliconPkg/CoffeelakeSiliconPkg.dsc index 37c77d8f63..702a833cc4 100644 --- a/Silicon/Intel/CoffeelakeSiliconPkg/CoffeelakeSiliconPkg.dsc +++ b/Silicon/Intel/CoffeelakeSiliconPkg/CoffeelakeSiliconPkg.dsc @@ -147,7 +147,7 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate|0 # Silicon Init Common Library # !include $(PLATFORM_SI_PACKAGE)/SiPkgCommonLib.dsc -ConfigBlockLib|ClientSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf +ConfigBlockLib|IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf PchTraceHubInitLib|ClientSiliconPkg/Library/BasePchTraceHubInitLib/BasePchTraceHubInitLib.inf [LibraryClasses.IA32] diff --git a/Silicon/Intel/IntelSiliconPkg/Include/ConfigBlock.h b/Silicon/Intel/IntelSiliconPkg/Include/ConfigBlock.h new file mode 100644 index 0000000000..d0e3d94418 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Include/ConfigBlock.h @@ -0,0 +1,53 @@ +/** @file + Header file for Config Block Lib implementation + + Copyright (c) 2019 Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _CONFIG_BLOCK_H_ +#define _CONFIG_BLOCK_H_ + +#include +#include +#include +#include + +#pragma pack (push,1) + +/// +/// Config Block Header +/// +typedef struct _CONFIG_BLOCK_HEADER { + EFI_HOB_GUID_TYPE GuidHob; ///< Offset 0-23 GUID extension HOB header + UINT8 Revision; ///< Offset 24 Revision of this config block + UINT8 Attributes; ///< Offset 25 The main revision for config block + UINT8 Reserved[2]; ///< Offset 26-27 Reserved for future use +} CONFIG_BLOCK_HEADER; + +/// +/// Config Block +/// +typedef struct _CONFIG_BLOCK { + CONFIG_BLOCK_HEADER Header; ///< Offset 0-27 Header of config block + // + // Config Block Data + // +} CONFIG_BLOCK; + +/// +/// Config Block Table Header +/// +typedef struct _CONFIG_BLOCK_TABLE_STRUCT { + CONFIG_BLOCK_HEADER Header; ///< Offset 0-27 GUID number for main entry of config block + UINT8 Rsvd0[2]; ///< Offset 28-29 Reserved for future use + UINT16 NumberOfBlocks; ///< Offset 30-31 Number of config blocks (N) + UINT32 AvailableSize; ///< Offset 32-35 Current config block table size +/// +/// Individual Config Block Structures are added here in memory as part of AddConfigBlock() +/// +} CONFIG_BLOCK_TABLE_HEADER; +#pragma pack (pop) + +#endif // _CONFIG_BLOCK_H_ diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/Include/Library/ConfigBlockLib.h b/Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h similarity index 100% rename from Silicon/Intel/CoffeelakeSiliconPkg/Include/Library/ConfigBlockLib.h rename to Silicon/Intel/IntelSiliconPkg/Include/Library/ConfigBlockLib.h diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec index 22ebf19c4e..aad39f88ee 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -30,6 +30,10 @@ # PeiGetVtdPmrAlignmentLib|Include/Library/PeiGetVtdPmrAlignmentLib.h + ## @libraryclass Provides services to access ConfigBlock + # + ConfigBlockLib|Include/Library/ConfigBlockLib.h + [Guids] ## GUID for Package token space # {A9F8D54E-1107-4F0A-ADD0-4587E7A4A735} diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc index 0a6509d8b3..d90202d0f3 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc @@ -36,6 +36,7 @@ MicrocodeFlashAccessLib|IntelSiliconPkg/Feature/Capsule/Library/MicrocodeFlashAccessLibNull/MicrocodeFlashAccessLibNull.inf PeiGetVtdPmrAlignmentLib|IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf + ConfigBlockLib|IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf [LibraryClasses.common.PEIM] PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf diff --git a/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf index 37b4faaf65..87e7e315b7 100644 --- a/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf +++ b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf @@ -18,7 +18,7 @@ LIBRARY_CLASS = ConfigBlockLib [Packages] MdePkg/MdePkg.dec -KabylakeSiliconPkg/SiPkg.dec +IntelSiliconPkg/IntelSiliconPkg.dec [Sources] BaseConfigBlockLib.c diff --git a/Silicon/Intel/KabylakeSiliconPkg/Include/Library/ConfigBlockLib.h b/Silicon/Intel/KabylakeSiliconPkg/Include/Library/ConfigBlockLib.h deleted file mode 100644 index 04c8ec5cca..0000000000 --- a/Silicon/Intel/KabylakeSiliconPkg/Include/Library/ConfigBlockLib.h +++ /dev/null @@ -1,64 +0,0 @@ -/** @file - Header file for Config Block Lib implementation - -Copyright (c) 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef _CONFIG_BLOCK_LIB_H_ -#define _CONFIG_BLOCK_LIB_H_ - -/** - Create config block table - - @param[in] TotalSize - Max size to be allocated for the Config Block Table - @param[out] ConfigBlockTableAddress - On return, points to a pointer to the beginning of Config Block Table Address - - @retval EFI_INVALID_PARAMETER - Invalid Parameter - @retval EFI_OUT_OF_RESOURCES - Out of resources - @retval EFI_SUCCESS - Successfully created Config Block Table at ConfigBlockTableAddress -**/ -EFI_STATUS -EFIAPI -CreateConfigBlockTable ( - IN UINT16 TotalSize, - OUT VOID **ConfigBlockTableAddress - ); - -/** - Add config block into config block table structure - - @param[in] ConfigBlockTableAddress - A pointer to the beginning of Config Block Table Address - @param[out] ConfigBlockAddress - On return, points to a pointer to the beginning of Config Block Address - - @retval EFI_OUT_OF_RESOURCES - Config Block Table is full and cannot add new Config Block or - Config Block Offset Table is full and cannot add new Config Block. - @retval EFI_SUCCESS - Successfully added Config Block -**/ -EFI_STATUS -EFIAPI -AddConfigBlock ( - IN VOID *ConfigBlockTableAddress, - OUT VOID **ConfigBlockAddress - ); - -/** - Retrieve a specific Config Block data by GUID - - @param[in] ConfigBlockTableAddress - A pointer to the beginning of Config Block Table Address - @param[in] ConfigBlockGuid - A pointer to the GUID uses to search specific Config Block - @param[out] ConfigBlockAddress - On return, points to a pointer to the beginning of Config Block Address - - @retval EFI_NOT_FOUND - Could not find the Config Block - @retval EFI_SUCCESS - Config Block found and return -**/ -EFI_STATUS -EFIAPI -GetConfigBlock ( - IN VOID *ConfigBlockTableAddress, - IN EFI_GUID *ConfigBlockGuid, - OUT VOID **ConfigBlockAddress - ); - -#endif // _CONFIG_BLOCK_LIB_H_ -- 2.16.2.windows.1