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