2 EFI Guid Partition Table Format Definition.
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #define __UEFI_GPT_H__
13 /// The primary GUID Partition Table Header must be
14 /// located in LBA 1 (i.e., the second logical block).
16 #define PRIMARY_PART_HEADER_LBA 1
18 /// EFI Partition Table Signature: "EFI PART".
20 #define EFI_PTAB_HEADER_ID SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
22 /// Minimum bytes reserve for EFI entry array buffer.
24 #define EFI_GPT_PART_ENTRY_MIN_SIZE 16384
29 /// GPT Partition Table Header.
33 /// The table header for the GPT partition Table.
34 /// This header contains EFI_PTAB_HEADER_ID.
36 EFI_TABLE_HEADER Header
;
38 /// The LBA that contains this data structure.
42 /// LBA address of the alternate GUID Partition Table Header.
46 /// The first usable logical block that may be used
47 /// by a partition described by a GUID Partition Entry.
49 EFI_LBA FirstUsableLBA
;
51 /// The last usable logical block that may be used
52 /// by a partition described by a GUID Partition Entry.
54 EFI_LBA LastUsableLBA
;
56 /// GUID that can be used to uniquely identify the disk.
60 /// The starting LBA of the GUID Partition Entry array.
62 EFI_LBA PartitionEntryLBA
;
64 /// The number of Partition Entries in the GUID Partition Entry array.
66 UINT32 NumberOfPartitionEntries
;
68 /// The size, in bytes, of each the GUID Partition
69 /// Entry structures in the GUID Partition Entry
70 /// array. This field shall be set to a value of 128 x 2^n where n is
71 /// an integer greater than or equal to zero (e.g., 128, 256, 512, etc.).
73 UINT32 SizeOfPartitionEntry
;
75 /// The CRC32 of the GUID Partition Entry array.
76 /// Starts at PartitionEntryLBA and is
77 /// computed over a byte length of
78 /// NumberOfPartitionEntries * SizeOfPartitionEntry.
80 UINT32 PartitionEntryArrayCRC32
;
81 } EFI_PARTITION_TABLE_HEADER
;
84 /// GPT Partition Entry.
88 /// Unique ID that defines the purpose and type of this Partition. A value of
89 /// zero defines that this partition entry is not being used.
91 EFI_GUID PartitionTypeGUID
;
93 /// GUID that is unique for every partition entry. Every partition ever
94 /// created will have a unique GUID.
95 /// This GUID must be assigned when the GUID Partition Entry is created.
97 EFI_GUID UniquePartitionGUID
;
99 /// Starting LBA of the partition defined by this entry
103 /// Ending LBA of the partition defined by this entry.
107 /// Attribute bits, all bits reserved by UEFI
108 /// Bit 0: If this bit is set, the partition is required for the platform to function. The owner/creator of the
109 /// partition indicates that deletion or modification of the contents can result in loss of platform
110 /// features or failure for the platform to boot or operate. The system cannot function normally if
111 /// this partition is removed, and it should be considered part of the hardware of the system.
112 /// Actions such as running diagnostics, system recovery, or even OS install or boot, could
113 /// potentially stop working if this partition is removed. Unless OS software or firmware
114 /// recognizes this partition, it should never be removed or modified as the UEFI firmware or
115 /// platform hardware may become non-functional.
116 /// Bit 1: If this bit is set, then firmware must not produce an EFI_BLOCK_IO_PROTOCOL device for
117 /// this partition. By not producing an EFI_BLOCK_IO_PROTOCOL partition, file system
118 /// mappings will not be created for this partition in UEFI.
119 /// Bit 2: This bit is set aside to let systems with traditional PC-AT BIOS firmware implementations
120 /// inform certain limited, special-purpose software running on these systems that a GPT
121 /// partition may be bootable. The UEFI boot manager must ignore this bit when selecting
122 /// a UEFI-compliant application, e.g., an OS loader.
123 /// Bits 3-47: Undefined and must be zero. Reserved for expansion by future versions of the UEFI
125 /// Bits 48-63: Reserved for GUID specific use. The use of these bits will vary depending on the
126 /// PartitionTypeGUID. Only the owner of the PartitionTypeGUID is allowed
127 /// to modify these bits. They must be preserved if Bits 0-47 are modified..
131 /// Null-terminated name of the partition.
133 CHAR16 PartitionName
[36];
134 } EFI_PARTITION_ENTRY
;