iPXE
UefiGpt.h
Go to the documentation of this file.
1/** @file
2 EFI Guid Partition Table Format Definition.
3
4Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __UEFI_GPT_H__
10#define __UEFI_GPT_H__
11
12FILE_LICENCE ( BSD2_PATENT );
13FILE_SECBOOT ( PERMITTED );
14
15///
16/// The primary GUID Partition Table Header must be
17/// located in LBA 1 (i.e., the second logical block).
18///
19#define PRIMARY_PART_HEADER_LBA 1
20///
21/// EFI Partition Table Signature: "EFI PART".
22///
23#define EFI_PTAB_HEADER_ID SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
24///
25/// Minimum bytes reserve for EFI entry array buffer.
26///
27#define EFI_GPT_PART_ENTRY_MIN_SIZE 16384
28
29#pragma pack(1)
30
31///
32/// GPT Partition Table Header.
33///
34typedef struct {
35 ///
36 /// The table header for the GPT partition Table.
37 /// This header contains EFI_PTAB_HEADER_ID.
38 ///
40 ///
41 /// The LBA that contains this data structure.
42 ///
44 ///
45 /// LBA address of the alternate GUID Partition Table Header.
46 ///
48 ///
49 /// The first usable logical block that may be used
50 /// by a partition described by a GUID Partition Entry.
51 ///
53 ///
54 /// The last usable logical block that may be used
55 /// by a partition described by a GUID Partition Entry.
56 ///
58 ///
59 /// GUID that can be used to uniquely identify the disk.
60 ///
62 ///
63 /// The starting LBA of the GUID Partition Entry array.
64 ///
66 ///
67 /// The number of Partition Entries in the GUID Partition Entry array.
68 ///
70 ///
71 /// The size, in bytes, of each the GUID Partition
72 /// Entry structures in the GUID Partition Entry
73 /// array. This field shall be set to a value of 128 x 2^n where n is
74 /// an integer greater than or equal to zero (e.g., 128, 256, 512, etc.).
75 ///
77 ///
78 /// The CRC32 of the GUID Partition Entry array.
79 /// Starts at PartitionEntryLBA and is
80 /// computed over a byte length of
81 /// NumberOfPartitionEntries * SizeOfPartitionEntry.
82 ///
85
86///
87/// GPT Partition Entry.
88///
89typedef struct {
90 ///
91 /// Unique ID that defines the purpose and type of this Partition. A value of
92 /// zero defines that this partition entry is not being used.
93 ///
95 ///
96 /// GUID that is unique for every partition entry. Every partition ever
97 /// created will have a unique GUID.
98 /// This GUID must be assigned when the GUID Partition Entry is created.
99 ///
101 ///
102 /// Starting LBA of the partition defined by this entry
103 ///
105 ///
106 /// Ending LBA of the partition defined by this entry.
107 ///
109 ///
110 /// Attribute bits, all bits reserved by UEFI
111 /// Bit 0: If this bit is set, the partition is required for the platform to function. The owner/creator of the
112 /// partition indicates that deletion or modification of the contents can result in loss of platform
113 /// features or failure for the platform to boot or operate. The system cannot function normally if
114 /// this partition is removed, and it should be considered part of the hardware of the system.
115 /// Actions such as running diagnostics, system recovery, or even OS install or boot, could
116 /// potentially stop working if this partition is removed. Unless OS software or firmware
117 /// recognizes this partition, it should never be removed or modified as the UEFI firmware or
118 /// platform hardware may become non-functional.
119 /// Bit 1: If this bit is set, then firmware must not produce an EFI_BLOCK_IO_PROTOCOL device for
120 /// this partition. By not producing an EFI_BLOCK_IO_PROTOCOL partition, file system
121 /// mappings will not be created for this partition in UEFI.
122 /// Bit 2: This bit is set aside to let systems with traditional PC-AT BIOS firmware implementations
123 /// inform certain limited, special-purpose software running on these systems that a GPT
124 /// partition may be bootable. The UEFI boot manager must ignore this bit when selecting
125 /// a UEFI-compliant application, e.g., an OS loader.
126 /// Bits 3-47: Undefined and must be zero. Reserved for expansion by future versions of the UEFI
127 /// specification.
128 /// Bits 48-63: Reserved for GUID specific use. The use of these bits will vary depending on the
129 /// PartitionTypeGUID. Only the owner of the PartitionTypeGUID is allowed
130 /// to modify these bits. They must be preserved if Bits 0-47 are modified..
131 ///
133 ///
134 /// Null-terminated name of the partition.
135 ///
138
139#pragma pack()
140#endif
unsigned long long UINT64
8-byte unsigned value.
unsigned short CHAR16
2-byte Character.
unsigned int UINT32
4-byte unsigned value.
UINT64 EFI_LBA
Logical block address.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
GPT Partition Entry.
Definition UefiGpt.h:89
CHAR16 PartitionName[36]
Null-terminated name of the partition.
Definition UefiGpt.h:136
EFI_GUID PartitionTypeGUID
Unique ID that defines the purpose and type of this Partition.
Definition UefiGpt.h:94
UINT64 Attributes
Attribute bits, all bits reserved by UEFI Bit 0: If this bit is set, the partition is required for th...
Definition UefiGpt.h:132
EFI_LBA StartingLBA
Starting LBA of the partition defined by this entry.
Definition UefiGpt.h:104
EFI_LBA EndingLBA
Ending LBA of the partition defined by this entry.
Definition UefiGpt.h:108
EFI_GUID UniquePartitionGUID
GUID that is unique for every partition entry.
Definition UefiGpt.h:100
GPT Partition Table Header.
Definition UefiGpt.h:34
EFI_LBA FirstUsableLBA
The first usable logical block that may be used by a partition described by a GUID Partition Entry.
Definition UefiGpt.h:52
EFI_TABLE_HEADER Header
The table header for the GPT partition Table.
Definition UefiGpt.h:39
EFI_GUID DiskGUID
GUID that can be used to uniquely identify the disk.
Definition UefiGpt.h:61
UINT32 SizeOfPartitionEntry
The size, in bytes, of each the GUID Partition Entry structures in the GUID Partition Entry array.
Definition UefiGpt.h:76
EFI_LBA PartitionEntryLBA
The starting LBA of the GUID Partition Entry array.
Definition UefiGpt.h:65
EFI_LBA AlternateLBA
LBA address of the alternate GUID Partition Table Header.
Definition UefiGpt.h:47
UINT32 PartitionEntryArrayCRC32
The CRC32 of the GUID Partition Entry array.
Definition UefiGpt.h:83
EFI_LBA MyLBA
The LBA that contains this data structure.
Definition UefiGpt.h:43
EFI_LBA LastUsableLBA
The last usable logical block that may be used by a partition described by a GUID Partition Entry.
Definition UefiGpt.h:57
UINT32 NumberOfPartitionEntries
The number of Partition Entries in the GUID Partition Entry array.
Definition UefiGpt.h:69
Data structure that precedes all of the standard EFI table types.