]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Pi/PiFirmwareVolume.h
MdeModulePkg: Add support for weakly aligned FVs.
[mirror_edk2.git] / MdePkg / Include / Pi / PiFirmwareVolume.h
index 8406f4abde5bb6f623dbb922d6b7b104991566d8..7aa2e5e0168f83ac1a325be7e9947bb1d3478980 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   The firmware volume related definitions in PI.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
+  Copyright (c) 2006 - 2013, 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
   http://opensource.org/licenses/bsd-license.php                                            \r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
   @par Revision Reference:\r
-  Version 1.0.\r
+  PI Version 1.3\r
 \r
 **/\r
 \r
 #ifndef __PI_FIRMWAREVOLUME_H__\r
 #define __PI_FIRMWAREVOLUME_H__\r
 \r
-//\r
-// EFI_FV_FILE_ATTRIBUTES\r
-//\r
+///\r
+/// EFI_FV_FILE_ATTRIBUTES\r
+///\r
 typedef UINT32  EFI_FV_FILE_ATTRIBUTES;\r
 \r
 //\r
@@ -30,7 +30,10 @@ typedef UINT32  EFI_FV_FILE_ATTRIBUTES;
 #define EFI_FV_FILE_ATTRIB_FIXED          0x00000100\r
 #define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED  0x00000200\r
 \r
-typedef UINT32  EFI_FVB2_ATTRIBUTES;\r
+///\r
+/// type of EFI FVB attribute\r
+/// \r
+typedef UINT32  EFI_FVB_ATTRIBUTES_2;\r
 \r
 // \r
 // Attributes bit definitions\r
@@ -70,7 +73,7 @@ typedef UINT32  EFI_FVB2_ATTRIBUTES;
 #define EFI_FVB2_ALIGNMENT_64K      0x00100000\r
 #define EFI_FVB2_ALIGNMENT_128K     0x00110000\r
 #define EFI_FVB2_ALIGNMENT_256K     0x00120000\r
-#define EFI_FVB2_ALIGNMNET_512K     0x00130000\r
+#define EFI_FVB2_ALIGNMENT_512K     0x00130000\r
 #define EFI_FVB2_ALIGNMENT_1M       0x00140000\r
 #define EFI_FVB2_ALIGNMENT_2M       0x00150000\r
 #define EFI_FVB2_ALIGNMENT_4M       0x00160000\r
@@ -83,61 +86,149 @@ typedef UINT32  EFI_FVB2_ATTRIBUTES;
 #define EFI_FVB2_ALIGNMENT_512M     0x001D0000\r
 #define EFI_FVB2_ALIGNMENT_1G       0x001E0000\r
 #define EFI_FVB2_ALIGNMENT_2G       0x001F0000\r
-\r
+#define EFI_FVB2_WEAK_ALIGNMENT     0x80000000\r
 \r
 typedef struct {\r
+  ///\r
+  /// The number of sequential blocks which are of the same size.\r
+  ///\r
   UINT32 NumBlocks;\r
+  ///\r
+  /// The size of the blocks.\r
+  ///\r
   UINT32 Length;\r
 } EFI_FV_BLOCK_MAP_ENTRY;\r
 \r
