summaryrefslogtreecommitdiff
path: root/Core/CORE_DXE/Partition/Gpt.h
blob: 120b90a07f93a4b16c118846e4f9daf504dbe5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2009, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/SOURCE/Core/CORE_DXE/Partition/Gpt.h 6     7/09/09 5:01p Oleksiyy $
//
// $Revision: 6 $
//
// $Date: 7/09/09 5:01p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Core/CORE_DXE/Partition/Gpt.h $
// 
// 6     7/09/09 5:01p Oleksiyy
// Files clean-up
//
// 5     1/08/08 4:37p Robert
//
// 4     1/08/08 4:00p Robert
//
// 3     1/07/08 4:21p Robert
// Updated for coding standard
//
// 2     4/24/07 6:06p Robert
// Update for CHM compliance
//
// 1     1/28/05 1:17p Felixp
//
// 2     1/18/05 3:22p Felixp
// PrintDebugMessage renamed to Trace
//
// 1     12/22/04 6:19p Admin
//
// 1     12/22/04 6:18p Admin
//
// 2     12/02/04 5:54p Robert
// Partition driver version works
//
//**********************************************************************
//<AMI_FHDR_START>
//
// Name:    <GPT.h>
//
// Description: EFI GPT Partition Generic Driver Header.
//
//<AMI_FHDR_END>
//**********************************************************************

#ifndef _GPT_H_
#define _GPT_H_

#pragma pack(1)

#define EFI_GPT_HEADER_ID  "EFI PART"

// GUID Partition Table Header
//<AMI_STHDR_START>
//============================================================================
// Structure:   GPT_HEADER
//
// Description: Data Structure definition of the GPT table
//
// Fields:
//      Header - EFI_TABLE_HEADER - defines generic EFI header information
//      MyLba - EFI_LBA - The LBA that contains this GPT data structure
//      AlternateLba - EFI_LBA - The LBA that contains the alternative GPT
//          data structure
//      FirstUsableLba - EFI_LBA - the first logical block that can be used
//          in a partition that is defined by the GPT
//      LastUsableLba - EFI_LBA - the last logical block that can be used
//          in a partition that is defined by the GPT
//      DiskGuid - EFI_GUID - Unique GUID to identify this hard drive
//      PartitionEntryLba - EFI_LBA - the starting LBA of the GUID Partition
//          Entry Array
//      NumberOfPartitionEntries - UINT32 - the number of partition entries
//          in the Array
//      SizeOfPartitionEntry - UINT32 - the size of each partition entry
//      Crc32 - UINT32 - crc value of the entire GPT block
//
// Referral:
//      EFI_TABLE_HEADER EFI_LBA EFI_GUID
//============================================================================
//<AMI_STHDR_END>
typedef struct
{
    EFI_TABLE_HEADER    Header;
    EFI_LBA             MyLba;
    EFI_LBA             AlternateLba;
    EFI_LBA             FirstUsableLba;
    EFI_LBA             LastUsableLba;
    EFI_GUID            DiskGuid;
    EFI_LBA             PartitionEntryLba;
    UINT32              NumberOfPartitionEntries;
    UINT32              SizeOfPartitionEntry;
    UINT32              Crc32;
} GPT_HEADER;

// GPT Partition Entry
//<AMI_STHDR_START>
//============================================================================
// Structure:   PARTITION_ENTRY
//
// Description: Data Structure definition of a partion entry in the GPT table
//
// Fields:
//      PartitionTypeGuid - EFI_GUID - contains GUID that defines that type
//          of GUID
//      UniquePartitionGuid - EFI_GUID - contains unique GUID for each
//          partition
//      StartingLba - EFI_LBA - first LBA of the partition
//      EndingLba - EFI_LBA - last logical block address
//      Attributes - UINT64 - UEFI defined attributes
//          Bit 0 - Partition is required for platform to function
//          Bits 1 - 47 - undefined
//          Bits 48 - 64 - reserved for GUID specific use
//      PartitionName[36] - CHAR16 - unicode string containing the name of
//          the partition
//
// Referral:
//      EFI_LBA
//============================================================================
//<AMI_STHDR_END>
typedef struct
{
    EFI_GUID    PartitionTypeGuid;
    EFI_GUID    UniquePartitionGuid;
    EFI_LBA     StartingLba;
    EFI_LBA     EndingLba;
    UINT64      Attributes;
    CHAR16      PartitionName[36];
} PARTITION_ENTRY;


#pragma pack()

#endif
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2009, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************