]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | EfiFirmwareFileSystem.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | This file defines the data structures that comprise the FFS file system.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _EFI_FFS_FILE_SYSTEM_H_\r | |
23 | #define _EFI_FFS_FILE_SYSTEM_H_\r | |
24 | \r | |
25 | #include "EfiImageFormat.h"\r | |
26 | \r | |
27 | //\r | |
28 | // GUIDs defined by the FFS specification.\r | |
29 | //\r | |
30 | #define EFI_FIRMWARE_FILE_SYSTEM_GUID \\r | |
31 | { \\r | |
7ccf38a3 | 32 | 0x7A9354D9, 0x0468, 0x444a, {0x81, 0xCE, 0x0B, 0xF6, 0x17, 0xD8, 0x90, 0xDF} \\r |
3eb9473e | 33 | }\r |
34 | \r | |
35 | #define EFI_FFS_VOLUME_TOP_FILE_GUID \\r | |
36 | { \\r | |
7ccf38a3 | 37 | 0x1BA0062E, 0xC779, 0x4582, {0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9} \\r |
3eb9473e | 38 | }\r |
39 | \r | |
40 | //\r | |
41 | // FFS specific file types\r | |
42 | //\r | |
43 | #define EFI_FV_FILETYPE_FFS_PAD 0xF0\r | |
44 | \r | |
45 | //\r | |
46 | // FFS File Attributes\r | |
47 | //\r | |
48 | #define FFS_ATTRIB_TAIL_PRESENT 0x01\r | |
49 | #define FFS_ATTRIB_RECOVERY 0x02\r | |
50 | #define FFS_ATTRIB_DATA_ALIGNMENT 0x38\r | |
51 | #define FFS_ATTRIB_CHECKSUM 0x40\r | |
52 | #if (PI_SPECIFICATION_VERSION < 0x00010000)\r | |
53 | #define FFS_ATTRIB_HEADER_EXTENSION 0x04\r | |
54 | #else\r | |
55 | //\r | |
56 | // PI 1.0 definition.\r | |
57 | // \r | |
58 | #define FFS_ATTRIB_FIXED 0x04\r | |
59 | #endif\r | |
60 | \r | |
61 | \r | |
62 | //\r | |
63 | // FFS_FIXED_CHECKSUM is the default checksum value used when the\r | |
64 | // FFS_ATTRIB_CHECKSUM attribute bit is clear\r | |
65 | // note this is NOT an architecturally defined value, but is in this file for\r | |
66 | // implementation convenience\r | |
67 | //\r | |
68 | #define FFS_FIXED_CHECKSUM 0x5A\r | |
69 | \r | |
70 | \r | |
71 | //\r | |
72 | // File state definitions\r | |
73 | //\r | |
74 | #define EFI_FILE_HEADER_CONSTRUCTION 0x01\r | |
75 | #define EFI_FILE_HEADER_VALID 0x02\r | |
76 | #define EFI_FILE_DATA_VALID 0x04\r | |
77 | #define EFI_FILE_MARKED_FOR_UPDATE 0x08\r | |
78 | #define EFI_FILE_DELETED 0x10\r | |
79 | #define EFI_FILE_HEADER_INVALID 0x20\r | |
80 | \r | |
81 | #define EFI_FILE_ALL_STATE_BITS (EFI_FILE_HEADER_CONSTRUCTION | \\r | |
82 | EFI_FILE_HEADER_VALID | \\r | |
83 | EFI_FILE_DATA_VALID | \\r | |
84 | EFI_FILE_MARKED_FOR_UPDATE | \\r | |
85 | EFI_FILE_DELETED | \\r | |
86 | EFI_FILE_HEADER_INVALID \\r | |
87 | )\r | |
88 | \r | |
89 | #define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \\r | |
90 | ( \\r | |
91 | (BOOLEAN) ( \\r | |
92 | (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \\r | |
93 | ) \\r | |
94 | )\r | |
95 | \r | |
96 | //\r | |
97 | // FFS file integrity check structure\r | |
98 | //\r | |
99 | typedef UINT16 EFI_FFS_FILE_TAIL;\r | |
100 | \r | |
101 | typedef union {\r | |
102 | struct {\r | |
103 | UINT8 Header;\r | |
104 | UINT8 File;\r | |
105 | } Checksum;\r | |
106 | #if (PI_SPECIFICATION_VERSION < 0x00010000) \r | |
107 | UINT16 TailReference;\r | |
108 | #else\r | |
109 | UINT16 Checksum16;\r | |
110 | #endif\r | |
111 | } EFI_FFS_INTEGRITY_CHECK;\r | |
112 | \r | |
113 | //\r | |
114 | // FFS file header definition\r | |
115 | //\r | |
116 | typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r | |
117 | typedef UINT8 EFI_FFS_FILE_STATE;\r | |
118 | \r | |
119 | typedef struct {\r | |
120 | EFI_GUID Name;\r | |
121 | EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r | |
122 | EFI_FV_FILETYPE Type;\r | |
123 | EFI_FFS_FILE_ATTRIBUTES Attributes;\r | |
124 | UINT8 Size[3];\r | |
125 | EFI_FFS_FILE_STATE State;\r | |
126 | } EFI_FFS_FILE_HEADER;\r | |
127 | \r | |
128 | #endif\r |