]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/LockBoxLib.h
2 This library is only intended to be used by DXE modules that need save
3 confidential information to LockBox and get it by PEI modules in S3 phase.
5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions
9 of the BSD License which accompanies this distribution. The
10 full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef _LOCK_BOX_LIB_H_
19 #define _LOCK_BOX_LIB_H_
22 This function will save confidential information to lockbox.
24 @param Guid the guid to identify the confidential information
25 @param Buffer the address of the confidential information
26 @param Length the length of the confidential information
28 @retval RETURN_SUCCESS the information is saved successfully.
29 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0
30 @retval RETURN_ALREADY_STARTED the requested GUID already exist.
31 @retval RETURN_OUT_OF_RESOURCES no enough resource to save the information.
32 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface
33 @retval RETURN_NOT_STARTED it is too early to invoke this interface
34 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
45 This function will set lockbox attributes.
47 @param Guid the guid to identify the confidential information
48 @param Attributes the attributes of the lockbox
50 @retval RETURN_SUCCESS the information is saved successfully.
51 @retval RETURN_INVALID_PARAMETER attributes is invalid.
52 @retval RETURN_NOT_FOUND the requested GUID not found.
53 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface
54 @retval RETURN_NOT_STARTED it is too early to invoke this interface
55 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
59 SetLockBoxAttributes (
65 // With this flag, this LockBox can be restored to this Buffer
66 // with RestoreAllLockBoxInPlace()
68 #define LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE BIT0
70 // With this flag, this LockBox can be restored in S3 resume only.
71 // This LockBox can not be restored after SmmReadyToLock in normal boot
72 // and after EndOfS3Resume in S3 resume.
73 // It can not be set together with LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE.
75 #define LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY BIT1
78 This function will update confidential information to lockbox.
80 @param Guid the guid to identify the original confidential information
81 @param Offset the offset of the original confidential information
82 @param Buffer the address of the updated confidential information
83 @param Length the length of the updated confidential information
85 @retval RETURN_SUCCESS the information is saved successfully.
86 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or Buffer is NULL, or Length is 0.
87 @retval RETURN_NOT_FOUND the requested GUID not found.
88 @retval RETURN_BUFFER_TOO_SMALL the original buffer to too small to hold new information.
89 @retval RETURN_ACCESS_DENIED it is too late to invoke this interface
90 @retval RETURN_NOT_STARTED it is too early to invoke this interface
91 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
103 This function will restore confidential information from lockbox.
105 @param Guid the guid to identify the confidential information
106 @param Buffer the address of the restored confidential information
107 NULL means restored to original address, Length MUST be NULL at same time.
108 @param Length the length of the restored confidential information
110 @retval RETURN_SUCCESS the information is restored successfully.
111 @retval RETURN_INVALID_PARAMETER the Guid is NULL, or one of Buffer and Length is NULL.
112 @retval RETURN_WRITE_PROTECTED Buffer and Length are NULL, but the LockBox has no
113 LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE attribute.
114 @retval RETURN_BUFFER_TOO_SMALL the Length is too small to hold the confidential information.
115 @retval RETURN_NOT_FOUND the requested GUID not found.
116 @retval RETURN_NOT_STARTED it is too early to invoke this interface
117 @retval RETURN_ACCESS_DENIED not allow to restore to the address
118 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
124 IN VOID
*Buffer
, OPTIONAL
125 IN OUT UINTN
*Length OPTIONAL
129 This function will restore confidential information from all lockbox which have RestoreInPlace attribute.
131 @retval RETURN_SUCCESS the information is restored successfully.
132 @retval RETURN_NOT_STARTED it is too early to invoke this interface
133 @retval RETURN_UNSUPPORTED the service is not supported by implementaion.
137 RestoreAllLockBoxInPlace (