summaryrefslogtreecommitdiff
path: root/Core/EM/TCG2/TisLib/TcgEFI12.h
blob: 9ecfa92f83aeb4b53289b6b30ee32922f176c707 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/*++

   Copyright (c)  2005 Intel Corporation. All rights reserved
   This software and associated documentation (if any) is furnished
   under a license and may only be used or copied in accordance
   with the terms of the license. Except as permitted by such
   license, no part of this software or documentation may be
   reproduced, stored in a retrieval system, or transmitted in any
   form or by any means without the express written consent of
   Intel Corporation.


   Module Name:

   TpmEfi.h

   Abstract:

   This file contains definitions of structures for TPM and TCG
   protocols/ppis.

   --*/

//*************************************************************************
// $Header: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/TcgEFI12.h 1     4/21/14 2:15p Fredericko $
//
// $Revision: 1 $
//
// $Date: 4/21/14 2:15p $
//*************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/TCG2/Libraries/TisLib/TcgEFI12.h $
// 
// 1     4/21/14 2:15p Fredericko
// 
// 1     10/08/13 11:58a Fredericko
// Initial Check-In for Tpm-Next module
// 
// 1     7/10/13 5:50p Fredericko
// [TAG]  		EIP120969
// [Category]  	New Feature
// [Description]  	TCG (TPM20)
// [Files]  		TisLib.cif
// TisLib.mak
// TcgTpm12.h
// TpmLib.h
// TcgCommon.h
// ZTEICTcmOrdinals.h
// TpmLib.c
// TcgCommon.c
// TisLib.sdl
// sha1.h
// INTTcgAcpi.h
// TcgPc.h
// TcmPc.h
// TcgEfiTpm.h
// TcgEFI12.h
// 
// 2     5/19/10 5:22p Fredericko
// 
// Included File Header
// Included File Revision History 
// Code Beautification
// EIP 37653
//
//*************************************************************************
//*************************************************************************
//<AMI_FHDR_START>
//
// Name:  TcgEFI12.h
//
// Description: 
//  Contains Industry Standard structures for TCG
//
//<AMI_FHDR_END>
//*************************************************************************
#ifndef _TCGEFI_H_
#define _TCGEFI_H_

#include "TcgTpm12.h"
#include "TcgPc.h"

#define _TPM_NTH_BIT( x )             (1 << (x))
#define _TPM_STRUCT_PARTIAL_SIZE( type, field )  \
    ((UINTN)&(((type*)0)->field))

#pragma pack (push)
#pragma pack (1)

//
// TCG_PCClientEventStructure
//
#pragma pack (pop)

//
// Per the EFI Implementation
//
typedef TPM_DIGEST TCG_DIGEST;

//
// TPM_TRANSMIT_BUFFER used by TCG services
//
typedef struct _TPM_TRANSMIT_BUFFER
{
    VOID  *Buffer;
    UINTN Size;
} TPM_TRANSMIT_BUFFER;

//
// Definitons of TPM commands
//

#pragma pack (push)
#pragma pack (1)

typedef struct _TPM_1_2_CMD_HEADER
{
    TPM_TAG          Tag;
    UINT32           ParamSize;
    TPM_COMMAND_CODE Ordinal;
} TPM_1_2_CMD_HEADER;

typedef struct _TPM_1_2_RET_HEADER
{
    TPM_TAG    Tag;
    UINT32     ParamSize;
    TPM_RESULT RetCode;
} TPM_1_2_RET_HEADER;

//
// TPM_Startup
//

typedef struct _TPM_1_2_CMD_STARTUP
{
    TPM_1_2_CMD_HEADER Header;
    TPM_STARTUP_TYPE   StartupType;
} TPM_1_2_CMD_STARTUP;

//
// TPM_SHA1Start
//

typedef struct _TPM_1_2_RET_SHA1START
{
    TPM_1_2_RET_HEADER Header;
    UINT32             MaxBytes;
} TPM_1_2_RET_SHA1START;

//
// TPM_SHA1Update
//

typedef struct _TPM_1_2_CMD_SHA1UPDATE
{
    TPM_1_2_CMD_HEADER Header;
    UINT32             NumBytes;
} TPM_1_2_CMD_SHA1UPDATE;

//
// TPM_SHA1Complete
//

typedef TPM_1_2_CMD_SHA1UPDATE TPM_1_2_CMD_SHA1COMPLETE;

typedef struct _TPM_1_2_RET_SHA1COMPLETE
{
    TPM_1_2_CMD_HEADER Header;
    TCG_DIGEST         Digest;
} TPM_1_2_RET_SHA1COMPLETE;

//
// TPM_SHA1CompleteExtend
//

typedef struct _TPM_1_2_CMD_SHA1COMPLETEEXTEND
{
    TPM_1_2_CMD_HEADER Header;
    TPM_PCRINDEX       PCRIndex;
    UINT32             NumBytes;
} TPM_1_2_CMD_SHA1COMPLETEEXTEND;

#pragma pack (pop)

#endif  // _TCGEFI_H_