]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/LockBoxLib.h
MdeModulePkg/TcpIoLib: Check input Timeout before calling CheckEvent() service.
[mirror_edk2.git] / MdeModulePkg / Include / Library / LockBoxLib.h
CommitLineData
1c837cd5 1/** @file\r
2 This library is only intended to be used by DXE modules that need save\r
3 confidential information to LockBox and get it by PEI modules in S3 phase.\r
4\r
5Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
6\r
7This program and the accompanying materials\r
8are licensed and made available under the terms and conditions\r
9of the BSD License which accompanies this distribution. The\r
10full text of the license may be found at\r
11http://opensource.org/licenses/bsd-license.php\r
12\r
13THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
18#ifndef _LOCK_BOX_LIB_H_\r
19#define _LOCK_BOX_LIB_H_\r
20\r
21/**\r
22 This function will save confidential information to lockbox.\r
23\r
24 @param Guid the guid to identify the confidential information\r
25 @param Buffer the address of the confidential information\r
26 @param Length the length of the confidential information\r
27\r
28 @retval RETURN_SUCCESS the information is saved successfully.\r
29 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0\r
30 @retval RETURN_ALREADY_STARTED the requested GUID already exist.\r
31 @retval RETURN_OUT_OF_RESOURCES no enough resource to save the information.\r
32 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r
33 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
34 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
35**/\r
36RETURN_STATUS\r
37EFIAPI\r
38SaveLockBox (\r
39 IN GUID *Guid,\r
40 IN VOID *Buffer,\r
41 IN UINTN Length\r
42 );\r
43\r
44/**\r
45 This function will set lockbox attributes.\r
46\r
47 @param Guid the guid to identify the confidential information\r
48 @param Attributes the attributes of the lockbox\r
49\r
50 @retval RETURN_SUCCESS the information is saved successfully.\r
51 @retval RETURN_INVALID_PARAMETER attributes is invalid.\r
52 @retval RETURN_NOT_FOUND the requested GUID not found.\r
53 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r
54 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
55 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
56**/\r
57RETURN_STATUS\r
58EFIAPI\r
59SetLockBoxAttributes (\r
60 IN GUID *Guid,\r
61 IN UINT64 Attributes\r
62 );\r
63\r
64//\r
65// With this flag, this LockBox can be restored to this Buffer with RestoreAllLockBoxInPlace()\r
66//\r
67#define LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE BIT0\r
68\r
69/**\r
70 This function will update confidential information to lockbox.\r
71\r
72 @param Guid the guid to identify the original confidential information\r
73 @param Offset the offset of the original confidential information\r
74 @param Buffer the address of the updated confidential information\r
75 @param Length the length of the updated confidential information\r
76\r
77 @retval RETURN_SUCCESS the information is saved successfully.\r
78 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0.\r
79 @retval RETURN_NOT_FOUND the requested GUID not found.\r
80 @retval RETURN_BUFFER_TOO_SMALL the original buffer to too small to hold new information.\r
81 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface\r
82 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
83 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
84**/\r
85RETURN_STATUS\r
86EFIAPI\r
87UpdateLockBox (\r
88 IN GUID *Guid,\r
89 IN UINTN Offset,\r
90 IN VOID *Buffer,\r
91 IN UINTN Length\r
92 );\r
93\r
94/**\r
95 This function will restore confidential information from lockbox.\r
96\r
97 @param Guid the guid to identify the confidential information\r
98 @param Buffer the address of the restored confidential information\r
99 NULL means restored to original address, Length MUST be NULL at same time.\r
100 @param Length the length of the restored confidential information\r
101\r
102 @retval RETURN_SUCCESS the information is restored successfully.\r
103 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL.\r
104 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no \r
105 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.\r
106 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information.\r
107 @retval RETURN_NOT_FOUND the requested GUID not found.\r
108 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
109 @retval RETURN_ACCESS_DENIED not allow to restore to the address\r
110 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
111**/\r
112RETURN_STATUS\r
113EFIAPI\r
114RestoreLockBox (\r
115 IN GUID *Guid,\r
116 IN VOID *Buffer, OPTIONAL\r
117 IN OUT UINTN *Length OPTIONAL\r
118 );\r
119\r
120/**\r
121 This function will restore confidential information from all lockbox which have RestoreInPlace attribute.\r
122\r
123 @retval RETURN_SUCCESS the information is restored successfully.\r
124 @retval RETURN_NOT_STARTED it is too early to invoke this interface\r
125 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.\r
126**/\r
127RETURN_STATUS\r
128EFIAPI\r
129RestoreAllLockBoxInPlace (\r
130 VOID\r
131 );\r
132\r
133#endif\r