]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Tcg2Protocol.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Protocol / Tcg2Protocol.h
index 0bda105a44814f949ea1d82a4ecabc97a5d52c49..f1326a5ef022e131f2e19eb6c1108f8dbd4694ed 100644 (file)
@@ -2,14 +2,8 @@
   TPM2 Protocol as defined in TCG PC Client Platform EFI Protocol Specification Family "2.0".\r
   See http://trustedcomputinggroup.org for the latest specification\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution.  The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -25,79 +19,79 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 typedef struct tdEFI_TCG2_PROTOCOL EFI_TCG2_PROTOCOL;\r
 \r
 typedef struct tdEFI_TCG2_VERSION {\r
-  UINT8 Major;\r
-  UINT8 Minor;\r
+  UINT8    Major;\r
+  UINT8    Minor;\r
 } EFI_TCG2_VERSION;\r
 \r
 typedef UINT32 EFI_TCG2_EVENT_LOG_BITMAP;\r
 typedef UINT32 EFI_TCG2_EVENT_LOG_FORMAT;\r
 typedef UINT32 EFI_TCG2_EVENT_ALGORITHM_BITMAP;\r
 \r
-#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2       0x00000001\r
-#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2         0x00000002\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2  0x00000001\r
+#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2    0x00000002\r
 \r
 typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY {\r
   //\r
   // Allocated size of the structure\r
   //\r
-  UINT8                            Size;\r
+  UINT8                              Size;\r
   //\r
   // Version of the EFI_TCG2_BOOT_SERVICE_CAPABILITY structure itself.\r
   // For this version of the protocol, the Major version shall be set to 1\r
-  // and the Minor version shall be set to 1. \r
+  // and the Minor version shall be set to 1.\r
   //\r
-  EFI_TCG2_VERSION                 StructureVersion;\r
+  EFI_TCG2_VERSION                   StructureVersion;\r
   //\r
   // Version of the EFI TCG2 protocol.\r
   // For this version of the protocol, the Major version shall be set to 1\r
-  // and the Minor version shall be set to 1. \r
+  // and the Minor version shall be set to 1.\r
   //\r
-  EFI_TCG2_VERSION                 ProtocolVersion;\r
+  EFI_TCG2_VERSION                   ProtocolVersion;\r
   //\r
   // Supported hash algorithms (this bitmap is determined by the supported PCR\r
   // banks in the TPM and the hashing algorithms supported by the firmware)\r
   //\r
-  EFI_TCG2_EVENT_ALGORITHM_BITMAP  HashAlgorithmBitmap;\r
+  EFI_TCG2_EVENT_ALGORITHM_BITMAP    HashAlgorithmBitmap;\r
   //\r
   // Bitmap of supported event log formats\r
   //\r
-  EFI_TCG2_EVENT_LOG_BITMAP        SupportedEventLogs;\r
+  EFI_TCG2_EVENT_LOG_BITMAP          SupportedEventLogs;\r
   //\r
   // False = TPM not present\r
   //\r
-  BOOLEAN                          TPMPresentFlag;\r
+  BOOLEAN                            TPMPresentFlag;\r
   //\r
   // Max size (in bytes) of a command that can be sent to the TPM\r
   //\r
-  UINT16                           MaxCommandSize;\r
+  UINT16                             MaxCommandSize;\r
   //\r
   // Max size (in bytes) of a response that can be provided by the TPM\r
   //\r
-  UINT16                           MaxResponseSize;\r
+  UINT16                             MaxResponseSize;\r
   //\r
   // 4-byte Vendor ID\r
   // (see TCG Vendor ID registry, Section "TPM Capabilities Vendor ID")\r
   //\r
-  UINT32                           ManufacturerID;\r
+  UINT32                             ManufacturerID;\r
   //\r
   // Maximum number of PCR banks (hashing algorithms) supported.\r
   // No granularity is provided to support a specific set of algorithms.\r
   // Minimum value is 1.\r
   //\r
-  UINT32                           NumberOfPCRBanks;\r
+  UINT32                             NumberOfPCRBanks;\r
   //\r
   // A bitmap of currently active PCR banks (hashing algorithms).\r
   // This is a subset of the supported hashing algorithms reported in HashAlgorithmBitMap.\r
   // NumberOfPcrBanks defines the number of bits that are set.\r
   //\r
-  EFI_TCG2_EVENT_ALGORITHM_BITMAP  ActivePcrBanks;\r
+  EFI_TCG2_EVENT_ALGORITHM_BITMAP    ActivePcrBanks;\r
 } EFI_TCG2_BOOT_SERVICE_CAPABILITY;\r
 \r
