]> xenbits.xensource.com Git - ovmf.git/commitdiff
MdeModulePkg/Include/Ppi: Add FirmwareVolumeShadowPpi
authorUmang Patel <umang.patel@intel.com>
Fri, 13 Jan 2023 11:01:14 +0000 (03:01 -0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 27 Mar 2023 16:25:51 +0000 (16:25 +0000)
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>
MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h b/MdeModulePkg/Include/Ppi/FirmwareVolumeShadowPpi.h
new file mode 100644 (file)
index 0000000..a2756cb
--- /dev/null
@@ -0,0 +1,61 @@
+/** @file\r
+  Define PPI to shadow Firmware Volume from flash to Permanent Memory.\r
+\r
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>\r
+\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_\r
+#define PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_\r
+\r
+//\r
+// Firmware Volume Shadow PPI GUID value\r
+//\r
+#define EDKII_FIRMWARE_VOLUME_SHADOW_PPI_GUID \\r
+  { \\r
+    0x7dfe756c, 0xed8d, 0x4d77, { 0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } \\r
+  }\r
+\r
+/**\r
+  Copy FV to Destination.  Length of copy is FV length from FV Header.\r
+\r
+  @param[in]  FirmwareVolumeBase  Base address of FV to shadow. Length of FV\r
+                                  is in FV Header.\r
+  @param[in]  Destination         Pointer to the Buffer in system memory to\r
+                                  shadow FV.\r
+  @param[in]  DestinationLength   Size of Destination buffer in bytes.\r
+\r
+  @retval EFI_SUCCESS            Shadow complete\r
+  @retval EFI_INVALID_PARAMETER  Destination is NULL\r
+  @retval EFI_INVALID_PARAMETER  DestinationLength = 0.\r
+  @retval EFI_INVALID_PARAMETER  FV does not have valid FV Header.\r
+  @retval EFI_INVALID_PARAMETER  FV overlaps Destination.\r
+  @retval EFI_INVALID_PARAMETER  Destination + DestinationLength rolls over 4GB\r
+                                 for 32-bit or 64-bit rollover.\r
+  @retval EFI_BUFFER_TOO_SMALL   DestinationLength less than FV length from FV\r
+                                 Header.\r
+  @retval EFI_UNSUPPORTED        FirmwareVolumeBase to FVBase + FVLength does\r
+                                 not support shadow.  Caller should fallback to\r
+                                 CopyMem().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_PEI_FIRMWARE_VOLUME_SHADOW)(\r
+  IN EFI_PHYSICAL_ADDRESS  FirmwareVolumeBase,\r
+  IN VOID                  *Destination,\r
+  IN UINTN                 DestinationLength\r
+  );\r
+\r
+///\r
+/// This PPI provides a service to shadow a FV from one location to another\r
+///\r
+typedef struct {\r
+  EDKII_PEI_FIRMWARE_VOLUME_SHADOW    FirmwareVolumeShadow;\r
+} EDKII_PEI_FIRMWARE_VOLUME_SHADOW_PPI;\r
+\r
+extern EFI_GUID  gEdkiiPeiFirmwareVolumeShadowPpiGuid;\r
+\r
+#endif\r
index e8058c8bfaecbf481c3520d0f601b434f5440045..3eb4a79bf7a03a07cbb7f357ff93eb26bd2485d1 100644 (file)
   gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }\r
 \r
 [Ppis]\r
+  ## Include/Ppi/FirmwareVolumeShadowPpi.h\r
+  gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }\r
+\r
   ## Include/Ppi/AtaController.h\r
   gPeiAtaControllerPpiGuid       = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}\r
 \r