Rev 2726 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2726 | Rev 3022 | ||
---|---|---|---|
1 | #ifndef _EFI_FS_H |
1 | #ifndef _EFI_FS_H |
2 | #define _EFI_FS_H |
2 | #define _EFI_FS_H |
3 | 3 | ||
4 | /*++ |
4 | /*++ |
5 | 5 | ||
6 | Copyright (c) 1998 Intel Corporation |
6 | Copyright (c) 1998 Intel Corporation |
7 | 7 | ||
8 | Module Name: |
8 | Module Name: |
9 | 9 | ||
10 | efifs.h |
10 | efifs.h |
11 | 11 | ||
12 | Abstract: |
12 | Abstract: |
13 | 13 | ||
14 | EFI File System structures |
14 | EFI File System structures |
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | Revision History |
18 | Revision History |
19 | 19 | ||
20 | --*/ |
20 | --*/ |
21 | 21 | ||
22 | 22 | ||
23 | // |
23 | // |
24 | // EFI Partition header (normaly starts in LBA 1) |
24 | // EFI Partition header (normaly starts in LBA 1) |
25 | // |
25 | // |
26 | 26 | ||
27 | #define EFI_PARTITION_SIGNATURE 0x5053595320494249 |
27 | #define EFI_PARTITION_SIGNATURE 0x5053595320494249 |
28 | #define EFI_PARTITION_REVISION 0x00010001 |
28 | #define EFI_PARTITION_REVISION 0x00010001 |
29 | #define MIN_EFI_PARTITION_BLOCK_SIZE 512 |
29 | #define MIN_EFI_PARTITION_BLOCK_SIZE 512 |
30 | #define EFI_PARTITION_LBA 1 |
30 | #define EFI_PARTITION_LBA 1 |
31 | 31 | ||
32 | typedef struct _EFI_PARTITION_HEADER { |
32 | typedef struct _EFI_PARTITION_HEADER { |
33 | EFI_TABLE_HEADER Hdr; |
33 | EFI_TABLE_HEADER Hdr; |
34 | UINT32 DirectoryAllocationNumber; |
34 | UINT32 DirectoryAllocationNumber; |
35 | UINT32 BlockSize; |
35 | UINT32 BlockSize; |
36 | EFI_LBA FirstUsableLba; |
36 | EFI_LBA FirstUsableLba; |
37 | EFI_LBA LastUsableLba; |
37 | EFI_LBA LastUsableLba; |
38 | EFI_LBA UnusableSpace; |
38 | EFI_LBA UnusableSpace; |
39 | EFI_LBA FreeSpace; |
39 | EFI_LBA FreeSpace; |
40 | EFI_LBA RootFile; |
40 | EFI_LBA RootFile; |
41 | EFI_LBA SecutiryFile; |
41 | EFI_LBA SecutiryFile; |
42 | } EFI_PARTITION_HEADER; |
42 | } EFI_PARTITION_HEADER; |
43 | 43 | ||
44 | 44 | ||
45 | // |
45 | // |
46 | // File header |
46 | // File header |
47 | // |
47 | // |
48 | 48 | ||
49 | #define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249 |
49 | #define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249 |
50 | #define EFI_FILE_HEADER_REVISION 0x00010000 |
50 | #define EFI_FILE_HEADER_REVISION 0x00010000 |
51 | #define EFI_FILE_STRING_SIZE 260 |
51 | #define EFI_FILE_STRING_SIZE 260 |
52 | 52 | ||
53 | typedef struct _EFI_FILE_HEADER { |
53 | typedef struct _EFI_FILE_HEADER { |
54 | EFI_TABLE_HEADER Hdr; |
54 | EFI_TABLE_HEADER Hdr; |
55 | UINT32 Class; |
55 | UINT32 Class; |
56 | UINT32 LBALOffset; |
56 | UINT32 LBALOffset; |
57 | EFI_LBA Parent; |
57 | EFI_LBA Parent; |
58 | UINT64 FileSize; |
58 | UINT64 FileSize; |
59 | UINT64 FileAttributes; |
59 | UINT64 FileAttributes; |
60 | EFI_TIME FileCreateTime; |
60 | EFI_TIME FileCreateTime; |
61 | EFI_TIME FileModificationTime; |
61 | EFI_TIME FileModificationTime; |
62 | EFI_GUID VendorGuid; |
62 | EFI_GUID VendorGuid; |
63 | CHAR16 FileString[EFI_FILE_STRING_SIZE]; |
63 | CHAR16 FileString[EFI_FILE_STRING_SIZE]; |
64 | } EFI_FILE_HEADER; |
64 | } EFI_FILE_HEADER; |
65 | 65 | ||
66 | 66 | ||
67 | // |
67 | // |
68 | // Return the file's first LBAL which is in the same |
68 | // Return the file's first LBAL which is in the same |
69 | // logical block as the file header |
69 | // logical block as the file header |
70 | // |
70 | // |
71 | 71 | ||
72 | #define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset)) |
72 | #define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset)) |
73 | 73 | ||
74 | #define EFI_FILE_CLASS_FREE_SPACE 1 |
74 | #define EFI_FILE_CLASS_FREE_SPACE 1 |
75 | #define EFI_FILE_CLASS_EMPTY 2 |
75 | #define EFI_FILE_CLASS_EMPTY 2 |
76 | #define EFI_FILE_CLASS_NORMAL 3 |
76 | #define EFI_FILE_CLASS_NORMAL 3 |
77 | 77 | ||
78 | 78 | ||
79 | // |
79 | // |
80 | // Logical Block Address List - the fundemental block |
80 | // Logical Block Address List - the fundemental block |
81 | // description structure |
81 | // description structure |
82 | // |
82 | // |
83 | 83 | ||
84 | #define EFI_LBAL_SIGNATURE 0x4c41424c20494249 |
84 | #define EFI_LBAL_SIGNATURE 0x4c41424c20494249 |
85 | #define EFI_LBAL_REVISION 0x00010000 |
85 | #define EFI_LBAL_REVISION 0x00010000 |
86 | 86 | ||
87 | typedef struct _EFI_LBAL { |
87 | typedef struct _EFI_LBAL { |
88 | EFI_TABLE_HEADER Hdr; |
88 | EFI_TABLE_HEADER Hdr; |
89 | UINT32 Class; |
89 | UINT32 Class; |
90 | EFI_LBA Parent; |
90 | EFI_LBA Parent; |
91 | EFI_LBA Next; |
91 | EFI_LBA Next; |
92 | UINT32 ArraySize; |
92 | UINT32 ArraySize; |
93 | UINT32 ArrayCount; |
93 | UINT32 ArrayCount; |
94 | } EFI_LBAL; |
94 | } EFI_LBAL; |
95 | 95 | ||
96 | // Array size |
96 | // Array size |
97 | #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \ |
97 | #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \ |
98 | (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL)) |
98 | (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL)) |
99 | 99 | ||
100 | // |
100 | // |
101 | // Logical Block run-length |
101 | // Logical Block run-length |
102 | // |
102 | // |
103 | 103 | ||
104 | typedef struct { |
104 | typedef struct { |
105 | EFI_LBA Start; |
105 | EFI_LBA Start; |
106 | UINT64 Length; |
106 | UINT64 Length; |
107 | } EFI_RL; |
107 | } EFI_RL; |
108 | 108 | ||
109 | // |
109 | // |
110 | // Return the run-length structure from an LBAL header |
110 | // Return the run-length structure from an LBAL header |
111 | // |
111 | // |
112 | 112 | ||
113 | #define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize)) |
113 | #define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize)) |
114 | 114 | ||
115 | #endif |
115 | #endif |
116 | 116 | ||
117 | 117 |