7 Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8 This software and associated documentation (if any) is furnished
9 under a license and may only be used or copied in accordance
10 with the terms of the license. Except as permitted by such
11 license, no part of this software or documentation may be
12 reproduced, stored in a retrieval system, or transmitted in any
13 form or by any means without the express written consent of
22 EFI File System structures
32 // EFI Partition header (normaly starts in LBA 1)
35 #define EFI_PARTITION_SIGNATURE 0x5053595320494249
36 #define EFI_PARTITION_REVISION 0x00010001
37 #define MIN_EFI_PARTITION_BLOCK_SIZE 512
38 #define EFI_PARTITION_LBA 1
40 typedef struct _EFI_PARTITION_HEADER {
42 UINT32 DirectoryAllocationNumber;
44 EFI_LBA FirstUsableLba;
45 EFI_LBA LastUsableLba;
46 EFI_LBA UnusableSpace;
50 } EFI_PARTITION_HEADER;
57 #define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249
58 #define EFI_FILE_HEADER_REVISION 0x00010000
59 #define EFI_FILE_STRING_SIZE 260
61 typedef struct _EFI_FILE_HEADER {
67 UINT64 FileAttributes;
68 EFI_TIME FileCreateTime;
69 EFI_TIME FileModificationTime;
71 CHAR16 FileString[EFI_FILE_STRING_SIZE];
76 // Return the file's first LBAL which is in the same
77 // logical block as the file header
80 #define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset))
82 #define EFI_FILE_CLASS_FREE_SPACE 1
83 #define EFI_FILE_CLASS_EMPTY 2
84 #define EFI_FILE_CLASS_NORMAL 3
88 // Logical Block Address List - the fundemental block
89 // description structure
92 #define EFI_LBAL_SIGNATURE 0x4c41424c20494249
93 #define EFI_LBAL_REVISION 0x00010000
95 typedef struct _EFI_LBAL {
105 #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
106 (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
109 // Logical Block run-length
118 // Return the run-length structure from an LBAL header
121 #define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize))