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>
24 struct grub_gpt_part_type
29 grub_uint8_t data4
[8];
30 } __attribute__ ((aligned(8)));
31 typedef struct grub_gpt_part_type grub_gpt_part_type_t
;
33 #define GRUB_GPT_PARTITION_TYPE_EMPTY \
35 { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } \
38 #define GRUB_GPT_PARTITION_TYPE_BIOS_BOOT \
39 { grub_cpu_to_le32 (0x21686148), grub_cpu_to_le16 (0x6449), grub_cpu_to_le16 (0x6e6f), \
40 { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \
43 struct grub_gpt_header
45 grub_uint8_t magic
[8];
46 grub_uint32_t version
;
47 grub_uint32_t headersize
;
49 grub_uint32_t unused1
;
50 grub_uint64_t primary
;
54 grub_uint8_t guid
[16];
55 grub_uint64_t partitions
;
56 grub_uint32_t maxpart
;
57 grub_uint32_t partentry_size
;
58 grub_uint32_t partentry_crc32
;
59 } __attribute__ ((packed
));
61 struct grub_gpt_partentry
63 grub_gpt_part_type_t type
;
64 grub_uint8_t guid
[16];
69 } __attribute__ ((packed
));
71 #endif /* ! GRUB_GPT_PARTITION_HEADER */