EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

EdkCompatibilityPkg/Foundation/Framework/Include/EfiImageFormat.h

Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
00004 This program and the accompanying materials                          
00005 are licensed and made available under the terms and conditions of the BSD License         
00006 which accompanies this distribution.  The full text of the license may be found at        
00007 http://opensource.org/licenses/bsd-license.php                                            
00008                                                                                           
00009 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
00010 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
00011 
00012 Module Name:
00013 
00014   EfiImageFormat.h
00015 
00016 Abstract:
00017 
00018   This file defines the data structures that are architecturally defined for file
00019   images loaded via the FirmwareVolume protocol.  The Firmware Volume specification
00020   is the basis for these definitions.
00021 
00022 --*/
00023 
00024 #ifndef _EFI_IMAGE_FORMAT_H_
00025 #define _EFI_IMAGE_FORMAT_H_
00026 
00027 //
00028 // pack all data structures since this is actually a binary format and we cannot
00029 // allow internal padding in the data structures because of some compilerism..
00030 //
00031 #pragma pack(1)
00032 //
00033 // ////////////////////////////////////////////////////////////////////////////
00034 //
00035 // Architectural file types
00036 //
00037 typedef UINT8 EFI_FV_FILETYPE;
00038 
00039 #define EFI_FV_FILETYPE_ALL                   0x00
00040 #define EFI_FV_FILETYPE_RAW                   0x01
00041 #define EFI_FV_FILETYPE_FREEFORM              0x02
00042 #define EFI_FV_FILETYPE_SECURITY_CORE         0x03
00043 #define EFI_FV_FILETYPE_PEI_CORE              0x04
00044 #define EFI_FV_FILETYPE_DXE_CORE              0x05
00045 #define EFI_FV_FILETYPE_PEIM                  0x06
00046 #define EFI_FV_FILETYPE_DRIVER                0x07
00047 #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER  0x08
00048 #define EFI_FV_FILETYPE_APPLICATION           0x09
00049 //
00050 // File type 0x0A is reserved and should not be used
00051 //
00052 #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
00053 
00054 //
00055 // ////////////////////////////////////////////////////////////////////////////
00056 //
00057 // Section types
00058 //
00059 typedef UINT8 EFI_SECTION_TYPE;
00060 
00061 //
00062 // ************************************************************
00063 // The section type EFI_SECTION_ALL is a psuedo type.  It is
00064 // used as a wildcard when retrieving sections.  The section
00065 // type EFI_SECTION_ALL matches all section types.
00066 // ************************************************************
00067 //
00068 #define EFI_SECTION_ALL 0x00
00069 
00070 //
00071 // ************************************************************
00072 // Encapsulation section Type values
00073 // ************************************************************
00074 //
00075 #define EFI_SECTION_COMPRESSION   0x01
00076 #define EFI_SECTION_GUID_DEFINED  0x02
00077 
00078 //
00079 // ************************************************************
00080 // Leaf section Type values
00081 // ************************************************************
00082 //
00083 #define EFI_SECTION_FIRST_LEAF_SECTION_TYPE 0x10
00084 
00085 #define EFI_SECTION_PE32                    0x10
00086 #define EFI_SECTION_PIC                     0x11
00087 #define EFI_SECTION_TE                      0x12
00088 #define EFI_SECTION_DXE_DEPEX               0x13
00089 #define EFI_SECTION_VERSION                 0x14
00090 #define EFI_SECTION_USER_INTERFACE          0x15
00091 #define EFI_SECTION_COMPATIBILITY16         0x16
00092 #define EFI_SECTION_FIRMWARE_VOLUME_IMAGE   0x17
00093 #define EFI_SECTION_FREEFORM_SUBTYPE_GUID   0x18
00094 #define EFI_SECTION_RAW                     0x19
00095 #define EFI_SECTION_PEI_DEPEX               0x1B
00096 
00097 #define EFI_SECTION_LAST_LEAF_SECTION_TYPE  0x1B
00098 #define EFI_SECTION_LAST_SECTION_TYPE       0x1B
00099 
00100 //
00101 // ////////////////////////////////////////////////////////////////////////////
00102 //
00103 // Common section header
00104 //
00105 typedef struct {
00106   UINT8 Size[3];
00107   UINT8 Type;
00108 } EFI_COMMON_SECTION_HEADER;
00109 
00110 #define SECTION_SIZE(SectionHeaderPtr) \
00111     ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
00112 
00113 //
00114 // ////////////////////////////////////////////////////////////////////////////
00115 //
00116 // Compression section
00117 //
00118 //
00119 // CompressionType values
00120 //
00121 #define EFI_NOT_COMPRESSED          0x00
00122 #define EFI_STANDARD_COMPRESSION    0x01
00123 #define EFI_CUSTOMIZED_COMPRESSION  0x02
00124 
00125 typedef struct {
00126   EFI_COMMON_SECTION_HEADER CommonHeader;
00127   UINT32                    UncompressedLength;
00128   UINT8                     CompressionType;
00129 } EFI_COMPRESSION_SECTION;
00130 
00131 //
00132 // ////////////////////////////////////////////////////////////////////////////
00133 //
00134 // GUID defined section
00135 //
00136 typedef struct {
00137   EFI_COMMON_SECTION_HEADER CommonHeader;
00138   EFI_GUID                  SectionDefinitionGuid;
00139   UINT16                    DataOffset;
00140   UINT16                    Attributes;
00141 } EFI_GUID_DEFINED_SECTION;
00142 
00143 //
00144 // Bit values for Attributes
00145 //
00146 #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED  0x01
00147 #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID    0x02
00148 
00149 //
00150 // Bit values for AuthenticationStatus
00151 //
00152 #define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001
00153 #define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED      0x000002
00154 #define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED        0x000004
00155 #define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED       0x000008
00156 #define EFI_AGGREGATE_AUTH_STATUS_ALL               0x00000f
00157 
00158 #define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE     0x010000
00159 #define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED          0x020000
00160 #define EFI_LOCAL_AUTH_STATUS_NOT_TESTED            0x040000
00161 #define EFI_LOCAL_AUTH_STATUS_TEST_FAILED           0x080000
00162 #define EFI_LOCAL_AUTH_STATUS_ALL                   0x0f0000
00163 
00164 //
00165 // ////////////////////////////////////////////////////////////////////////////
00166 //
00167 // PE32+ section
00168 //
00169 typedef struct {
00170   EFI_COMMON_SECTION_HEADER CommonHeader;
00171 } EFI_PE32_SECTION;
00172 
00173 //
00174 // ////////////////////////////////////////////////////////////////////////////
00175 //
00176 // PIC section
00177 //
00178 typedef struct {
00179   EFI_COMMON_SECTION_HEADER CommonHeader;
00180 } EFI_PIC_SECTION;
00181 
00182 //
00183 // ////////////////////////////////////////////////////////////////////////////
00184 //
00185 // PEIM header section
00186 //
00187 typedef struct {
00188   EFI_COMMON_SECTION_HEADER CommonHeader;
00189 } EFI_PEIM_HEADER_SECTION;
00190 
00191 //
00192 // ////////////////////////////////////////////////////////////////////////////
00193 //
00194 // DEPEX section
00195 //
00196 typedef struct {
00197   EFI_COMMON_SECTION_HEADER CommonHeader;
00198 } EFI_DEPEX_SECTION;
00199 
00200 //
00201 // ////////////////////////////////////////////////////////////////////////////
00202 //
00203 // Version section
00204 //
00205 typedef struct {
00206   EFI_COMMON_SECTION_HEADER CommonHeader;
00207   UINT16                    BuildNumber;
00208   INT16                     VersionString[1];
00209 } EFI_VERSION_SECTION;
00210 
00211 //
00212 // ////////////////////////////////////////////////////////////////////////////
00213 //
00214 // User interface section
00215 //
00216 typedef struct {
00217   EFI_COMMON_SECTION_HEADER CommonHeader;
00218   INT16                     FileNameString[1];
00219 } EFI_USER_INTERFACE_SECTION;
00220 
00221 //
00222 // ////////////////////////////////////////////////////////////////////////////
00223 //
00224 // Code16 section
00225 //
00226 typedef struct {
00227   EFI_COMMON_SECTION_HEADER CommonHeader;
00228 } EFI_CODE16_SECTION;
00229 
00230 //
00231 // ////////////////////////////////////////////////////////////////////////////
00232 //
00233 // Firmware Volume Image section
00234 //
00235 typedef struct {
00236   EFI_COMMON_SECTION_HEADER CommonHeader;
00237 } EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
00238 
00239 //
00240 // ////////////////////////////////////////////////////////////////////////////
00241 //
00242 // Freeform subtype GUID section
00243 //
00244 typedef struct {
00245   EFI_COMMON_SECTION_HEADER CommonHeader;
00246   EFI_GUID                  SubTypeGuid;
00247 } EFI_FREEFORM_SUBTYPE_GUID_SECTION;
00248 
00249 //
00250 // ////////////////////////////////////////////////////////////////////////////
00251 //
00252 // Raw section
00253 //
00254 typedef struct {
00255   EFI_COMMON_SECTION_HEADER CommonHeader;
00256 } EFI_RAW_SECTION;
00257 
00258 //
00259 // undo the pragma from the beginning...
00260 //
00261 #pragma pack()
00262 
00263 typedef union {
00264   EFI_COMMON_SECTION_HEADER         *CommonHeader;
00265   EFI_COMPRESSION_SECTION           *CompressionSection;
00266   EFI_GUID_DEFINED_SECTION          *GuidDefinedSection;
00267   EFI_PE32_SECTION                  *Pe32Section;
00268   EFI_PIC_SECTION                   *PicSection;
00269   EFI_PEIM_HEADER_SECTION           *PeimHeaderSection;
00270   EFI_DEPEX_SECTION                 *DependencySection;
00271   EFI_VERSION_SECTION               *VersionSection;
00272   EFI_USER_INTERFACE_SECTION        *UISection;
00273   EFI_CODE16_SECTION                *Code16Section;
00274   EFI_FIRMWARE_VOLUME_IMAGE_SECTION *FVImageSection;
00275   EFI_FREEFORM_SUBTYPE_GUID_SECTION *FreeformSubtypeSection;
00276   EFI_RAW_SECTION                   *RawSection;
00277 } EFI_FILE_SECTION_POINTER;
00278 
00279 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines