]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/TcgService.h
Add TPM related definitions.
[mirror_edk2.git] / MdePkg / Include / Protocol / TcgService.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 TcgService.h
15
16 Abstract:
17
18 TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final
19
20 See http://trustedcomputinggroup.org for the latest specification
21
22 --*/
23
24 #ifndef _TCG_SERVICE_PROTOCOL_H_
25 #define _TCG_SERVICE_PROTOCOL_H_
26
27 #include <Uefi/UefiTcgPlatform.h>
28
29 #define EFI_TCG_PROTOCOL_GUID \
30 {0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd } }
31
32 typedef struct _EFI_TCG_PROTOCOL EFI_TCG_PROTOCOL;
33
34 //
35 // Set structure alignment to 1-byte
36 //
37 #pragma pack (push, 1)
38
39 typedef struct {
40 UINT8 Major;
41 UINT8 Minor;
42 UINT8 RevMajor;
43 UINT8 RevMinor;
44 } TCG_VERSION;
45
46 typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {
47 UINT8 Size; // Size of this structure
48 TCG_VERSION StructureVersion;
49 TCG_VERSION ProtocolSpecVersion;
50 UINT8 HashAlgorithmBitmap; // Hash algorithms
51 // this protocol is capable of : 01=SHA-1
52 BOOLEAN TPMPresentFlag; // 00h = TPM not present
53 BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated
54 } TCG_EFI_BOOT_SERVICE_CAPABILITY;
55
56 typedef UINT32 TCG_ALGORITHM_ID;
57
58 //
59 // Restore original structure alignment
60 //
61 #pragma pack (pop)
62
63 typedef
64 EFI_STATUS
65 (EFIAPI *EFI_TCG_STATUS_CHECK) (
66 IN EFI_TCG_PROTOCOL *This,
67 OUT TCG_EFI_BOOT_SERVICE_CAPABILITY
68 *ProtocolCapability,
69 OUT UINT32 *TCGFeatureFlags,
70 OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
71 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
72 );
73
74 typedef
75 EFI_STATUS
76 (EFIAPI *EFI_TCG_HASH_ALL) (
77 IN EFI_TCG_PROTOCOL *This,
78 IN UINT8 *HashData,
79 IN UINT64 HashDataLen,
80 IN TCG_ALGORITHM_ID AlgorithmId,
81 IN OUT UINT64 *HashedDataLen,
82 IN OUT UINT8 **HashedDataResult
83 );
84
85 typedef
86 EFI_STATUS
87 (EFIAPI *EFI_TCG_LOG_EVENT) (
88 IN EFI_TCG_PROTOCOL *This,
89 IN TCG_PCR_EVENT *TCGLogData,
90 IN OUT UINT32 *EventNumber,
91 IN UINT32 Flags
92 );
93
94 typedef
95 EFI_STATUS
96 (EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (
97 IN EFI_TCG_PROTOCOL *This,
98 IN UINT32 TpmInputParamterBlockSize,
99 IN UINT8 *TpmInputParamterBlock,
100 IN UINT32 TpmOutputParameterBlockSize,
101 IN UINT8 *TpmOutputParameterBlock
102 );
103
104 typedef
105 EFI_STATUS
106 (EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (
107 IN EFI_TCG_PROTOCOL *This,
108 IN UINT8 *HashData,
109 IN UINT64 HashDataLen,
110 IN TCG_ALGORITHM_ID AlgorithmId,
111 IN OUT TCG_PCR_EVENT *TCGLogData,
112 IN OUT UINT32 *EventNumber,
113 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
114 );
115
116 typedef struct _EFI_TCG_PROTOCOL {
117 EFI_TCG_STATUS_CHECK StatusCheck;
118 EFI_TCG_HASH_ALL HashAll;
119 EFI_TCG_LOG_EVENT LogEvent;
120 EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;
121 EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
122 } EFI_TCG_PROTOCOL;
123
124 extern EFI_GUID gEfiTcgProtocolGuid;
125
126 #endif