]>
Commit | Line | Data |
---|---|---|
aaedfe3c JY |
1 | /** @file\r |
2 | Provides services to create, get and update HSTI table in AIP protocol.\r | |
3 | \r | |
4 | Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef __HSTI_LIB_H__\r | |
16 | #define __HSTI_LIB_H__\r | |
17 | \r | |
18 | /**\r | |
19 | Publish HSTI table in AIP protocol.\r | |
20 | \r | |
21 | One system should have only one PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE.\r | |
22 | \r | |
23 | If the Role is NOT PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE,\r | |
24 | SecurityFeaturesRequired field will be ignored.\r | |
25 | \r | |
26 | @param Hsti HSTI data\r | |
27 | @param HstiSize HSTI size\r | |
28 | \r | |
29 | @retval EFI_SUCCESS The HSTI data is published in AIP protocol.\r | |
30 | @retval EFI_ALREADY_STARTED There is already HSTI table with Role and ImplementationID published in system.\r | |
31 | @retval EFI_VOLUME_CORRUPTED The input HSTI data does not follow HSTI specification.\r | |
32 | @retval EFI_OUT_OF_RESOURCES There is not enough system resource to publish HSTI data in AIP protocol.\r | |
33 | **/\r | |
34 | EFI_STATUS\r | |
35 | EFIAPI\r | |
36 | HstiLibSetTable (\r | |
37 | IN VOID *Hsti,\r | |
38 | IN UINTN HstiSize\r | |
39 | );\r | |
40 | \r | |
41 | /**\r | |
42 | Search HSTI table in AIP protocol, and return the data.\r | |
43 | This API will return the HSTI table with indicated Role and ImplementationID,\r | |
44 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
45 | \r | |
46 | @param Role Role of HSTI data.\r | |
47 | @param ImplementationID ImplementationID of HSTI data.\r | |
48 | NULL means find the first one match Role.\r | |
49 | @param Hsti HSTI data. This buffer is allocated by callee, and it\r | |
50 | is the responsibility of the caller to free it after\r | |
51 | using it.\r | |
52 | @param HstiSize HSTI size\r | |
53 | \r | |
54 | @retval EFI_SUCCESS The HSTI data in AIP protocol is returned.\r | |
55 | @retval EFI_NOT_FOUND There is not HSTI table with the Role and ImplementationID published in system.\r | |
56 | **/\r | |
57 | EFI_STATUS\r | |
58 | EFIAPI\r | |
59 | HstiLibGetTable (\r | |
60 | IN UINT32 Role,\r | |
61 | IN CHAR16 *ImplementationID OPTIONAL,\r | |
62 | OUT VOID **Hsti,\r | |
63 | OUT UINTN *HstiSize\r | |
64 | );\r | |
65 | \r | |
66 | /**\r | |
67 | Set FeaturesVerified in published HSTI table.\r | |
68 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
69 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
70 | \r | |
71 | @param Role Role of HSTI data.\r | |
72 | @param ImplementationID ImplementationID of HSTI data.\r | |
73 | NULL means find the first one match Role.\r | |
74 | @param ByteIndex Byte index of FeaturesVerified of HSTI data.\r | |
75 | @param BitMask Bit mask of FeaturesVerified of HSTI data.\r | |
76 | \r | |
77 | @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.\r | |
78 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
79 | @retval EFI_UNSUPPORTED The ByteIndex is invalid.\r | |
80 | **/\r | |
81 | EFI_STATUS\r | |
82 | EFIAPI\r | |
83 | HstiLibSetFeaturesVerified (\r | |
84 | IN UINT32 Role,\r | |
85 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
86 | IN UINT32 ByteIndex,\r | |
87 | IN UINT8 BitMask\r | |
88 | );\r | |
89 | \r | |
90 | /**\r | |
91 | Clear FeaturesVerified in published HSTI table.\r | |
92 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
93 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
94 | \r | |
95 | @param Role Role of HSTI data.\r | |
96 | @param ImplementationID ImplementationID of HSTI data.\r | |
97 | NULL means find the first one match Role.\r | |
98 | @param ByteIndex Byte index of FeaturesVerified of HSTI data.\r | |
99 | @param BitMask Bit mask of FeaturesVerified of HSTI data.\r | |
100 | \r | |
101 | @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.\r | |
102 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
103 | @retval EFI_UNSUPPORTED The ByteIndex is invalid.\r | |
104 | **/\r | |
105 | EFI_STATUS\r | |
106 | EFIAPI\r | |
107 | HstiLibClearFeaturesVerified (\r | |
108 | IN UINT32 Role,\r | |
109 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
110 | IN UINT32 ByteIndex,\r | |
111 | IN UINT8 BitMask\r | |
112 | );\r | |
113 | \r | |
114 | /**\r | |
115 | Append ErrorString in published HSTI table.\r | |
116 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
117 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
118 | \r | |
119 | @param Role Role of HSTI data.\r | |
120 | @param ImplementationID ImplementationID of HSTI data.\r | |
121 | NULL means find the first one match Role.\r | |
122 | @param ErrorString ErrorString of HSTI data.\r | |
123 | \r | |
124 | @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.\r | |
125 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
126 | @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.\r | |
127 | **/\r | |
128 | EFI_STATUS\r | |
129 | EFIAPI\r | |
130 | HstiLibAppendErrorString (\r | |
131 | IN UINT32 Role,\r | |
132 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
133 | IN CHAR16 *ErrorString\r | |
134 | );\r | |
135 | \r | |
136 | /**\r | |
137 | Set a new ErrorString in published HSTI table.\r | |
138 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
139 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
140 | \r | |
141 | @param Role Role of HSTI data.\r | |
142 | @param ImplementationID ImplementationID of HSTI data.\r | |
143 | NULL means find the first one match Role.\r | |
144 | @param ErrorString ErrorString of HSTI data.\r | |
145 | \r | |
146 | @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.\r | |
147 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
148 | @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.\r | |
149 | **/\r | |
150 | EFI_STATUS\r | |
151 | EFIAPI\r | |
152 | HstiLibSetErrorString (\r | |
153 | IN UINT32 Role,\r | |
154 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
155 | IN CHAR16 *ErrorString\r | |
156 | );\r | |
157 | \r | |
158 | #endif\r |