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