1342742Stsoome/* $FreeBSD: stable/11/stand/efi/include/efigpt.h 346482 2019-04-21 04:26:02Z kevans $ */
2342742Stsoome#ifndef _EFI_GPT_H
3342742Stsoome#define _EFI_GPT_H
4342742Stsoome/*++
5342742Stsoome
6342742StsoomeCopyright (c) 1998  Intel Corporation
7342742Stsoome
8342742StsoomeModule Name:
9342742Stsoome
10342742Stsoome    EfiGpt.h
11342742Stsoome
12342742StsoomeAbstract:
13342742Stsoome    Include file for EFI partitioning scheme
14342742Stsoome
15342742Stsoome
16342742Stsoome
17342742StsoomeRevision History
18342742Stsoome
19342742Stsoome--*/
20342742Stsoome
21342742Stsoome#define PRIMARY_PART_HEADER_LBA         1
22342742Stsoome
23342742Stsoometypedef struct {
24342742Stsoome    EFI_TABLE_HEADER    Header;
25342742Stsoome    EFI_LBA             MyLBA;
26342742Stsoome    EFI_LBA             AlternateLBA;
27342742Stsoome    EFI_LBA             FirstUsableLBA;
28342742Stsoome    EFI_LBA             LastUsableLBA;
29342742Stsoome    EFI_GUID            DiskGUID;
30342742Stsoome    EFI_LBA             PartitionEntryLBA;
31342742Stsoome    UINT32              NumberOfPartitionEntries;
32342742Stsoome    UINT32              SizeOfPartitionEntry;
33342742Stsoome    UINT32              PartitionEntryArrayCRC32;
34342742Stsoome} EFI_PARTITION_TABLE_HEADER;
35342742Stsoome
36342742Stsoome#define EFI_PTAB_HEADER_ID  "EFI PART"
37342742Stsoome
38342742Stsoometypedef struct {
39342742Stsoome    EFI_GUID    PartitionTypeGUID;
40342742Stsoome    EFI_GUID    UniquePartitionGUID;
41342742Stsoome    EFI_LBA     StartingLBA;
42342742Stsoome    EFI_LBA     EndingLBA;
43342742Stsoome    UINT64      Attributes;
44342742Stsoome    CHAR16      PartitionName[36];
45342742Stsoome} EFI_PARTITION_ENTRY;
46342742Stsoome
47342742Stsoome//
48342742Stsoome// EFI Partition Attributes
49342742Stsoome//
50342742Stsoome#define EFI_PART_USED_BY_EFI            0x0000000000000001
51342742Stsoome#define EFI_PART_REQUIRED_TO_FUNCTION   0x0000000000000002
52342742Stsoome#define EFI_PART_USED_BY_OS             0x0000000000000004
53342742Stsoome#define EFI_PART_REQUIRED_BY_OS         0x0000000000000008
54342742Stsoome#define EFI_PART_BACKUP_REQUIRED        0x0000000000000010
55342742Stsoome#define EFI_PART_USER_DATA              0x0000000000000020
56342742Stsoome#define EFI_PART_CRITICAL_USER_DATA     0x0000000000000040
57342742Stsoome#define EFI_PART_REDUNDANT_PARTITION    0x0000000000000080
58342742Stsoome
59342742Stsoome#define EFI_PART_TYPE_UNUSED_GUID   \
60342742Stsoome    { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }
61342742Stsoome
62342742Stsoome#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID  \
63342742Stsoome    { 0xc12a7328, 0xf81f, 0x11d2, {0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} }
64342742Stsoome
65342742Stsoome#define EFI_PART_TYPE_LEGACY_MBR_GUID   \
66342742Stsoome    { 0x024dee41, 0x33e7, 0x11d3, {0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f} }
67342742Stsoome
68342742Stsoome#endif
69342742Stsoome
70