Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / ia64 / stand / efi / include / efifs.h
blobb16b546e3deea298de9a4cbc49388e2683ecbb4e
1 /* $NetBSD: efifs.h,v 1.1 2006/04/07 14:21:29 cherry Exp $ */
2 /* $FreeBSD: src/sys/boot/efi/include/efifs.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
4 #ifndef _EFI_FS_H
5 #define _EFI_FS_H
7 /*++
9 Copyright (c) 1998 Intel Corporation
11 Module Name:
13 efifs.h
15 Abstract:
17 EFI File System structures
21 Revision History
23 --*/
27 * EFI Partition header (normaly starts in LBA 1)
30 #define EFI_PARTITION_SIGNATURE 0x5053595320494249
31 #define EFI_PARTITION_REVISION 0x00010001
32 #define MIN_EFI_PARTITION_BLOCK_SIZE 512
33 #define EFI_PARTITION_LBA 1
35 typedef struct _EFI_PARTITION_HEADER {
36 EFI_TABLE_HEADER Hdr;
37 UINT32 DirectoryAllocationNumber;
38 UINT32 BlockSize;
39 EFI_LBA FirstUsableLba;
40 EFI_LBA LastUsableLba;
41 EFI_LBA UnusableSpace;
42 EFI_LBA FreeSpace;
43 EFI_LBA RootFile;
44 EFI_LBA SecutiryFile;
45 } EFI_PARTITION_HEADER;
49 * File header
52 #define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249
53 #define EFI_FILE_HEADER_REVISION 0x00010000
54 #define EFI_FILE_STRING_SIZE 260
56 typedef struct _EFI_FILE_HEADER {
57 EFI_TABLE_HEADER Hdr;
58 UINT32 Class;
59 UINT32 LBALOffset;
60 EFI_LBA Parent;
61 UINT64 FileSize;
62 UINT64 FileAttributes;
63 EFI_TIME FileCreateTime;
64 EFI_TIME FileModificationTime;
65 EFI_GUID VendorGuid;
66 CHAR16 FileString[EFI_FILE_STRING_SIZE];
67 } EFI_FILE_HEADER;
71 * Return the file's first LBAL which is in the same
72 * logical block as the file header
75 #define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset))
77 #define EFI_FILE_CLASS_FREE_SPACE 1
78 #define EFI_FILE_CLASS_EMPTY 2
79 #define EFI_FILE_CLASS_NORMAL 3
83 * Logical Block Address List - the fundemental block
84 * description structure
87 #define EFI_LBAL_SIGNATURE 0x4c41424c20494249
88 #define EFI_LBAL_REVISION 0x00010000
90 typedef struct _EFI_LBAL {
91 EFI_TABLE_HEADER Hdr;
92 UINT32 Class;
93 EFI_LBA Parent;
94 EFI_LBA Next;
95 UINT32 ArraySize;
96 UINT32 ArrayCount;
97 } EFI_LBAL;
99 /* Array size */
100 #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
101 (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
104 * Logical Block run-length
107 typedef struct {
108 EFI_LBA Start;
109 UINT64 Length;
110 } EFI_RL;
113 * Return the run-length structure from an LBAL header
116 #define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize))
118 #endif