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