2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_GPT_PARTITION_HEADER
20 #define GRUB_GPT_PARTITION_HEADER 1
22 #include <grub/types.h>
23 #include <grub/partition.h>
25 struct grub_gpt_part_type
30 grub_uint8_t data4
[8];
31 } __attribute__ ((aligned(8)));
32 typedef struct grub_gpt_part_type grub_gpt_part_type_t
;
34 #define GRUB_GPT_PARTITION_TYPE_EMPTY \
36 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } \
39 #define GRUB_GPT_PARTITION_TYPE_BIOS_BOOT \
40 { grub_cpu_to_le32_compile_time (0x21686148), \
41 grub_cpu_to_le16_compile_time (0x6449), \
42 grub_cpu_to_le16_compile_time (0x6e6f), \
43 { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \
46 #define GRUB_GPT_PARTITION_TYPE_LDM \
47 { grub_cpu_to_le32_compile_time (0x5808C8AAU),\
48 grub_cpu_to_le16_compile_time (0x7E8F), \
49 grub_cpu_to_le16_compile_time (0x42E0), \
50 { 0x85, 0xD2, 0xE1, 0xE9, 0x04, 0x34, 0xCF, 0xB3 } \
53 struct grub_gpt_header
55 grub_uint8_t magic
[8];
56 grub_uint32_t version
;
57 grub_uint32_t headersize
;
59 grub_uint32_t unused1
;
60 grub_uint64_t primary
;
64 grub_uint8_t guid
[16];
65 grub_uint64_t partitions
;
66 grub_uint32_t maxpart
;
67 grub_uint32_t partentry_size
;
68 grub_uint32_t partentry_crc32
;
71 struct grub_gpt_partentry
73 grub_gpt_part_type_t type
;
74 grub_uint8_t guid
[16];
82 grub_gpt_partition_map_iterate (grub_disk_t disk
,
83 grub_partition_iterate_hook_t hook
,
87 #endif /* ! GRUB_GPT_PARTITION_HEADER */