-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MdeModulePkg: Add Mu DxeCapsuleLib changes and CapsulePersistLib
- Move Capsule infrastructure to TianoCore libs rather than private. - Add the CapsulePersistLib and remove references to MsCapsuleUpdatePkg. - Add CapsulePersistLib support to DxeCapsuleLib instance. - Modify DxeCapsuleProcessLib so that UpdateImageProgress() returns sucess - Switch debug print to DEBUG_ERROR during capsule processing
- Loading branch information
Showing
10 changed files
with
326 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** @file -- CapsulePersistLib.h | ||
A public library interface for persisting Capsules across reset. | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef CAPSULE_PERSIST_LIB_H_ | ||
#define CAPSULE_PERSIST_LIB_H_ | ||
|
||
/** | ||
Persist a Capsule across reset. | ||
@param[in] CapsuleHeader EFI_CAPSULE_HEADER pointing to Capsule Image to persist. | ||
@retval EFI_SUCCESS Capsule was successfully persisted. | ||
@retval EFI_DEVICE_ERROR Something went wrong while trying to persist the capsule. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
PersistCapsule ( | ||
IN EFI_CAPSULE_HEADER *CapsuleHeader | ||
); | ||
|
||
/** | ||
Returns a pointer to a buffer of capsules. | ||
If no persisted capsules present, CapsuleArray is not modified, and CapsuleArraySize will be set to zero. | ||
Removes the persistent capsules from whatever the medium of persistence is. | ||
Note: if return is something other than EFI_SUCESS or EFI_BUFFER_TOO_SMALL, removal of all persistent | ||
capsules from persistence is not guaranteed. | ||
@param[out] CapsuleArray Pointer to a buffer to hold the capsules. | ||
@param[out] CapsuleArraySize On input, size of CapsuleArray allocation. | ||
On output, size of actual buffer of capsules. | ||
@retval EFI_SUCCESS Capsules were de-perisisted, and ouptut data is valid. | ||
@retval EFI_BUFFER_TOO_SMALL CapsuleArray buffer is too small to hold all the data. | ||
@retval EFI_DEVICE_ERROR Something went wrong while trying to retrive the capsule. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
GetPersistedCapsules ( | ||
OUT EFI_CAPSULE_HEADER *CapsuleArray, | ||
OUT UINTN *CapsuleArraySize | ||
); | ||
|
||
#endif // CAPSULE_PERSIST_LIB_H_ |
57 changes: 57 additions & 0 deletions
57
MdeModulePkg/Library/CapsulePersistLibNull/CapsulePersistLibNull.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @file -- CapsulePersistLibNull.c | ||
A null implementation of the CapsulePersistLib | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Library/CapsulePersistLib.h> | ||
|
||
/** | ||
Persist a Capsule across reset. | ||
@param[in] CapsuleHeader EFI_CAPSULE_HEADER pointing to Capsule Image to persist. | ||
@retval EFI_SUCCESS Capsule was successfully persisted. | ||
@retval EFI_DEVICE_ERROR Something went wrong while trying to persist the blob. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
PersistCapsule ( | ||
IN EFI_CAPSULE_HEADER *CapsuleHeader | ||
) | ||
{ | ||
return EFI_SUCCESS; | ||
} | ||
|
||
/** | ||
Returns a pointer to a buffer of capsules. | ||
If no persisted capsules present, CapsuleArray is not modified, and CapsuleArraySize will be set to zero. | ||
Removes the persistent capsules from whatever the medium of persistence is. | ||
Note: if return is something other than EFI_SUCESS or EFI_BUFFER_TOO_SMALL, removal of all persistent | ||
capsules from persistence is not guaranteed. | ||
@param[out] CapsuleArray Pointer to a buffer to hold the capsules. | ||
@param[out] CapsuleArraySize On input, size of CapsuleArray allocation. | ||
On output, size of actual buffer of capsules. | ||
@retval EFI_SUCCESS Capsules were de-perisisted, and ouptut data is valid. | ||
@retval EFI_BUFFER_TOO_SMALL CapsuleArray buffer is too small to hold all the data. | ||
@retval EFI_DEVICE_ERROR Something went wrong while trying to retrive the capsule. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
GetPersistedCapsules ( | ||
OUT EFI_CAPSULE_HEADER *CapsuleArray, | ||
OUT UINTN *CapsuleArraySize | ||
) | ||
{ | ||
*CapsuleArraySize = 0; | ||
return EFI_SUCCESS; | ||
} |
36 changes: 36 additions & 0 deletions
36
MdeModulePkg/Library/CapsulePersistLibNull/CapsulePersistLibNull.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## @file CapsulePersistLibNull.inf | ||
# A null implementation of the CapsulePersistLib | ||
# | ||
## | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
## | ||
|
||
|
||
[Defines] | ||
INF_VERSION = 0x00010017 | ||
BASE_NAME = CapsulePersistLibNull | ||
FILE_GUID = 96AAE710-21AB-4881-9D92-8AD19479BB36 | ||
VERSION_STRING = 1.0 | ||
MODULE_TYPE = DXE_RUNTIME_DRIVER | ||
LIBRARY_CLASS = CapsulePersistLib | ||
|
||
# | ||
# The following information is for reference only and not required by the build tools. | ||
# | ||
# VALID_ARCHITECTURES = IA32 X64 | ||
# | ||
|
||
|
||
[Sources] | ||
CapsulePersistLibNull.c | ||
|
||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
MdeModulePkg/MdeModulePkg.dec | ||
|
||
|
||
[LibraryClasses] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.