2 This file defines the data structures that comprise the FFS file system.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: FirmwareFileSystem.h
15 @par Revision Reference:
16 These definitions are from Firmware File System Spec 0.9.
20 #ifndef __EFI_FFS_FILE_SYSTEM_H__
21 #define __EFI_FFS_FILE_SYSTEM_H__
24 /// FFS specific file types
26 #define EFI_FV_FILETYPE_FFS_PAD 0xF0
29 // FFS File Attributes
31 #define FFS_ATTRIB_TAIL_PRESENT 0x01
32 #define FFS_ATTRIB_RECOVERY 0x02
33 #define FFS_ATTRIB_HEADER_EXTENSION 0x04
34 #define FFS_ATTRIB_DATA_ALIGNMENT 0x38
35 #define FFS_ATTRIB_CHECKSUM 0x40
38 /// FFS_FIXED_CHECKSUM is the default checksum value used when the
39 /// FFS_ATTRIB_CHECKSUM attribute bit is clear
40 /// note this is NOT an architecturally defined value, but is in this file for
41 /// implementation convenience
43 #define FFS_FIXED_CHECKSUM 0x5A
46 // File state definitions
48 #define EFI_FILE_HEADER_CONSTRUCTION 0x01
49 #define EFI_FILE_HEADER_VALID 0x02
50 #define EFI_FILE_DATA_VALID 0x04
51 #define EFI_FILE_MARKED_FOR_UPDATE 0x08
52 #define EFI_FILE_DELETED 0x10
53 #define EFI_FILE_HEADER_INVALID 0x20
55 #define EFI_FILE_ALL_STATE_BITS (EFI_FILE_HEADER_CONSTRUCTION | \
56 EFI_FILE_HEADER_VALID | \
57 EFI_FILE_DATA_VALID | \
58 EFI_FILE_MARKED_FOR_UPDATE | \
60 EFI_FILE_HEADER_INVALID \
63 #define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
66 (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
70 typedef UINT16 EFI_FFS_FILE_TAIL
;
73 /// FFS file integrity check structure
81 } EFI_FFS_INTEGRITY_CHECK
;
84 // FFS file header definition
86 typedef UINT8 EFI_FFS_FILE_ATTRIBUTES
;
87 typedef UINT8 EFI_FFS_FILE_STATE
;
91 EFI_FFS_INTEGRITY_CHECK IntegrityCheck
;
93 EFI_FFS_FILE_ATTRIBUTES Attributes
;
95 EFI_FFS_FILE_STATE State
;
96 } EFI_FFS_FILE_HEADER
;