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