]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Framework/Include/EfiFirmwareFileSystem.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Include / EfiFirmwareFileSystem.h
1 /*++
2
3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. 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
8
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.
11
12 Module Name:
13
14 EfiFirmwareFileSystem.h
15
16 Abstract:
17
18 This file defines the data structures that comprise the FFS file system.
19
20 --*/
21
22 #ifndef _EFI_FFS_FILE_SYSTEM_H_
23 #define _EFI_FFS_FILE_SYSTEM_H_
24
25 #include "EfiImageFormat.h"
26
27 //
28 // GUIDs defined by the FFS specification.
29 //
30 #define EFI_FIRMWARE_FILE_SYSTEM_GUID \
31 { \
32 0x7A9354D9, 0x0468, 0x444a, 0x81, 0xCE, 0x0B, 0xF6, 0x17, 0xD8, 0x90, 0xDF \
33 }
34
35 #define EFI_FFS_VOLUME_TOP_FILE_GUID \
36 { \
37 0x1BA0062E, 0xC779, 0x4582, 0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9 \
38 }
39
40 //
41 // FFS specific file types
42 //
43 #define EFI_FV_FILETYPE_FFS_PAD 0xF0
44
45 //
46 // FFS File Attributes
47 //
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
54 #else
55 //
56 // PI 1.0 definition.
57 //
58 #define FFS_ATTRIB_FIXED 0x04
59 #endif
60
61
62 //
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
67 //
68 #define FFS_FIXED_CHECKSUM 0x5A
69
70
71 //
72 // File state definitions
73 //
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
80
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 | \
85 EFI_FILE_DELETED | \
86 EFI_FILE_HEADER_INVALID \
87 )
88
89 #define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
90 ( \
91 (BOOLEAN) ( \
92 (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
93 ) \
94 )
95
96 //
97 // FFS file integrity check structure
98 //
99 typedef UINT16 EFI_FFS_FILE_TAIL;
100
101 typedef union {
102 struct {
103 UINT8 Header;
104 UINT8 File;
105 } Checksum;
106 #if (PI_SPECIFICATION_VERSION < 0x00010000)
107 UINT16 TailReference;
108 #else
109 UINT16 Checksum16;
110 #endif
111 } EFI_FFS_INTEGRITY_CHECK;
112
113 //
114 // FFS file header definition
115 //
116 typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
117 typedef UINT8 EFI_FFS_FILE_STATE;
118
119 typedef struct {
120 EFI_GUID Name;
121 EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
122 EFI_FV_FILETYPE Type;
123 EFI_FFS_FILE_ATTRIBUTES Attributes;
124 UINT8 Size[3];
125 EFI_FFS_FILE_STATE State;
126 } EFI_FFS_FILE_HEADER;
127
128 #endif