[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] stubdom vtpm build failure in staging



On Wed, Jan 28, Xu, Quan wrote:

> Thanks, I will check and fix it tomorrow. It is 23:12 PM Pacific time now.

Any progress?
These typedefs are duplicated in stubdom/vtpmmgr/tcg.h and supported
compilers do not cope with current staging:

# for i in `grep -w typedef stubdom/vtpmmgr/tcg.h | sed -n '/;/{s@^.* 
@@;s@;@@p}'`
# do
#         if test -n "`git grep -wn $i|grep -w typedef|grep -v 
stubdom/vtpmmgr/tcg.h`"
#         then
#                 echo $i
#         fi
# done

BYTE
BOOL
UINT16
UINT32
UINT64
TPM_HANDLE
TPM_ALGORITHM_ID

TPMI_RH_HIERARCHY_AUTH and TPM_ALG_ID are defined twice in the same file.

This change works for me:

---
 stubdom/vtpmmgr/odd_types.h  | 11 +++++++++++
 stubdom/vtpmmgr/tcg.h        |  9 +--------
 stubdom/vtpmmgr/tpm2_types.h | 11 +----------
 3 files changed, 13 insertions(+), 18 deletions(-)
 create mode 100644 stubdom/vtpmmgr/odd_types.h

diff --git a/stubdom/vtpmmgr/odd_types.h b/stubdom/vtpmmgr/odd_types.h
new file mode 100644
index 0000000..d72da9b
--- /dev/null
+++ b/stubdom/vtpmmgr/odd_types.h
@@ -0,0 +1,11 @@
+#ifndef VTPM_ODD_TYPES
+#define VTPM_ODD_TYPES 1
+typedef unsigned char BYTE;
+typedef unsigned char BOOL;
+typedef uint16_t UINT16;
+typedef uint32_t UINT32;
+typedef uint64_t UINT64;
+typedef UINT32 TPM_HANDLE;
+typedef UINT32 TPM_ALGORITHM_ID;
+#endif
+
diff --git a/stubdom/vtpmmgr/tcg.h b/stubdom/vtpmmgr/tcg.h
index 7321ec6..cac1bbc 100644
--- a/stubdom/vtpmmgr/tcg.h
+++ b/stubdom/vtpmmgr/tcg.h
@@ -401,16 +401,10 @@
 
 
 // *************************** TYPEDEFS *********************************
-typedef unsigned char BYTE;
-typedef unsigned char BOOL;
-typedef uint16_t UINT16;
-typedef uint32_t UINT32;
-typedef uint64_t UINT64;
-
+#include "odd_types.h"
 typedef UINT32 TPM_RESULT;
 typedef UINT32 TPM_PCRINDEX;
 typedef UINT32 TPM_DIRINDEX;
-typedef UINT32 TPM_HANDLE;
 typedef TPM_HANDLE TPM_AUTHHANDLE;
 typedef TPM_HANDLE TCPA_HASHHANDLE;
 typedef TPM_HANDLE TCPA_HMACHANDLE;
@@ -422,7 +416,6 @@ typedef UINT32 TPM_COMMAND_CODE;
 typedef UINT16 TPM_PROTOCOL_ID;
 typedef BYTE TPM_AUTH_DATA_USAGE;
 typedef UINT16 TPM_ENTITY_TYPE;
-typedef UINT32 TPM_ALGORITHM_ID;
 typedef UINT16 TPM_KEY_USAGE;
 typedef UINT16 TPM_STARTUP_TYPE;
 typedef UINT32 TPM_CAPABILITY_AREA;
diff --git a/stubdom/vtpmmgr/tpm2_types.h b/stubdom/vtpmmgr/tpm2_types.h
index ac2830d..63564cd 100644
--- a/stubdom/vtpmmgr/tpm2_types.h
+++ b/stubdom/vtpmmgr/tpm2_types.h
@@ -83,12 +83,8 @@
 #define    MAX_ECC_KEY_BYTES    ((MAX_ECC_KEY_BITS + 7) / 8)
 
 
-typedef unsigned char BYTE;
-typedef unsigned char BOOL;
+#include "odd_types.h"
 typedef uint8_t       UINT8;
-typedef uint16_t      UINT16;
-typedef uint32_t      UINT32;
-typedef uint64_t      UINT64;
 
 // TPM2 command code
 
@@ -216,7 +212,6 @@ typedef UINT16 TPM_ST;
 
 
 // TPM Handle types
-typedef UINT32 TPM_HANDLE;
 typedef UINT8 TPM_HT;
 
 
@@ -233,7 +228,6 @@ typedef UINT32 TPM_RH;
 #define    TPM_RH_LAST           (TPM_RH)(0x4000000C)
 
 // Table 4 -- DocumentationClarity Types <I/O>
-typedef UINT32    TPM_ALGORITHM_ID;
 typedef UINT32    TPM_MODIFIER_INDICATOR;
 typedef UINT32    TPM_SESSION_OFFSET;
 typedef UINT16    TPM_KEY_SIZE;
@@ -261,8 +255,6 @@ typedef BYTE TPMA_LOCALITY;
 // Table 37 -- TPMI_YES_NO Type <I/O>
 typedef BYTE TPMI_YES_NO;
 
-typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
-
 // Table 38 -- TPMI_DH_OBJECT Type <I/O>
 typedef TPM_HANDLE TPMI_DH_OBJECT;
 
@@ -304,7 +296,6 @@ typedef TPM_HANDLE TPMI_RH_LOCKOUT;
 
 // Table 7 -- TPM_ALG_ID
 typedef UINT16 TPM_ALG_ID;
-typedef UINT16 TPM_ALG_ID;
 
 #define    TPM2_ALG_ERROR             (TPM_ALG_ID)(0x0000) // a: ; D:
 #define    TPM2_ALG_FIRST             (TPM_ALG_ID)(0x0001) // a: ; D:

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.