linprocfs - Introduce /proc/mounts
[dragonfly.git] / sys / boot / efi / include / efifs.h
blob8fede0b0de1970e3296629c932b83a81273b5959
1 /*
2 * $FreeBSD: src/sys/boot/efi/include/efifs.h,v 1.2 2002/05/19 03:17:20 marcel Exp $
3 * $DragonFly: src/sys/boot/efi/include/efifs.h,v 1.1 2003/11/10 06:08:32 dillon Exp $
4 */
5 #ifndef _EFI_FS_H
6 #define _EFI_FS_H
8 /*++
10 Copyright (c) 1998 Intel Corporation
12 Module Name:
14 efifs.h
16 Abstract:
18 EFI File System structures
22 Revision History
24 --*/
28 * EFI Partition header (normaly starts in LBA 1)
31 #define EFI_PARTITION_SIGNATURE 0x5053595320494249
32 #define EFI_PARTITION_REVISION 0x00010001
33 #define MIN_EFI_PARTITION_BLOCK_SIZE 512
34 #define EFI_PARTITION_LBA 1
36 typedef struct _EFI_PARTITION_HEADER {
37 EFI_TABLE_HEADER Hdr;
38 UINT32 DirectoryAllocationNumber;
39 UINT32 BlockSize;
40 EFI_LBA FirstUsableLba;
41 EFI_LBA LastUsableLba;
42 EFI_LBA UnusableSpace;
43 EFI_LBA FreeSpace;
44 EFI_LBA RootFile;
45 EFI_LBA SecutiryFile;
46 } EFI_PARTITION_HEADER;
50 * File header
53 #define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249
54 #define EFI_FILE_HEADER_REVISION 0x00010000
55 #define EFI_FILE_STRING_SIZE 260
57 typedef struct _EFI_FILE_HEADER {
58 EFI_TABLE_HEADER Hdr;
59 UINT32 Class;
60 UINT32 LBALOffset;
61 EFI_LBA Parent;
62 UINT64 FileSize;
63 UINT64 FileAttributes;
64 EFI_TIME FileCreateTime;
65 EFI_TIME FileModificationTime;
66 EFI_GUID VendorGuid;
67 CHAR16 FileString[EFI_FILE_STRING_SIZE];
68 } EFI_FILE_HEADER;
72 * Return the file's first LBAL which is in the same
73 * logical block as the file header
76 #define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset))
78 #define EFI_FILE_CLASS_FREE_SPACE 1
79 #define EFI_FILE_CLASS_EMPTY 2
80 #define EFI_FILE_CLASS_NORMAL 3
84 * Logical Block Address List - the fundemental block
85 * description structure
88 #define EFI_LBAL_SIGNATURE 0x4c41424c20494249
89 #define EFI_LBAL_REVISION 0x00010000
91 typedef struct _EFI_LBAL {
92 EFI_TABLE_HEADER Hdr;
93 UINT32 Class;
94 EFI_LBA Parent;
95 EFI_LBA Next;
96 UINT32 ArraySize;
97 UINT32 ArrayCount;
98 } EFI_LBAL;
100 /* Array size */
101 #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
102 (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
105 * Logical Block run-length
108 typedef struct {
109 EFI_LBA Start;
110 UINT64 Length;
111 } EFI_RL;
114 * Return the run-length structure from an LBAL header
117 #define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize))
119 #endif