iPXE
UefiGpt.h
Go to the documentation of this file.
00001 /** @file
00002   EFI Guid Partition Table Format Definition.
00003 
00004 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
00005 This program and the accompanying materials are licensed and made available under
00006 the terms and conditions of the BSD License that accompanies this distribution.
00007 The full text of the license may be found at
00008 http://opensource.org/licenses/bsd-license.php.
00009 
00010 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00011 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00012 
00013 **/
00014 
00015 #ifndef __UEFI_GPT_H__
00016 #define __UEFI_GPT_H__
00017 
00018 FILE_LICENCE ( BSD3 );
00019 
00020 ///
00021 /// The primary GUID Partition Table Header must be
00022 /// located in LBA 1 (i.e., the second logical block).
00023 ///
00024 #define PRIMARY_PART_HEADER_LBA 1
00025 ///
00026 /// EFI Partition Table Signature: "EFI PART".
00027 ///
00028 #define EFI_PTAB_HEADER_ID      SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
00029 
00030 #pragma pack(1)
00031 
00032 ///
00033 /// GPT Partition Table Header.
00034 ///
00035 typedef struct {
00036   ///
00037   /// The table header for the GPT partition Table.
00038   /// This header contains EFI_PTAB_HEADER_ID.
00039   ///
00040   EFI_TABLE_HEADER  Header;
00041   ///
00042   /// The LBA that contains this data structure.
00043   ///
00044   EFI_LBA           MyLBA;
00045   ///
00046   /// LBA address of the alternate GUID Partition Table Header.
00047   ///
00048   EFI_LBA           AlternateLBA;
00049   ///
00050   /// The first usable logical block that may be used
00051   /// by a partition described by a GUID Partition Entry.
00052   ///
00053   EFI_LBA           FirstUsableLBA;
00054   ///
00055   /// The last usable logical block that may be used
00056   /// by a partition described by a GUID Partition Entry.
00057   ///
00058   EFI_LBA           LastUsableLBA;
00059   ///
00060   /// GUID that can be used to uniquely identify the disk.
00061   ///
00062   EFI_GUID          DiskGUID;
00063   ///
00064   /// The starting LBA of the GUID Partition Entry array.
00065   ///
00066   EFI_LBA           PartitionEntryLBA;
00067   ///
00068   /// The number of Partition Entries in the GUID Partition Entry array.
00069   ///
00070   UINT32            NumberOfPartitionEntries;
00071   ///
00072   /// The size, in bytes, of each the GUID Partition
00073   /// Entry structures in the GUID Partition Entry
00074   /// array. This field shall be set to a value of 128 x 2^n where n is
00075   /// an integer greater than or equal to zero (e.g., 128, 256, 512, etc.).
00076   ///
00077   UINT32            SizeOfPartitionEntry;
00078   ///
00079   /// The CRC32 of the GUID Partition Entry array.
00080   /// Starts at PartitionEntryLBA and is
00081   /// computed over a byte length of
00082   /// NumberOfPartitionEntries * SizeOfPartitionEntry.
00083   ///
00084   UINT32            PartitionEntryArrayCRC32;
00085 } EFI_PARTITION_TABLE_HEADER;
00086 
00087 ///
00088 /// GPT Partition Entry.
00089 ///
00090 typedef struct {
00091   ///
00092   /// Unique ID that defines the purpose and type of this Partition. A value of
00093   /// zero defines that this partition entry is not being used.
00094   ///
00095   EFI_GUID  PartitionTypeGUID;
00096   ///
00097   /// GUID that is unique for every partition entry. Every partition ever
00098   /// created will have a unique GUID.
00099   /// This GUID must be assigned when the GUID Partition Entry is created.
00100   ///
00101   EFI_GUID  UniquePartitionGUID;
00102   ///
00103   /// Starting LBA of the partition defined by this entry
00104   ///
00105   EFI_LBA   StartingLBA;
00106   ///
00107   /// Ending LBA of the partition defined by this entry.
00108   ///
00109   EFI_LBA   EndingLBA;
00110   ///
00111   /// Attribute bits, all bits reserved by UEFI
00112   /// Bit 0:      If this bit is set, the partition is required for the platform to function. The owner/creator of the
00113   ///             partition indicates that deletion or modification of the contents can result in loss of platform
00114   ///             features or failure for the platform to boot or operate. The system cannot function normally if
00115   ///             this partition is removed, and it should be considered part of the hardware of the system.
00116   ///             Actions such as running diagnostics, system recovery, or even OS install or boot, could
00117   ///             potentially stop working if this partition is removed. Unless OS software or firmware
00118   ///             recognizes this partition, it should never be removed or modified as the UEFI firmware or
00119   ///             platform hardware may become non-functional.
00120   /// Bit 1:      If this bit is set, then firmware must not produce an EFI_BLOCK_IO_PROTOCOL device for
00121   ///             this partition. By not producing an EFI_BLOCK_IO_PROTOCOL partition, file system
00122   ///             mappings will not be created for this partition in UEFI.
00123   /// Bit 2:      This bit is set aside to let systems with traditional PC-AT BIOS firmware implementations
00124   ///             inform certain limited, special-purpose software running on these systems that a GPT
00125   ///             partition may be bootable. The UEFI boot manager must ignore this bit when selecting
00126   ///             a UEFI-compliant application, e.g., an OS loader.
00127   /// Bits 3-47:  Undefined and must be zero. Reserved for expansion by future versions of the UEFI
00128   ///             specification.
00129   /// Bits 48-63: Reserved for GUID specific use. The use of these bits will vary depending on the
00130   ///             PartitionTypeGUID. Only the owner of the PartitionTypeGUID is allowed
00131   ///             to modify these bits. They must be preserved if Bits 0-47 are modified..
00132   ///
00133   UINT64    Attributes;
00134   ///
00135   /// Null-terminated name of the partition.
00136   ///
00137   CHAR16    PartitionName[36];
00138 } EFI_PARTITION_ENTRY;
00139 
00140 #pragma pack()
00141 #endif
00142 
00143