]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg PiFirmwareVolume.h: Add USED_SIZE FV_EXT_TYPE definitions
authorStar Zeng <star.zeng@intel.com>
Tue, 21 Nov 2017 10:51:19 +0000 (18:51 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 1 Dec 2017 01:36:46 +0000 (09:36 +0800)
The definitions are introduced by PI 1.6 spec.

The EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE can be used to find
out how many EFI_FVB2_ERASE_POLARITY bytes are at the end of the FV.

When the FV gets shadowed into memory you only need to copy the used
bytes into memory and fill the rest of the memory buffer with the
erase value.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/Pi/PiFirmwareVolume.h

index 79fde131902e67e683c6aae1d5899b48bea5aaf2..2482a7f96addc2a2d0cabe29959623183b2a359d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The firmware volume related definitions in PI.\r
 \r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -11,7 +11,7 @@
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
   @par Revision Reference:\r
-  PI Version 1.3\r
+  PI Version 1.6\r
 \r
 **/\r
 \r
@@ -231,4 +231,23 @@ typedef struct {
   ///\r
 } EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;\r
 \r
+#define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03\r
+\r
+///\r
+/// The EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE can be used to find\r
+/// out how many EFI_FVB2_ERASE_POLARITY bytes are at the end of the FV.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Standard extension entry, with the type EFI_FV_EXT_TYPE_USED_SIZE_TYPE.\r
+  ///\r
+  EFI_FIRMWARE_VOLUME_EXT_ENTRY     Hdr;\r
+  ///\r
+  /// The number of bytes of the FV that are in uses. The remaining\r
+  /// EFI_FIRMWARE_VOLUME_HEADER FvLength minus UsedSize bytes in\r
+  /// the FV must contain the value implied by EFI_FVB2_ERASE_POLARITY.\r
+  ///\r
+  UINT32                            UsedSize;\r
+} EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE;\r
+\r
 #endif\r