~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/ipxe/src/include/ipxe/efi/Uefi/UefiGpt.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

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