]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg Tcg2Config: Move common definitions to new Tcg2Internal.h
authorLiming Gao <liming.gao@intel.com>
Thu, 5 Sep 2019 15:08:19 +0000 (23:08 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 17 Sep 2019 01:39:03 +0000 (09:39 +0800)
Common definitions are not consumed by VFR. They are not required to be
defined in Tcg2ConfigNvData.h with WA way. New shared internal header
file is added to include those common definitions.

Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.h
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c
SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h [new file with mode: 0644]
SecurityPkg/Tcg/Tcg2Config/TpmDetection.c

index 866e47d23e7c083e4aa0336123e8216223240540..6417ab82a1959b751dfb9b58869abef9ac6926f8 100644 (file)
@@ -30,6 +30,7 @@
   Tcg2Config.vfr\r
   Tcg2ConfigStrings.uni\r
   Tcg2ConfigNvData.h\r
+  Tcg2Internal.h\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
index 4b0e18dfbb414968392c24bdf9f8a9bbcc409e0d..af542d52efdd3a1f7727cb3cb6c9f9127a101cb1 100644 (file)
@@ -36,6 +36,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Guid/MdeModuleHii.h>\r
 \r
 #include "Tcg2ConfigNvData.h"\r
+#include "Tcg2Internal.h"\r
+\r
+#define TCG2_PROTOCOL_VERSION_DEFAULT        0x0001\r
 \r
 //\r
 // Tool generated IFR binary data and String package data\r
index d0a124684f011682ab28c2de2c9ccc3c84e5fa71..a91c0528506d355fabbfa271ac35300c10841286 100644 (file)
@@ -13,15 +13,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Guid/Tcg2ConfigHii.h>\r
 #include <IndustryStandard/TcgPhysicalPresence.h>\r
 \r
-//\r
-// BUGBUG: In order to pass VfrCompiler, we have to redefine below MACRO, which already in <Protocol/Tcg2Protocol.h>.\r
-//\r
-#ifndef __TCG2_H__\r
-#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2       0x00000001\r
-#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2         0x00000002\r
-#endif\r
-#define EFI_TCG2_EVENT_LOG_FORMAT_ALL           (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)\r
-\r
 #define TCG2_CONFIGURATION_VARSTORE_ID  0x0001\r
 #define TCG2_CONFIGURATION_INFO_VARSTORE_ID     0x0002\r
 #define TCG2_VERSION_VARSTORE_ID        0x0003\r
@@ -55,9 +46,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define TPM_DEVICE_INTERFACE_MAX       TPM_DEVICE_INTERFACE_PTP_FIFO\r
 #define TPM_DEVICE_INTERFACE_DEFAULT   TPM_DEVICE_INTERFACE_PTP_CRB\r
 \r
-#define TCG2_PROTOCOL_VERSION_DEFAULT        0x0001\r
-#define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT    EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2\r
-\r
 #define TCG2_PPI_VERSION_1_2                    0x322E31  // "1.2"\r
 #define TCG2_PPI_VERSION_1_3                    0x332E31  // "1.3"\r
 \r
@@ -97,27 +85,4 @@ typedef struct {
 #define TCG2_DEVICE_DETECTION_NAME  L"TCG2_DEVICE_DETECTION"\r
 #define TCG2_VERSION_NAME           L"TCG2_VERSION"\r
 \r
-#define TPM_INSTANCE_ID_LIST  { \\r
-  {TPM_DEVICE_INTERFACE_NONE,           TPM_DEVICE_NULL},      \\r
-  {TPM_DEVICE_INTERFACE_TPM12,          TPM_DEVICE_1_2},       \\r
-  {TPM_DEVICE_INTERFACE_TPM20_DTPM,     TPM_DEVICE_2_0_DTPM},  \\r
-}\r
-\r
-//\r
-// BUGBUG: In order to pass VfrCompiler, we have to redefine GUID here.\r
-//\r
-#ifndef __BASE_H__\r
-typedef struct {\r
-  UINT32  Data1;\r
-  UINT16  Data2;\r
-  UINT16  Data3;\r
-  UINT8   Data4[8];\r
-} GUID;\r
-#endif\r
-\r
-typedef struct {\r
-  GUID       TpmInstanceGuid;\r
-  UINT8      TpmDevice;\r
-} TPM_INSTANCE_ID;\r
-\r
 #endif\r
index 837cbd12f07fd3552a857394e3a5a50c21b035c1..f2aa3234adf6212150a635ab565f3e88a71f7c4f 100644 (file)
@@ -28,6 +28,7 @@
 [Sources]\r
   Tcg2ConfigPeim.c\r
   Tcg2ConfigNvData.h\r
+  Tcg2Internal.h\r
   TpmDetection.c\r
 \r
 [Packages]\r
index a50a128766c1a88c65ed856da9525e855976a77e..a15919685ed505ef88942e7566960d2ef0ba3334 100644 (file)
@@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Protocol/Tcg2Protocol.h>\r
 \r
 #include "Tcg2ConfigNvData.h"\r
+#include "Tcg2Internal.h"\r
 \r
 TPM_INSTANCE_ID  mTpmInstanceId[] = TPM_INSTANCE_ID_LIST;\r
 \r
diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h b/SecurityPkg/Tcg/Tcg2Config/Tcg2Internal.h
new file mode 100644 (file)
index 0000000..6ed1015
--- /dev/null
@@ -0,0 +1,26 @@
+/** @file\r
+  The internal header file defines the common structures for PEI and DXE modules.\r
+\r
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef __TCG2_INTERNAL_H__\r
+#define __TCG2_INTERNAL_H__\r
+\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_DEFAULT    EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_ALL        (EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 | EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)\r
+\r
+#define TPM_INSTANCE_ID_LIST  { \\r
+  {TPM_DEVICE_INTERFACE_NONE,           TPM_DEVICE_NULL},      \\r
+  {TPM_DEVICE_INTERFACE_TPM12,          TPM_DEVICE_1_2},       \\r
+  {TPM_DEVICE_INTERFACE_TPM20_DTPM,     TPM_DEVICE_2_0_DTPM},  \\r
+}\r
+\r
+typedef struct {\r
+  GUID       TpmInstanceGuid;\r
+  UINT8      TpmDevice;\r
+} TPM_INSTANCE_ID;\r
+\r
+#endif\r
index 2f220c6c902ab98deeea0e01e8aad191e93da639..eeaadc5e2f49f1a1382459855608b94206c2cc16 100644 (file)
@@ -20,6 +20,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <IndustryStandard/Tpm12.h>\r
 \r
 #include "Tcg2ConfigNvData.h"\r
+#include "Tcg2Internal.h"\r
 \r
 /**\r
   This routine check both SetupVariable and real TPM device, and return final TpmDevice configuration.\r