]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | EFI Guid Partition Table Format Definition.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | **/\r | |
8 | \r | |
9 | #ifndef __UEFI_GPT_H__\r | |
10 | #define __UEFI_GPT_H__\r | |
11 | \r | |
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 | |
16 | #define PRIMARY_PART_HEADER_LBA 1\r | |
17 | ///\r | |
18 | /// EFI Partition Table Signature: "EFI PART".\r | |
19 | ///\r | |
20 | #define EFI_PTAB_HEADER_ID SIGNATURE_64 ('E','F','I',' ','P','A','R','T')\r | |
21 | ///\r | |
22 | /// Minimum bytes reserve for EFI entry array buffer.\r | |
23 | ///\r | |
24 | #define EFI_GPT_PART_ENTRY_MIN_SIZE 16384\r | |
25 | \r | |
26 | #pragma pack(1)\r | |
27 | \r | |
28 | ///\r | |
29 | /// GPT Partition Table Header.\r | |
30 | ///\r | |
31 | typedef struct {\r | |
32 | ///\r | |
33 | /// The table header for the GPT partition Table.\r | |
34 | /// This header contains EFI_PTAB_HEADER_ID.\r | |
35 | ///\r | |
36 | EFI_TABLE_HEADER Header;\r | |
37 | ///\r | |
38 | /// The LBA that contains this data structure.\r | |
39 | ///\r | |
40 | EFI_LBA MyLBA;\r | |
41 | ///\r | |
42 | /// LBA address of the alternate GUID Partition Table Header.\r | |
43 | ///\r | |
44 | EFI_LBA AlternateLBA;\r | |
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 | |
49 | EFI_LBA FirstUsableLBA;\r | |
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 | |
54 | EFI_LBA LastUsableLBA;\r | |
55 | ///\r | |
56 | /// GUID that can be used to uniquely identify the disk.\r | |
57 | ///\r | |
58 | EFI_GUID DiskGUID;\r | |
59 | ///\r | |
60 | /// The starting LBA of the GUID Partition Entry array.\r | |
61 | ///\r | |
62 | EFI_LBA PartitionEntryLBA;\r | |
63 | ///\r | |
64 | /// The number of Partition Entries in the GUID Partition Entry array.\r | |
65 | ///\r | |
66 | UINT32 NumberOfPartitionEntries;\r | |
67 | ///\r | |
68 | /// The size, in bytes, of each the GUID Partition\r | |
69 | /// Entry structures in the GUID Partition Entry\r | |
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 | |
72 | ///\r | |
73 | UINT32 SizeOfPartitionEntry;\r | |
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 | |
80 | UINT32 PartitionEntryArrayCRC32;\r | |
81 | } EFI_PARTITION_TABLE_HEADER;\r | |
82 | \r | |
83 | ///\r | |
84 | /// GPT Partition Entry.\r | |
85 | ///\r | |
86 | typedef struct {\r | |
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 | |
91 | EFI_GUID PartitionTypeGUID;\r | |
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 | |
97 | EFI_GUID UniquePartitionGUID;\r | |
98 | ///\r | |
99 | /// Starting LBA of the partition defined by this entry\r | |
100 | ///\r | |
101 | EFI_LBA StartingLBA;\r | |
102 | ///\r | |
103 | /// Ending LBA of the partition defined by this entry.\r | |
104 | ///\r | |
105 | EFI_LBA EndingLBA;\r | |
106 | ///\r | |
107 | /// Attribute bits, all bits reserved by UEFI\r | |
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 | |
112 | /// Actions such as running diagnostics, system recovery, or even OS install or boot, could\r | |
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 | |
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 | |
118 | /// mappings will not be created for this partition in UEFI.\r | |
119 | /// Bit 2: This bit is set aside to let systems with traditional PC-AT BIOS firmware implementations\r | |
120 | /// inform certain limited, special-purpose software running on these systems that a GPT\r | |
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 | |
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 | |
127 | /// to modify these bits. They must be preserved if Bits 0-47 are modified..\r | |
128 | ///\r | |
129 | UINT64 Attributes;\r | |
130 | ///\r | |
131 | /// Null-terminated name of the partition.\r | |
132 | ///\r | |
133 | CHAR16 PartitionName[36];\r | |
134 | } EFI_PARTITION_ENTRY;\r | |
135 | \r | |
136 | #pragma pack()\r | |
137 | #endif\r |