]>
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 | |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
aaedfe3c JY |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef __HSTI_LIB_H__\r | |
10 | #define __HSTI_LIB_H__\r | |
11 | \r | |
12 | /**\r | |
13 | Publish HSTI table in AIP protocol.\r | |
14 | \r | |
15 | One system should have only one PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE.\r | |
16 | \r | |
17 | If the Role is NOT PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE,\r | |
18 | SecurityFeaturesRequired field will be ignored.\r | |
19 | \r | |
20 | @param Hsti HSTI data\r | |
21 | @param HstiSize HSTI size\r | |
22 | \r | |
23 | @retval EFI_SUCCESS The HSTI data is published in AIP protocol.\r | |
24 | @retval EFI_ALREADY_STARTED There is already HSTI table with Role and ImplementationID published in system.\r | |
25 | @retval EFI_VOLUME_CORRUPTED The input HSTI data does not follow HSTI specification.\r | |
26 | @retval EFI_OUT_OF_RESOURCES There is not enough system resource to publish HSTI data in AIP protocol.\r | |
27 | **/\r | |
28 | EFI_STATUS\r | |
29 | EFIAPI\r | |
30 | HstiLibSetTable (\r | |
31 | IN VOID *Hsti,\r | |
32 | IN UINTN HstiSize\r | |
33 | );\r | |
34 | \r | |
35 | /**\r | |
36 | Search HSTI table in AIP protocol, and return the data.\r | |
37 | This API will return the HSTI table with indicated Role and ImplementationID,\r | |
38 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
39 | \r | |
40 | @param Role Role of HSTI data.\r | |
41 | @param ImplementationID ImplementationID of HSTI data.\r | |
42 | NULL means find the first one match Role.\r | |
43 | @param Hsti HSTI data. This buffer is allocated by callee, and it\r | |
44 | is the responsibility of the caller to free it after\r | |
45 | using it.\r | |
46 | @param HstiSize HSTI size\r | |
47 | \r | |
48 | @retval EFI_SUCCESS The HSTI data in AIP protocol is returned.\r | |
49 | @retval EFI_NOT_FOUND There is not HSTI table with the Role and ImplementationID published in system.\r | |
50 | **/\r | |
51 | EFI_STATUS\r | |
52 | EFIAPI\r | |
53 | HstiLibGetTable (\r | |
54 | IN UINT32 Role,\r | |
55 | IN CHAR16 *ImplementationID OPTIONAL,\r | |
56 | OUT VOID **Hsti,\r | |
57 | OUT UINTN *HstiSize\r | |
58 | );\r | |
59 | \r | |
60 | /**\r | |
61 | Set FeaturesVerified in published HSTI table.\r | |
62 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
63 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
64 | \r | |
65 | @param Role Role of HSTI data.\r | |
66 | @param ImplementationID ImplementationID of HSTI data.\r | |
67 | NULL means find the first one match Role.\r | |
68 | @param ByteIndex Byte index of FeaturesVerified of HSTI data.\r | |
69 | @param BitMask Bit mask of FeaturesVerified of HSTI data.\r | |
70 | \r | |
71 | @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.\r | |
72 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
73 | @retval EFI_UNSUPPORTED The ByteIndex is invalid.\r | |
74 | **/\r | |
75 | EFI_STATUS\r | |
76 | EFIAPI\r | |
77 | HstiLibSetFeaturesVerified (\r | |
78 | IN UINT32 Role,\r | |
79 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
80 | IN UINT32 ByteIndex,\r | |
81 | IN UINT8 BitMask\r | |
82 | );\r | |
83 | \r | |
84 | /**\r | |
85 | Clear FeaturesVerified in published HSTI table.\r | |
86 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
87 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
88 | \r | |
89 | @param Role Role of HSTI data.\r | |
90 | @param ImplementationID ImplementationID of HSTI data.\r | |
91 | NULL means find the first one match Role.\r | |
92 | @param ByteIndex Byte index of FeaturesVerified of HSTI data.\r | |
93 | @param BitMask Bit mask of FeaturesVerified of HSTI data.\r | |
94 | \r | |
95 | @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.\r | |
96 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
97 | @retval EFI_UNSUPPORTED The ByteIndex is invalid.\r | |
98 | **/\r | |
99 | EFI_STATUS\r | |
100 | EFIAPI\r | |
101 | HstiLibClearFeaturesVerified (\r | |
102 | IN UINT32 Role,\r | |
103 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
104 | IN UINT32 ByteIndex,\r | |
105 | IN UINT8 BitMask\r | |
106 | );\r | |
107 | \r | |
108 | /**\r | |
109 | Append ErrorString in published HSTI table.\r | |
110 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
111 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
112 | \r | |
113 | @param Role Role of HSTI data.\r | |
114 | @param ImplementationID ImplementationID of HSTI data.\r | |
115 | NULL means find the first one match Role.\r | |
116 | @param ErrorString ErrorString of HSTI data.\r | |
117 | \r | |
118 | @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.\r | |
119 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
120 | @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.\r | |
121 | **/\r | |
122 | EFI_STATUS\r | |
123 | EFIAPI\r | |
124 | HstiLibAppendErrorString (\r | |
125 | IN UINT32 Role,\r | |
126 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
127 | IN CHAR16 *ErrorString\r | |
128 | );\r | |
129 | \r | |
130 | /**\r | |
131 | Set a new ErrorString in published HSTI table.\r | |
132 | This API will update the HSTI table with indicated Role and ImplementationID,\r | |
133 | NULL ImplementationID means to find the first HSTI table with indicated Role.\r | |
134 | \r | |
135 | @param Role Role of HSTI data.\r | |
136 | @param ImplementationID ImplementationID of HSTI data.\r | |
137 | NULL means find the first one match Role.\r | |
138 | @param ErrorString ErrorString of HSTI data.\r | |
139 | \r | |
140 | @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.\r | |
141 | @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.\r | |
142 | @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.\r | |
143 | **/\r | |
144 | EFI_STATUS\r | |
145 | EFIAPI\r | |
146 | HstiLibSetErrorString (\r | |
147 | IN UINT32 Role,\r | |
148 | IN CHAR16 *ImplementationID, OPTIONAL\r | |
149 | IN CHAR16 *ErrorString\r | |
150 | );\r | |
151 | \r | |
152 | #endif\r |