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