3 Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 EfiFirmwareFileSystem.h
18 This file defines the data structures that comprise the FFS file system.
22 #ifndef _EFI_FFS_FILE_SYSTEM_H_
23 #define _EFI_FFS_FILE_SYSTEM_H_
25 #include "EfiImageFormat.h"
28 // GUIDs defined by the FFS specification.
30 #define EFI_FIRMWARE_FILE_SYSTEM_GUID \
32 0x7A9354D9, 0x0468, 0x444a, {0x81, 0xCE, 0x0B, 0xF6, 0x17, 0xD8, 0x90, 0xDF} \
35 #define EFI_FFS_VOLUME_TOP_FILE_GUID \
37 0x1BA0062E, 0xC779, 0x4582, {0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9} \
41 // FFS specific file types
43 #define EFI_FV_FILETYPE_FFS_PAD 0xF0
46 // FFS File Attributes
48 #define FFS_ATTRIB_TAIL_PRESENT 0x01
49 #define FFS_ATTRIB_RECOVERY 0x02
50 #define FFS_ATTRIB_DATA_ALIGNMENT 0x38
51 #define FFS_ATTRIB_CHECKSUM 0x40
52 #if (PI_SPECIFICATION_VERSION < 0x00010000)
53 #define FFS_ATTRIB_HEADER_EXTENSION 0x04
58 #define FFS_ATTRIB_FIXED 0x04
63 // FFS_FIXED_CHECKSUM is the default checksum value used when the
64 // FFS_ATTRIB_CHECKSUM attribute bit is clear
65 // note this is NOT an architecturally defined value, but is in this file for
66 // implementation convenience
68 #define FFS_FIXED_CHECKSUM 0x5A
72 // File state definitions
74 #define EFI_FILE_HEADER_CONSTRUCTION 0x01
75 #define EFI_FILE_HEADER_VALID 0x02
76 #define EFI_FILE_DATA_VALID 0x04
77 #define EFI_FILE_MARKED_FOR_UPDATE 0x08
78 #define EFI_FILE_DELETED 0x10
79 #define EFI_FILE_HEADER_INVALID 0x20
81 #define EFI_FILE_ALL_STATE_BITS (EFI_FILE_HEADER_CONSTRUCTION | \
82 EFI_FILE_HEADER_VALID | \
83 EFI_FILE_DATA_VALID | \
84 EFI_FILE_MARKED_FOR_UPDATE | \
86 EFI_FILE_HEADER_INVALID \
89 #define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
92 (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
97 // FFS file integrity check structure
99 typedef UINT16 EFI_FFS_FILE_TAIL
;
106 #if (PI_SPECIFICATION_VERSION < 0x00010000)
107 UINT16 TailReference
;
111 } EFI_FFS_INTEGRITY_CHECK
;
114 // FFS file header definition
116 typedef UINT8 EFI_FFS_FILE_ATTRIBUTES
;
117 typedef UINT8 EFI_FFS_FILE_STATE
;
121 EFI_FFS_INTEGRITY_CHECK IntegrityCheck
;
122 EFI_FV_FILETYPE Type
;
123 EFI_FFS_FILE_ATTRIBUTES Attributes
;
125 EFI_FFS_FILE_STATE State
;
126 } EFI_FFS_FILE_HEADER
;