]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.c
MdeModulePkg: Change OPTIONAL keyword usage style
[mirror_edk2.git] / MdeModulePkg / Library / LockBoxNullLib / LockBoxNullLib.c
CommitLineData
1c837cd5 1/** @file\r
2\r
99383667 3Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>\r
1c837cd5 4\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
1c837cd5 6\r
7**/\r
8\r
9#include <Uefi.h>\r
10#include <Library/DebugLib.h>\r
11\r
12/**\r
13 This function will save confidential information to lockbox.\r
14\r
15 @param Guid the guid to identify the confidential information\r
16 @param Buffer the address of the confidential information\r
17 @param Length the length of the confidential information\r
18\r
19 @retval RETURN_SUCCESS the information is saved successfully.\r
20 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0\r
21 @retval RETURN_ALREADY_STARTED the requested GUID already exist.\r
22 @retval RETURN_OUT_OF_RESOURCES no enough resource to save the information.\r
23 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r
24 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
25 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
26**/\r
27RETURN_STATUS\r
28EFIAPI\r
29SaveLockBox (\r
30 IN GUID *Guid,\r
31 IN VOID *Buffer,\r
32 IN UINTN Length\r
33 )\r
34{\r
35 return RETURN_SUCCESS;\r
36}\r
37\r
38/**\r
39 This function will set lockbox attributes.\r
40\r
41 @param Guid the guid to identify the confidential information\r
42 @param Attributes the attributes of the lockbox\r
43\r
44 @retval RETURN_SUCCESS the information is saved successfully.\r
45 @retval RETURN_INVALID_PARAMETER attributes is invalid.\r
46 @retval RETURN_NOT_FOUND the requested GUID not found.\r
47 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r
48 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
49 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
50**/\r
51RETURN_STATUS\r
52EFIAPI\r
53SetLockBoxAttributes (\r
54 IN GUID *Guid,\r
55 IN UINT64 Attributes\r
56 )\r
57{\r
58 return RETURN_SUCCESS;\r
59}\r
60\r
61/**\r
62 This function will update confidential information to lockbox.\r
63\r
64 @param Guid the guid to identify the original confidential information\r
65 @param Offset the offset of the original confidential information\r
66 @param Buffer the address of the updated confidential information\r
67 @param Length the length of the updated confidential information\r
68\r
69 @retval RETURN_SUCCESS the information is saved successfully.\r
70 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0.\r
71 @retval RETURN_NOT_FOUND the requested GUID not found.\r
99383667
HW
72 @retval RETURN_BUFFER_TOO_SMALL for lockbox without attribute LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY,\r
73 the original buffer to too small to hold new information.\r
74 @retval RETURN_OUT_OF_RESOURCES for lockbox with attribute LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY,\r
75 no enough resource to save the information.\r
1c837cd5 76 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r
77 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
78 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
79**/\r
80RETURN_STATUS\r
81EFIAPI\r
82UpdateLockBox (\r
83 IN GUID *Guid,\r
84 IN UINTN Offset,\r
85 IN VOID *Buffer,\r
86 IN UINTN Length\r
87 )\r
88{\r
89 return RETURN_SUCCESS;\r
90}\r
91\r
92/**\r
93 This function will restore confidential information from lockbox.\r
94\r
95 @param Guid the guid to identify the confidential information\r
96 @param Buffer the address of the restored confidential information\r
97 NULL means restored to original address, Length MUST be NULL at same time.\r
98 @param Length the length of the restored confidential information\r
99\r
100 @retval RETURN_SUCCESS the information is restored successfully.\r
101 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL.\r
d1102dba 102 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no\r
1c837cd5 103 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.\r
104 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information.\r
105 @retval RETURN_NOT_FOUND the requested GUID not found.\r
106 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
107 @retval RETURN_ACCESS_DENIED not allow to restore to the address\r
108 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
109**/\r
110RETURN_STATUS\r
111EFIAPI\r
112RestoreLockBox (\r
113 IN GUID *Guid,\r
e3917e22 114 IN VOID *Buffer OPTIONAL,\r
1c837cd5 115 IN OUT UINTN *Length OPTIONAL\r
116 )\r
117{\r
118 return RETURN_SUCCESS;\r
119}\r
120\r
121/**\r
122 This function will restore confidential information from all lockbox which have RestoreInPlace attribute.\r
123\r
124 @retval RETURN_SUCCESS the information is restored successfully.\r
125 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
126 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
127**/\r
128RETURN_STATUS\r
129EFIAPI\r
130RestoreAllLockBoxInPlace (\r
131 VOID\r
132 )\r
133{\r
134 return RETURN_SUCCESS;\r
135}\r