Deleted Added
full compact
efifs.h (96893) efifs.h (163898)
1/* $FreeBSD: head/sys/boot/efi/include/efifs.h 96893 2002-05-19 03:17:22Z marcel $ */
1/* $FreeBSD: head/sys/boot/efi/include/efifs.h 163898 2006-11-02 02:42:48Z marcel $ */
2#ifndef _EFI_FS_H
3#define _EFI_FS_H
4
5/*++
6
2#ifndef _EFI_FS_H
3#define _EFI_FS_H
4
5/*++
6
7Copyright (c) 1998 Intel Corporation
7Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
8This software and associated documentation (if any) is furnished
9under a license and may only be used or copied in accordance
10with the terms of the license. Except as permitted by such
11license, no part of this software or documentation may be
12reproduced, stored in a retrieval system, or transmitted in any
13form or by any means without the express written consent of
14Intel Corporation.
8
9Module Name:
10
11 efifs.h
12
13Abstract:
14
15 EFI File System structures
16
17
18
19Revision History
20
21--*/
22
23
15
16Module Name:
17
18 efifs.h
19
20Abstract:
21
22 EFI File System structures
23
24
25
26Revision History
27
28--*/
29
30
24/*
25 * EFI Partition header (normaly starts in LBA 1)
26 */
31//
32// EFI Partition header (normaly starts in LBA 1)
33//
27
28#define EFI_PARTITION_SIGNATURE 0x5053595320494249
29#define EFI_PARTITION_REVISION 0x00010001
30#define MIN_EFI_PARTITION_BLOCK_SIZE 512
31#define EFI_PARTITION_LBA 1
32
33typedef struct _EFI_PARTITION_HEADER {
34 EFI_TABLE_HEADER Hdr;
35 UINT32 DirectoryAllocationNumber;
36 UINT32 BlockSize;
37 EFI_LBA FirstUsableLba;
38 EFI_LBA LastUsableLba;
39 EFI_LBA UnusableSpace;
40 EFI_LBA FreeSpace;
41 EFI_LBA RootFile;
42 EFI_LBA SecutiryFile;
43} EFI_PARTITION_HEADER;
44
45
34
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
39
40typedef struct _EFI_PARTITION_HEADER {
41 EFI_TABLE_HEADER Hdr;
42 UINT32 DirectoryAllocationNumber;
43 UINT32 BlockSize;
44 EFI_LBA FirstUsableLba;
45 EFI_LBA LastUsableLba;
46 EFI_LBA UnusableSpace;
47 EFI_LBA FreeSpace;
48 EFI_LBA RootFile;
49 EFI_LBA SecutiryFile;
50} EFI_PARTITION_HEADER;
51
52
46/*
47 * File header
48 */
53//
54// File header
55//
49
50#define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249
51#define EFI_FILE_HEADER_REVISION 0x00010000
52#define EFI_FILE_STRING_SIZE 260
53
54typedef struct _EFI_FILE_HEADER {
55 EFI_TABLE_HEADER Hdr;
56 UINT32 Class;
57 UINT32 LBALOffset;
58 EFI_LBA Parent;
59 UINT64 FileSize;
60 UINT64 FileAttributes;
61 EFI_TIME FileCreateTime;
62 EFI_TIME FileModificationTime;
63 EFI_GUID VendorGuid;
64 CHAR16 FileString[EFI_FILE_STRING_SIZE];
65} EFI_FILE_HEADER;
66
67
56
57#define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249
58#define EFI_FILE_HEADER_REVISION 0x00010000
59#define EFI_FILE_STRING_SIZE 260
60
61typedef struct _EFI_FILE_HEADER {
62 EFI_TABLE_HEADER Hdr;
63 UINT32 Class;
64 UINT32 LBALOffset;
65 EFI_LBA Parent;
66 UINT64 FileSize;
67 UINT64 FileAttributes;
68 EFI_TIME FileCreateTime;
69 EFI_TIME FileModificationTime;
70 EFI_GUID VendorGuid;
71 CHAR16 FileString[EFI_FILE_STRING_SIZE];
72} EFI_FILE_HEADER;
73
74
68/*
69 * Return the file's first LBAL which is in the same
70 * logical block as the file header
71 */
75//
76// Return the file's first LBAL which is in the same
77// logical block as the file header
78//
72
73#define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset))
74
75#define EFI_FILE_CLASS_FREE_SPACE 1
76#define EFI_FILE_CLASS_EMPTY 2
77#define EFI_FILE_CLASS_NORMAL 3
78
79
79
80#define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset))
81
82#define EFI_FILE_CLASS_FREE_SPACE 1
83#define EFI_FILE_CLASS_EMPTY 2
84#define EFI_FILE_CLASS_NORMAL 3
85
86
80/*
81 * Logical Block Address List - the fundemental block
82 * description structure
83 */
87//
88// Logical Block Address List - the fundemental block
89// description structure
90//
84
85#define EFI_LBAL_SIGNATURE 0x4c41424c20494249
86#define EFI_LBAL_REVISION 0x00010000
87
88typedef struct _EFI_LBAL {
89 EFI_TABLE_HEADER Hdr;
90 UINT32 Class;
91 EFI_LBA Parent;
92 EFI_LBA Next;
93 UINT32 ArraySize;
94 UINT32 ArrayCount;
95} EFI_LBAL;
96
91
92#define EFI_LBAL_SIGNATURE 0x4c41424c20494249
93#define EFI_LBAL_REVISION 0x00010000
94
95typedef struct _EFI_LBAL {
96 EFI_TABLE_HEADER Hdr;
97 UINT32 Class;
98 EFI_LBA Parent;
99 EFI_LBA Next;
100 UINT32 ArraySize;
101 UINT32 ArrayCount;
102} EFI_LBAL;
103
97/* Array size */
104// Array size
98#define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
99 (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
100
105#define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
106 (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
107
101/*
102 * Logical Block run-length
103 */
108//
109// Logical Block run-length
110//
104
105typedef struct {
106 EFI_LBA Start;
107 UINT64 Length;
108} EFI_RL;
109
111
112typedef struct {
113 EFI_LBA Start;
114 UINT64 Length;
115} EFI_RL;
116
110/*
111 * Return the run-length structure from an LBAL header
112 */
117//
118// Return the run-length structure from an LBAL header
119//
113
114#define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize))
115
116#endif
120
121#define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize))
122
123#endif