]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Include/Library/TcgPhysicalPresenceStorageLib.h
SecurityPkg: Add header file for TcgPhysicalPresenceStorageLib.
[mirror_edk2.git] / SecurityPkg / Include / Library / TcgPhysicalPresenceStorageLib.h
1 /** @file
2 This library is to support TCG PC Client Platform Physical Presence Interface Specification
3 Family, >= 96 && <128 storage Specific PPI Operation.
4
5 Caution: This function may receive untrusted input.
6
7 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef _TCG_PHYSICAL_PRESENCE_STORAGE_LIB_H_
19 #define _TCG_PHYSICAL_PRESENCE_STORAGE_LIB_H_
20
21 //
22 // UEFI TCG2 library definition bit of the BIOS Storage Management Flags
23 //
24 #define TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID BIT1
25 #define TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID BIT2
26 #define TCG_BIOS_STORAGE_MANAGEMENT_FLAG_ENABLE_BLOCK_SID BIT3
27
28 //
29 // Default value
30 //
31 #define TCG_BIOS_STORAGE_MANAGEMENT_FLAG_DEFAULT (TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID |\
32 TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID)
33
34 /**
35 Check and execute the pending TPM request.
36
37 The TPM request may come from OS or BIOS. This API will display request information and wait
38 for user confirmation if TPM request exists. The TPM request will be sent to TPM device after
39 the TPM request is confirmed, and one or more reset may be required to make TPM request to
40 take effect.
41
42 This API should be invoked after console in and console out are all ready as they are required
43 to display request information and get user input to confirm the request.
44
45 @param[in] PlatformAuth platform auth value. NULL means no platform auth change.
46 **/
47 VOID
48 EFIAPI
49 TcgPhysicalPresenceStorageLibProcessRequest (
50 VOID
51 );
52
53 /**
54 Check if the pending TPM request needs user input to confirm.
55
56 The TPM request may come from OS. This API will check if TPM request exists and need user
57 input to confirmation.
58
59 @retval TRUE TPM needs input to confirm user physical presence.
60 @retval FALSE TPM doesn't need input to confirm user physical presence.
61
62 **/
63 BOOLEAN
64 EFIAPI
65 TcgPhysicalPresenceStorageLibNeedUserConfirm(
66 VOID
67 );
68
69 /**
70 The handler for TPM physical presence function:
71 Submit TPM Operation Request to Pre-OS Environment and
72 Submit TPM Operation Request to Pre-OS Environment 2.
73
74 Caution: This function may receive untrusted input.
75
76 @param[in] OperationRequest TPM physical presence operation request.
77 @param[in] RequestParameter TPM physical presence operation request parameter.
78
79 @return Return Code for Submit TPM Operation Request to Pre-OS Environment and
80 Submit TPM Operation Request to Pre-OS Environment 2.
81 **/
82 UINT32
83 EFIAPI
84 TcgPhysicalPresenceStorageLibSubmitRequestToPreOSFunction (
85 IN UINT32 OperationRequest,
86 IN UINT32 RequestParameter
87 );
88
89 /**
90 The handler for TPM physical presence function:
91 Return TPM Operation Response to OS Environment.
92
93 This API should be invoked in OS runtime phase to interface with ACPI method.
94
95 @param[out] MostRecentRequest Most recent operation request.
96 @param[out] Response Response to the most recent operation request.
97
98 @return Return Code for Return TPM Operation Response to OS Environment.
99 **/
100 UINT32
101 EFIAPI
102 TcgPhysicalPresenceStorageLibReturnOperationResponseToOsFunction (
103 OUT UINT32 *MostRecentRequest,
104 OUT UINT32 *Response
105 );
106
107 /**
108 The handler for TPM physical presence function:
109 Return TPM Operation flag variable.
110
111 @return Return Code for Return TPM Operation flag variable.
112 **/
113 UINT32
114 EFIAPI
115 TcgPhysicalPresenceStorageLibReturnStorageFlags (
116 VOID
117 );
118
119 /**
120
121 Install string package.
122
123 @param ImageHandle The image handle.
124 @param SystemTable The system table.
125
126 @retval EFI_SUCEESS Install string package success.
127 @retval Other Return error status.
128
129 **/
130 EFI_STATUS
131 EFIAPI
132 TcgPhysicalPresenceStorageLibConstructor (
133 IN EFI_HANDLE ImageHandle,
134 IN EFI_SYSTEM_TABLE *SystemTable
135 );
136
137 /**
138 Unloads the library and its installed protocol.
139
140 @param[in] ImageHandle Handle that identifies the image to be unloaded.
141 @param[in] SystemTable System Table
142
143 @retval EFI_SUCCESS The image has been unloaded.
144 **/
145 EFI_STATUS
146 EFIAPI
147 TcgPhysicalPresenceStorageLibDestructor (
148 IN EFI_HANDLE ImageHandle,
149 IN EFI_SYSTEM_TABLE *SystemTable
150 );
151
152 #endif