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