]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Uefi/UefiGpt.h
Update EntryPoint library header
[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 /// EFI Partition Table Signature: "EFI PART"
25 ///
26 #define EFI_PTAB_HEADER_ID SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
27
28 #pragma pack(1)
29
30 ///
31 /// GPT Partition Table Header
32 ///
33 typedef struct {
34 ///
35 /// The table header for the GPT partition Table.
36 /// This header contains EFI_PTAB_HEADER_ID
37 ///
38 EFI_TABLE_HEADER Header;
39 ///
40 /// The LBA that contains this data structure.
41 ///
42 EFI_LBA MyLBA;
43 ///
44 /// LBA address of the alternate GUID Partition Table Header.
45 ///
46 EFI_LBA AlternateLBA;
47 ///
48 /// The first usable logical block that may be used
49 /// by a partition described by a GUID Partition Entry.
50 ///
51 EFI_LBA FirstUsableLBA;
52 ///
53 /// The last usable logical block that may be used
54 /// by a partition described by a GUID Partition Entry.
55 ///
56 EFI_LBA LastUsableLBA;
57 ///
58 /// GUID that can be used to uniquely identify the disk.
59 ///
60 EFI_GUID DiskGUID;
61 ///
62 /// The starting LBA of the GUID Partition Entry array.
63 ///
64 EFI_LBA PartitionEntryLBA;
65 ///
66 /// The number of Partition Entries in the GUID Partition Entry array.
67 ///
68 UINT32 NumberOfPartitionEntries;
69 ///
70 /// The size, in bytes, of each the GUID Partition
71 /// Entry structures in the GUID Partition Entry
72 /// array. Must be a multiple of 8.
73 ///
74 UINT32 SizeOfPartitionEntry;
75 ///
76 /// The CRC32 of the GUID Partition Entry array.
77 /// Starts at PartitionEntryLBA and is
78 /// computed over a byte length of
79 /// NumberOfPartitionEntries * SizeOfPartitionEntry.
80 ///
81 UINT32 PartitionEntryArrayCRC32;
82 } EFI_PARTITION_TABLE_HEADER;
83
84 ///
85 /// GPT Partition Entry
86 ///
87 typedef struct {
88 ///
89 /// Unique ID that defines the purpose and type of this Partition. A value of
90 /// zero defines that this partition entry is not being used.
91 ///
92 EFI_GUID PartitionTypeGUID;
93 ///
94 /// GUID that is unique for every partition entry. Every partition ever
95 /// created will have a unique GUID.
96 /// This GUID must be assigned when the GUID Partition Entry is created.
97 ///
98 EFI_GUID UniquePartitionGUID;
99 ///
100 /// Starting LBA of the partition defined by this entry
101 ///
102 EFI_LBA StartingLBA;
103 ///
104 /// Ending LBA of the partition defined by this entry.
105 ///
106 EFI_LBA EndingLBA;
107 ///
108 /// Attribute bits, all bits reserved by UEFI
109 /// Bit 0 Required for the platform to function.
110 /// Bits 1-47 Undefined and must be zero.
111 /// Bits 48-63 Reserved for GUID specific use.
112 ///
113 UINT64 Attributes;
114 ///
115 /// Unicode string.
116 ///
117 CHAR16 PartitionName[36];
118 } EFI_PARTITION_ENTRY;
119
120 #pragma pack()
121 #endif
122
123