-//\r
-// Describes the features and layout of the firmware volume.\r
-//\r
+///\r
+/// Describes the features and layout of the firmware volume.\r
+///\r
 typedef struct {\r
+  ///\r
+  /// The first 16 bytes are reserved to allow for the reset vector of \r
+  /// processors whose reset vector is at address 0.\r
+  ///\r
   UINT8                     ZeroVector[16];\r
+  ///\r
+  /// Declares the file system with which the firmware volume is formatted.\r
+  ///\r
   EFI_GUID                  FileSystemGuid;\r
+  ///\r
+  /// Length in bytes of the complete firmware volume, including the header.\r
+  ///\r
   UINT64                    FvLength;\r
+  ///\r
+  /// Set to EFI_FVH_SIGNATURE\r
+  ///\r
   UINT32                    Signature;\r
-  EFI_FVB2_ATTRIBUTES        Attributes;\r
+  ///\r
+  /// Declares capabilities and power-on defaults for the firmware volume.\r
+  ///\r
+  EFI_FVB_ATTRIBUTES_2      Attributes;\r
+  ///\r
+  /// Length in bytes of the complete firmware volume header.\r
+  ///\r
   UINT16                    HeaderLength;\r
+  ///\r
+  /// A 16-bit checksum of the firmware volume header. A valid header sums to zero.\r
+  ///\r
   UINT16                    Checksum;\r
+  ///\r
+  /// Offset, relative to the start of the header, of the extended header\r
+  /// (EFI_FIRMWARE_VOLUME_EXT_HEADER) or zero if there is no extended header.\r
+  ///\r
   UINT16                    ExtHeaderOffset;\r
+  ///\r
+  /// This field must always be set to zero.\r
+  ///\r
   UINT8                     Reserved[1];\r
+  ///\r
+  /// Set to 2. Future versions of this specification may define new header fields and will\r
+  /// increment the Revision field accordingly.\r
+  ///\r
   UINT8                     Revision;\r
+  ///\r
+  /// An array of run-length encoded FvBlockMapEntry structures. The array is\r
+  /// terminated with an entry of {0,0}.\r
+  ///\r
   EFI_FV_BLOCK_MAP_ENTRY    BlockMap[1];\r
 } EFI_FIRMWARE_VOLUME_HEADER;\r
 \r
-#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')\r
+#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H')\r
 \r
 ///\r
 /// Firmware Volume Header Revision definition\r
 ///\r
 #define EFI_FVH_REVISION  0x02\r
 \r
-//\r
-// Extension header pointed by ExtHeaderOffset of volume header.\r
-// \r
+///\r
+/// Extension header pointed by ExtHeaderOffset of volume header.\r
+/// \r
 typedef struct {\r
+  ///\r
+  /// Firmware volume name.\r
+  ///\r
   EFI_GUID  FvName;\r
+  ///\r
+  /// Size of the rest of the extension header, including this structure.\r
+  ///\r
   UINT32    ExtHeaderSize;\r
 } EFI_FIRMWARE_VOLUME_EXT_HEADER;\r
 \r
+///\r
+/// Entry struture for describing FV extension header\r
+/// \r
 typedef struct {\r
+  ///\r
+  /// Size of this header extension.\r
+  ///\r
   UINT16    ExtEntrySize;\r
+  ///\r
+  /// Type of the header.\r
+  ///\r
   UINT16    ExtEntryType;\r
 } EFI_FIRMWARE_VOLUME_EXT_ENTRY;\r
 \r
 #define EFI_FV_EXT_TYPE_OEM_TYPE  0x01\r
+///\r
+/// This extension header provides a mapping between a GUID and an OEM file type.\r
+/// \r
 typedef struct {\r
+  ///\r
+  /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE.\r
+  ///\r
   EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;\r
+  ///\r
+  /// A bit mask, one bit for each file type between 0xC0 (bit 0) and 0xDF (bit 31). If a bit\r
+  /// is '1', then the GUID entry exists in Types. If a bit is '0' then no GUID entry exists in Types.\r
+  ///\r
   UINT32    TypeMask;\r
-\r
-  //\r
-  // Array of GUIDs. \r
-  // Each GUID represents an OEM file type.\r
-  // \r
-  EFI_GUID  Types[1];\r
+  ///\r
+  /// An array of GUIDs, each GUID representing an OEM file type.\r
+  /// \r
+  /// EFI_GUID  Types[1];\r
+  ///\r
 } EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;\r
 \r
+#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002\r
+\r
+///\r
+/// This extension header EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE provides a vendor specific\r
+/// GUID FormatType type which includes a length and a successive series of data bytes.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE.\r
+  ///\r
+  EFI_FIRMWARE_VOLUME_EXT_ENTRY     Hdr;\r
+  ///\r
+  /// Vendor-specific GUID.\r
+  ///\r
+  EFI_GUID                          FormatType;\r
+  ///\r
+  /// An arry of bytes of length Length.\r
+  ///\r
+  /// UINT8                             Data[1];\r
+  ///\r
+} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE;\r
 \r
 #endif\r