summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2023-05-27 18:02:16 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-03 06:25:32 +0000
commit05ac9a58f567045a60d67271345efbd8f9ffc31e (patch)
tree2d742496c5c9eccf8b1906af7ce38ca9dbdc5a03 /MdePkg/Include
parent1e079360cd6f70ac26f0c808a35f14b3c4c56b85 (diff)
downloadedk2-05ac9a58f567045a60d67271345efbd8f9ffc31e.tar.gz
MdePkg/Include/IndustryStandard: Add operator_ and xor_ field names
Update Tpm12.h and Tpm20.h and not use c++ reserved keywords operator and xor in C structures to support use of these include files when building with a C++ compiler. This patch temporarily introduces an anonymous union to add operator_ and xor_ fields to support migration from the current field names to the new field names. Warning 4201 is disabled for VS20xx tool chains is a temporary change to allow the use of anonymous unions. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/IndustryStandard/Tpm12.h22
-rw-r--r--MdePkg/Include/IndustryStandard/Tpm20.h25
2 files changed, 43 insertions, 4 deletions
diff --git a/MdePkg/Include/IndustryStandard/Tpm12.h b/MdePkg/Include/IndustryStandard/Tpm12.h
index 155dcc9f5f..0e5a9019e8 100644
--- a/MdePkg/Include/IndustryStandard/Tpm12.h
+++ b/MdePkg/Include/IndustryStandard/Tpm12.h
@@ -10,6 +10,14 @@
#define _TPM12_H_
///
+/// Temporary disable 4201 to support anonymous unions
+///
+#if defined (_MSC_EXTENSIONS)
+#pragma warning( push )
+#pragma warning ( disable : 4201 )
+#endif
+
+///
/// The start of TPM return codes
///
#define TPM_BASE 0
@@ -744,8 +752,11 @@ typedef struct tdTPM_PERMANENT_FLAGS {
BOOLEAN TPMpost;
BOOLEAN TPMpostLock;
BOOLEAN FIPS;
- BOOLEAN operator;
- BOOLEAN enableRevokeEK;
+ union {
+ BOOLEAN operator;
+ BOOLEAN operator_;
+ };
+ BOOLEAN enableRevokeEK;
BOOLEAN nvLocked;
BOOLEAN readSRKPub;
BOOLEAN tpmEstablished;
@@ -2162,4 +2173,11 @@ typedef struct tdTPM_RSP_COMMAND_HDR {
#pragma pack ()
+///
+/// Temporary disable 4201 to support anonymous unions
+///
+#if defined (_MSC_EXTENSIONS)
+#pragma warning( pop )
+#endif
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/Tpm20.h b/MdePkg/Include/IndustryStandard/Tpm20.h
index 9303f16278..52092bd614 100644
--- a/MdePkg/Include/IndustryStandard/Tpm20.h
+++ b/MdePkg/Include/IndustryStandard/Tpm20.h
@@ -15,6 +15,14 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <IndustryStandard/Tpm12.h>
+///
+/// Temporary disable 4201 to support anonymous unions
+///
+#if defined (_MSC_EXTENSIONS)
+#pragma warning( push )
+#pragma warning ( disable : 4201 )
+#endif
+
#pragma pack (1)
// Annex A Algorithm Constants
@@ -1248,7 +1256,10 @@ typedef union {
TPMI_AES_KEY_BITS aes;
TPMI_SM4_KEY_BITS SM4;
TPM_KEY_BITS sym;
- TPMI_ALG_HASH xor;
+ union {
+ TPMI_ALG_HASH xor;
+ TPMI_ALG_HASH xor_;
+ };
} TPMU_SYM_KEY_BITS;
// Table 123 - TPMU_SYM_MODE Union
@@ -1321,7 +1332,10 @@ typedef struct {
// Table 136 - TPMU_SCHEME_KEYEDHASH Union
typedef union {
TPMS_SCHEME_HMAC hmac;
- TPMS_SCHEME_XOR xor;
+ union {
+ TPMS_SCHEME_XOR xor;
+ TPMS_SCHEME_XOR xor_;
+ };
} TPMU_SCHEME_KEYEDHASH;
// Table 137 - TPMT_KEYEDHASH_SCHEME Structure
@@ -1810,4 +1824,11 @@ typedef struct {
#define HASH_ALG_SHA512 0x00000008
#define HASH_ALG_SM3_256 0x00000010
+///
+/// Temporary disable 4201 to support anonymous unions
+///
+#if defined (_MSC_EXTENSIONS)
+#pragma warning( pop )
+#endif
+
#endif