]>
Commit | Line | Data |
---|---|---|
70c7664c JY |
1 | /** @file\r |
2 | TCG MOR (Memory Overwrite Request) Lock Control Driver header file.\r | |
b3548d32 LG |
3 | \r |
4 | Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
289b714b | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
70c7664c JY |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _EFI_TCG_MOR_LOCK_H_\r | |
10 | #define _EFI_TCG_MOR_LOCK_H_\r | |
11 | \r | |
12 | /**\r | |
13 | This service is a wrapper for the UEFI Runtime Service GetVariable().\r | |
14 | \r | |
15 | @param VariableName the name of the vendor's variable, it's a Null-Terminated Unicode String\r | |
16 | @param VendorGuid Unify identifier for vendor.\r | |
17 | @param Attributes Point to memory location to return the attributes of variable. If the point\r | |
18 | is NULL, the parameter would be ignored.\r | |
19 | @param DataSize As input, point to the maximum size of return Data-Buffer.\r | |
20 | As output, point to the actual size of the returned Data-Buffer.\r | |
21 | @param Data Point to return Data-Buffer.\r | |
22 | \r | |
23 | @retval EFI_SUCCESS The function completed successfully.\r | |
24 | @retval EFI_NOT_FOUND The variable was not found.\r | |
25 | @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. DataSize has\r | |
26 | been updated with the size needed to complete the request.\r | |
27 | @retval EFI_INVALID_PARAMETER VariableName is NULL.\r | |
28 | @retval EFI_INVALID_PARAMETER VendorGuid is NULL.\r | |
29 | @retval EFI_INVALID_PARAMETER DataSize is NULL.\r | |
30 | @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.\r | |
31 | @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r | |
32 | @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.\r | |
33 | **/\r | |
34 | EFI_STATUS\r | |
35 | EFIAPI\r | |
36 | InternalGetVariable (\r | |
c411b485 MK |
37 | IN CHAR16 *VariableName,\r |
38 | IN EFI_GUID *VendorGuid,\r | |
39 | OUT UINT32 *Attributes OPTIONAL,\r | |
40 | IN OUT UINTN *DataSize,\r | |
41 | OUT VOID *Data\r | |
70c7664c JY |
42 | );\r |
43 | \r | |
44 | /**\r | |
45 | This service is a wrapper for the UEFI Runtime Service SetVariable()\r | |
46 | \r | |
47 | @param VariableName the name of the vendor's variable, as a\r | |
48 | Null-Terminated Unicode String\r | |
49 | @param VendorGuid Unify identifier for vendor.\r | |
50 | @param Attributes Point to memory location to return the attributes of variable. If the point\r | |
51 | is NULL, the parameter would be ignored.\r | |
52 | @param DataSize The size in bytes of Data-Buffer.\r | |
53 | @param Data Point to the content of the variable.\r | |
54 | \r | |
55 | @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r | |
56 | defined by the Attributes.\r | |
57 | @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the\r | |
58 | DataSize exceeds the maximum allowed.\r | |
59 | @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string.\r | |
60 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r | |
61 | @retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.\r | |
62 | @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r | |
63 | @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r | |
0130fdde | 64 | @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\r |
70c7664c JY |
65 | set but the AuthInfo does NOT pass the validation check carried\r |
66 | out by the firmware.\r | |
67 | @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r | |
68 | \r | |
69 | **/\r | |
70 | EFI_STATUS\r | |
71 | EFIAPI\r | |
72 | InternalSetVariable (\r | |
c411b485 MK |
73 | IN CHAR16 *VariableName,\r |
74 | IN EFI_GUID *VendorGuid,\r | |
75 | IN UINT32 Attributes,\r | |
76 | IN UINTN DataSize,\r | |
77 | IN VOID *Data\r | |
70c7664c JY |
78 | );\r |
79 | \r | |
80 | /**\r | |
81 | This service is a checker handler for the UEFI Runtime Service SetVariable()\r | |
82 | \r | |
83 | @param VariableName the name of the vendor's variable, as a\r | |
84 | Null-Terminated Unicode String\r | |
85 | @param VendorGuid Unify identifier for vendor.\r | |
86 | @param Attributes Point to memory location to return the attributes of variable. If the point\r | |
87 | is NULL, the parameter would be ignored.\r | |
88 | @param DataSize The size in bytes of Data-Buffer.\r | |
89 | @param Data Point to the content of the variable.\r | |
90 | \r | |
91 | @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r | |
92 | defined by the Attributes.\r | |
93 | @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the\r | |
94 | DataSize exceeds the maximum allowed.\r | |
95 | @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string.\r | |
96 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r | |
97 | @retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.\r | |
98 | @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r | |
99 | @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r | |
0130fdde | 100 | @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\r |
70c7664c JY |
101 | set but the AuthInfo does NOT pass the validation check carried\r |
102 | out by the firmware.\r | |
103 | @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r | |
104 | \r | |
105 | **/\r | |
106 | EFI_STATUS\r | |
107 | EFIAPI\r | |
108 | SetVariableCheckHandlerMor (\r | |
c411b485 MK |
109 | IN CHAR16 *VariableName,\r |
110 | IN EFI_GUID *VendorGuid,\r | |
111 | IN UINT32 Attributes,\r | |
112 | IN UINTN DataSize,\r | |
113 | IN VOID *Data\r | |
70c7664c JY |
114 | );\r |
115 | \r | |
116 | /**\r | |
117 | Entry Point for MOR Lock Control driver.\r | |
118 | \r | |
119 | @param[in] ImageHandle Image handle of this driver.\r | |
120 | @param[in] SystemTable A Pointer to the EFI System Table.\r | |
121 | \r | |
d6b926e7 | 122 | @retval EFI_SUCCESS\r |
70c7664c JY |
123 | @return Others Some error occurs.\r |
124 | **/\r | |
125 | EFI_STATUS\r | |
126 | EFIAPI\r | |
127 | MorLockDriverInit (\r | |
128 | VOID\r | |
129 | );\r | |
130 | \r | |
131 | #endif\r |