]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Uefi/UefiGpt.h
Add comments for enumeration, structure data members those are referred by UefiServic...
[mirror_edk2.git] / MdePkg / Include / Uefi / UefiGpt.h
1 /** @file
2 EFI Guid Partition Table Format Definition.
3
4 Copyright (c) 2006 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __UEFI_GPT_H__
16 #define __UEFI_GPT_H__
17
18 ///
19 /// The primary GUID Partition Table Header must be
20 /// located in LBA 1 (i.e., the second logical block).
21 ///
22 #define PRIMARY_PART_HEADER_LBA 1
23
24 ///
25 /// EFI Partition Table Signature: "EFI PART"
26 ///
27 #define EFI_PTAB_HEADER_ID 0x5452415020494645ULL
28
29 #pragma pack(1)
30
31 ///
32 /// GPT Partition Table Header
33 ///
34 typedef struct {
35 ///
36 /// The table header for the GPT partition Table.
37 /// This header contains EFI_PTAB_HEADER_ID
38 ///
39 EFI_TABLE_HEADER Header;
40 ///
41 /// The LBA that contains this data structure.
42 ///
43 EFI_LBA MyLBA;
44 ///
45 /// LBA address of the alternate GUID Partition Table Header.
46 ///
47 EFI_LBA AlternateLBA;
48 ///
49 /// The first usable logical block that may be used
50 /// by a partition described by a GUID Partition Entry.
51 ///
52 EFI_LBA FirstUsableLBA;
53 ///
54 /// The last usable logical block that may be used
55 /// by a partition described by a GUID Partition Entry.
56 ///
57 EFI_LBA LastUsableLBA;
58 ///
59 /// GUID that can be used to uniquely identify the disk.
60 ///
61 EFI_GUID DiskGUID;
62 ///
63 /// The starting LBA of the GUID Partition Entry array.
64 ///
65 EFI_LBA PartitionEntryLBA;
66 ///
67 /// The number of Partition Entries in the GUID Partition Entry array.
68 ///
69 UINT32 NumberOfPartitionEntries;
70 ///
71 /// The size, in bytes, of each the GUID Partition
72 /// Entry structures in the GUID Partition Entry
73 /// array. Must be a multiple of 8.
74 ///
75 UINT32 SizeOfPartitionEntry;
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 ///
82 UINT32 PartitionEntryArrayCRC32;
83 } EFI_PARTITION_TABLE_HEADER;
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 ///
93 EFI_GUID PartitionTypeGUID;
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 ///
99 EFI_GUID UniquePartitionGUID;
100 ///
101 /// Starting LBA of the partition defined by this entry
102 ///
103 EFI_LBA StartingLBA;
104 ///
105 /// Ending LBA of the partition defined by this entry.
106 ///
107 EFI_LBA EndingLBA;
108 ///
109 /// Attribute bits, all bits reserved by UEFI
110 /// Bit 0 Required for the platform to function.
111 /// Bits 1-47 Undefined and must be zero.
112 /// Bits 48-63 Reserved for GUID specific use.
113 ///
114 UINT64 Attributes;
115 ///
116 /// Unicode string.
117 ///
118 CHAR16 PartitionName[36];
119 } EFI_PARTITION_ENTRY;
120
121 #pragma pack()
122 #endif
123
124