-#define EFI_TCG2_BOOT_HASH_ALG_SHA1    0x00000001\r
-#define EFI_TCG2_BOOT_HASH_ALG_SHA256  0x00000002\r
-#define EFI_TCG2_BOOT_HASH_ALG_SHA384  0x00000004\r
-#define EFI_TCG2_BOOT_HASH_ALG_SHA512  0x00000008\r
-#define EFI_TCG2_BOOT_HASH_ALG_SM3_256 0x00000010\r
+#define EFI_TCG2_BOOT_HASH_ALG_SHA1     0x00000001\r
+#define EFI_TCG2_BOOT_HASH_ALG_SHA256   0x00000002\r
+#define EFI_TCG2_BOOT_HASH_ALG_SHA384   0x00000004\r
+#define EFI_TCG2_BOOT_HASH_ALG_SHA512   0x00000008\r
+#define EFI_TCG2_BOOT_HASH_ALG_SM3_256  0x00000010\r
 \r
 //\r
 // This bit is shall be set when an event shall be extended but not logged.\r
@@ -106,7 +100,7 @@ typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY {
 //\r
 // This bit shall be set when the intent is to measure a PE/COFF image.\r
 //\r
-#define PE_COFF_IMAGE     0x0000000000000010\r
+#define PE_COFF_IMAGE  0x0000000000000010\r
 \r
 #define MAX_PCR_INDEX  23\r
 \r
@@ -116,30 +110,30 @@ typedef struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY {
 \r
 typedef struct {\r
   //\r
-  // Size of the event header itself (sizeof(EFI_TCG2_EVENT_HEADER)). \r
+  // Size of the event header itself (sizeof(EFI_TCG2_EVENT_HEADER)).\r
   //\r
-  UINT32            HeaderSize;\r
+  UINT32           HeaderSize;\r
   //\r
   // Header version. For this version of this specification, the value shall be 1.\r
   //\r
-  UINT16            HeaderVersion;\r
+  UINT16           HeaderVersion;\r
   //\r
-  // Index of the PCR that shall be extended (0 - 23). \r
+  // Index of the PCR that shall be extended (0 - 23).\r
   //\r
-  TCG_PCRINDEX      PCRIndex;\r
+  TCG_PCRINDEX     PCRIndex;\r
   //\r
-  // Type of the event that shall be extended (and optionally logged). \r
+  // Type of the event that shall be extended (and optionally logged).\r
   //\r
-  TCG_EVENTTYPE     EventType;\r
+  TCG_EVENTTYPE    EventType;\r
 } EFI_TCG2_EVENT_HEADER;\r
 \r
 typedef struct tdEFI_TCG2_EVENT {\r
   //\r
-  // Total size of the event including the Size component, the header and the Event data. \r
+  // Total size of the event including the Size component, the header and the Event data.\r
   //\r
-  UINT32                Size;\r
-  EFI_TCG2_EVENT_HEADER Header;\r
-  UINT8                 Event[1];\r
+  UINT32                   Size;\r
+  EFI_TCG2_EVENT_HEADER    Header;\r
+  UINT8                    Event[1];\r
 } EFI_TCG2_EVENT;\r
 \r
 #pragma pack()\r
@@ -157,22 +151,22 @@ typedef struct tdEFI_TCG2_EVENT {
 \r
   @retval EFI_SUCCESS            Operation completed successfully.\r
   @retval EFI_DEVICE_ERROR       The command was unsuccessful.\r
-                                 The ProtocolCapability variable will not be populated. \r
+                                 The ProtocolCapability variable will not be populated.\r
   @retval EFI_INVALID_PARAMETER  One or more of the parameters are incorrect.\r
                                  The ProtocolCapability variable will not be populated.\r
   @retval EFI_BUFFER_TOO_SMALL   The ProtocolCapability variable is too small to hold the full response.\r
-                                 It will be partially populated (required Size field will be set). \r
+                                 It will be partially populated (required Size field will be set).\r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_TCG2_GET_CAPABILITY) (\r
+(EFIAPI *EFI_TCG2_GET_CAPABILITY)(\r
   IN EFI_TCG2_PROTOCOL                    *This,\r
   IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability\r
   );\r
 \r
 /**\r
   The EFI_TCG2_PROTOCOL Get Event Log function call allows a caller to\r
-  retrieve the address of a given event log and its last entry. \r
+  retrieve the address of a given event log and its last entry.\r
 \r
   @param[in]  This               Indicates the calling context\r
   @param[in]  EventLogFormat     The type of the event log for which the information is requested.\r
@@ -189,7 +183,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_TCG2_GET_EVENT_LOG) (\r
+(EFIAPI *EFI_TCG2_GET_EVENT_LOG)(\r
   IN EFI_TCG2_PROTOCOL         *This,\r
   IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat,\r
   OUT EFI_PHYSICAL_ADDRESS     *EventLogLocation,\r
@@ -200,13 +194,13 @@ EFI_STATUS
 /**\r
   The EFI_TCG2_PROTOCOL HashLogExtendEvent function call provides callers with\r
   an opportunity to extend and optionally log events without requiring\r
-  knowledge of actual TPM commands. \r
+  knowledge of actual TPM commands.\r
   The extend operation will occur even if this function cannot create an event\r
-  log entry (e.g. due to the event log being full). \r
+  log entry (e.g. due to the event log being full).\r
 \r
   @param[in]  This               Indicates the calling context\r
   @param[in]  Flags              Bitmap providing additional information.\r
-  @param[in]  DataToHash         Physical address of the start of the data buffer to be hashed. \r
+  @param[in]  DataToHash         Physical address of the start of the data buffer to be hashed.\r
   @param[in]  DataToHashLen      The length in bytes of the buffer referenced by DataToHash.\r
   @param[in]  EfiTcgEvent        Pointer to data buffer containing information about the event.\r
 \r
@@ -218,7 +212,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI * EFI_TCG2_HASH_LOG_EXTEND_EVENT) (\r
+(EFIAPI *EFI_TCG2_HASH_LOG_EXTEND_EVENT)(\r
   IN EFI_TCG2_PROTOCOL    *This,\r
   IN UINT64               Flags,\r
   IN EFI_PHYSICAL_ADDRESS DataToHash,\r
@@ -238,11 +232,11 @@ EFI_STATUS
   @retval EFI_SUCCESS            The command byte stream was successfully sent to the device and a response was successfully received.\r
   @retval EFI_DEVICE_ERROR       The command was not successfully sent to the device or a response was not successfully received from the device.\r
   @retval EFI_INVALID_PARAMETER  One or more of the parameters are incorrect.\r
-  @retval EFI_BUFFER_TOO_SMALL   The output parameter block is too small. \r
+  @retval EFI_BUFFER_TOO_SMALL   The output parameter block is too small.\r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_TCG2_SUBMIT_COMMAND) (\r
+(EFIAPI *EFI_TCG2_SUBMIT_COMMAND)(\r
   IN EFI_TCG2_PROTOCOL *This,\r
   IN UINT32            InputParameterBlockSize,\r
   IN UINT8             *InputParameterBlock,\r
@@ -257,11 +251,11 @@ EFI_STATUS
   @param[out] ActivePcrBanks  Pointer to the variable receiving the bitmap of currently active PCR banks.\r
 \r
   @retval EFI_SUCCESS           The bitmap of active PCR banks was stored in the ActivePcrBanks parameter.\r
-  @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect. \r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.\r
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_TCG2_GET_ACTIVE_PCR_BANKS) (\r
+(EFIAPI *EFI_TCG2_GET_ACTIVE_PCR_BANKS)(\r
   IN  EFI_TCG2_PROTOCOL *This,\r
   OUT UINT32            *ActivePcrBanks\r
   );\r
@@ -277,7 +271,7 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_TCG2_SET_ACTIVE_PCR_BANKS) (\r
+(EFIAPI *EFI_TCG2_SET_ACTIVE_PCR_BANKS)(\r
   IN EFI_TCG2_PROTOCOL *This,\r
   IN UINT32            ActivePcrBanks\r
   );\r
@@ -294,23 +288,23 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS) (\r
+(EFIAPI *EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS)(\r
   IN  EFI_TCG2_PROTOCOL  *This,\r
   OUT UINT32             *OperationPresent,\r
   OUT UINT32             *Response\r
   );\r
 \r
 struct tdEFI_TCG2_PROTOCOL {\r
-  EFI_TCG2_GET_CAPABILITY                     GetCapability;\r
-  EFI_TCG2_GET_EVENT_LOG                      GetEventLog;\r
-  EFI_TCG2_HASH_LOG_EXTEND_EVENT              HashLogExtendEvent;\r
-  EFI_TCG2_SUBMIT_COMMAND                     SubmitCommand;\r
-  EFI_TCG2_GET_ACTIVE_PCR_BANKS               GetActivePcrBanks;\r
-  EFI_TCG2_SET_ACTIVE_PCR_BANKS               SetActivePcrBanks;\r
-  EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS GetResultOfSetActivePcrBanks;\r
+  EFI_TCG2_GET_CAPABILITY                        GetCapability;\r
+  EFI_TCG2_GET_EVENT_LOG                         GetEventLog;\r
+  EFI_TCG2_HASH_LOG_EXTEND_EVENT                 HashLogExtendEvent;\r
+  EFI_TCG2_SUBMIT_COMMAND                        SubmitCommand;\r
+  EFI_TCG2_GET_ACTIVE_PCR_BANKS                  GetActivePcrBanks;\r
+  EFI_TCG2_SET_ACTIVE_PCR_BANKS                  SetActivePcrBanks;\r
+  EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS    GetResultOfSetActivePcrBanks;\r
 };\r
 \r
-extern EFI_GUID gEfiTcg2ProtocolGuid;\r
+extern EFI_GUID  gEfiTcg2ProtocolGuid;\r
 \r
 //\r
 // Log entries after Get Event Log service\r
@@ -319,23 +313,23 @@ extern EFI_GUID gEfiTcg2ProtocolGuid;
 #define EFI_TCG2_FINAL_EVENTS_TABLE_GUID \\r
   {0x1e2ed096, 0x30e2, 0x4254, { 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25 }}\r
 \r
-extern EFI_GUID gEfiTcg2FinalEventsTableGuid;\r
+extern EFI_GUID  gEfiTcg2FinalEventsTableGuid;\r
 \r
 typedef struct tdEFI_TCG2_FINAL_EVENTS_TABLE {\r
   //\r
   // The version of this structure.\r
   //\r
-  UINT64                  Version;\r
+  UINT64    Version;\r
   //\r
   // Number of events recorded after invocation of GetEventLog API\r
   //\r
-  UINT64                  NumberOfEvents;\r
+  UINT64    NumberOfEvents;\r
   //\r
   // List of events of type TCG_PCR_EVENT2.\r
   //\r
-//TCG_PCR_EVENT2          Event[1];\r
+  // TCG_PCR_EVENT2          Event[1];\r
 } EFI_TCG2_FINAL_EVENTS_TABLE;\r
 \r
-#define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION   1\r
+#define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION  1\r
 \r
 #endif\r