diff options
author | Umang Patel <umang.patel@intel.com> | 2023-01-13 03:01:14 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-03-27 16:25:51 +0000 |
commit | c8e631588b9591489d0219db1d14664e10367ecd (patch) | |
tree | d0cc5e91f9eee5a70e07ce141886c08e14e62a50 | |
parent | 2bc854588309b6a9b348655297f3f82165de23a7 (diff) | |
download | edk2-c8e631588b9591489d0219db1d14664e10367ecd.tar.gz |
MdeModulePkg/Include/Ppi: Add FirmwareVolumeShadowPpi
Add FirmwareVolumeShadow PPI to shadow an FV to memory.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Patel Umang <umang.patel@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
-rw-r--r-- | MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h | 61 | ||||
-rw-r--r-- | MdeModulePkg/MdeModulePkg.dec | 3 |
2 files changed, 64 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h b/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h new file mode 100644 index 0000000000..a2756cb0ab --- /dev/null +++ b/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h @@ -0,0 +1,61 @@ +/** @file
+ Define PPI to shadow Firmware Volume from flash to Permanent Memory.
+
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_
+#define PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_
+
+//
+// Firmware Volume Shadow PPI GUID value
+//
+#define EDKII_FIRMWARE_VOLUME_SHADOW_PPI_GUID \
+ { \
+ 0x7dfe756c, 0xed8d, 0x4d77, { 0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } \
+ }
+
+/**
+ Copy FV to Destination. Length of copy is FV length from FV Header.
+
+ @param[in] FirmwareVolumeBase Base address of FV to shadow. Length of FV
+ is in FV Header.
+ @param[in] Destination Pointer to the Buffer in system memory to
+ shadow FV.
+ @param[in] DestinationLength Size of Destination buffer in bytes.
+
+ @retval EFI_SUCCESS Shadow complete
+ @retval EFI_INVALID_PARAMETER Destination is NULL
+ @retval EFI_INVALID_PARAMETER DestinationLength = 0.
+ @retval EFI_INVALID_PARAMETER FV does not have valid FV Header.
+ @retval EFI_INVALID_PARAMETER FV overlaps Destination.
+ @retval EFI_INVALID_PARAMETER Destination + DestinationLength rolls over 4GB
+ for 32-bit or 64-bit rollover.
+ @retval EFI_BUFFER_TOO_SMALL DestinationLength less than FV length from FV
+ Header.
+ @retval EFI_UNSUPPORTED FirmwareVolumeBase to FVBase + FVLength does
+ not support shadow. Caller should fallback to
+ CopyMem().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_PEI_FIRMWARE_VOLUME_SHADOW)(
+ IN EFI_PHYSICAL_ADDRESS FirmwareVolumeBase,
+ IN VOID *Destination,
+ IN UINTN DestinationLength
+ );
+
+///
+/// This PPI provides a service to shadow a FV from one location to another
+///
+typedef struct {
+ EDKII_PEI_FIRMWARE_VOLUME_SHADOW FirmwareVolumeShadow;
+} EDKII_PEI_FIRMWARE_VOLUME_SHADOW_PPI;
+
+extern EFI_GUID gEdkiiPeiFirmwareVolumeShadowPpiGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index e8058c8bfa..3eb4a79bf7 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -442,6 +442,9 @@ gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }
[Ppis]
+ ## Include/Ppi/FirmwareVolumeShadowPpi.h
+ gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }
+
## Include/Ppi/AtaController.h
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
|