Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / gpt_partition.h
blob83e3b3192d77b4c57882b96fc6a8f1f154533669
1 /*
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
27 grub_uint32_t data1;
28 grub_uint16_t data2;
29 grub_uint16_t data3;
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 \
35 { 0x0, 0x0, 0x0, \
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;
58 grub_uint32_t crc32;
59 grub_uint32_t unused1;
60 grub_uint64_t primary;
61 grub_uint64_t backup;
62 grub_uint64_t start;
63 grub_uint64_t end;
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;
69 } __attribute__ ((packed));
71 struct grub_gpt_partentry
73 grub_gpt_part_type_t type;
74 grub_uint8_t guid[16];
75 grub_uint64_t start;
76 grub_uint64_t end;
77 grub_uint64_t attrib;
78 char name[72];
79 } __attribute__ ((packed));
81 grub_err_t
82 grub_gpt_partition_map_iterate (grub_disk_t disk,
83 int (*hook) (grub_disk_t disk,
84 const grub_partition_t partition));
87 #endif /* ! GRUB_GPT_PARTITION_HEADER */