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