OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * Defines EFI related structure. See more details in EFI 2.3 spec. | 5 * Defines EFI related structure. See more details in EFI 2.3 spec. |
6 * | 6 * |
7 * To download EFI standard, please visit UEFI homepage: | 7 * To download EFI standard, please visit UEFI homepage: |
8 * http://www.uefi.org/ | 8 * http://www.uefi.org/ |
9 */ | 9 */ |
10 #ifndef VBOOT_REFERENCE_CGPTLIB_GPT_H_ | 10 #ifndef VBOOT_REFERENCE_CGPTLIB_GPT_H_ |
11 #define VBOOT_REFERENCE_CGPTLIB_GPT_H_ | 11 #define VBOOT_REFERENCE_CGPTLIB_GPT_H_ |
12 | 12 |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 | 14 |
15 #define GPT_HEADER_SIGNATURE "EFI PART" | 15 #define GPT_HEADER_SIGNATURE "EFI PART" |
16 #define GPT_HEADER_SIGNATURE_SIZE sizeof(GPT_HEADER_SIGNATURE) | 16 #define GPT_HEADER_SIGNATURE_SIZE sizeof(GPT_HEADER_SIGNATURE) |
17 #define GPT_HEADER_REVISION 0x00010000 | 17 #define GPT_HEADER_REVISION 0x00010000 |
18 | 18 |
19 #define GPT_ENT_TYPE_EFI \ | 19 #define GPT_ENT_TYPE_EFI \ |
20 {{Uuid: {0xc12a7328,0xf81f,0x11d2,0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}}}} | 20 {{{0xc12a7328,0xf81f,0x11d2,0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}}}} |
21 #define GPT_ENT_TYPE_UNUSED \ | 21 #define GPT_ENT_TYPE_UNUSED \ |
22 {{Uuid: {0x00000000,0x0000,0x0000,0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}}}} | 22 {{{0x00000000,0x0000,0x0000,0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}}}} |
23 #define GPT_ENT_TYPE_CHROMEOS_KERNEL \ | 23 #define GPT_ENT_TYPE_CHROMEOS_KERNEL \ |
24 {{Uuid: {0xfe3a2a5d,0x4f32,0x41a7,0xb7,0x25,{0xac,0xcc,0x32,0x85,0xa3,0x09}}}} | 24 {{{0xfe3a2a5d,0x4f32,0x41a7,0xb7,0x25,{0xac,0xcc,0x32,0x85,0xa3,0x09}}}} |
25 #define GPT_ENT_TYPE_CHROMEOS_ROOTFS \ | 25 #define GPT_ENT_TYPE_CHROMEOS_ROOTFS \ |
26 {{Uuid: {0x3cb8e202,0x3b7e,0x47dd,0x8a,0x3c,{0x7f,0xf2,0xa1,0x3c,0xfc,0xec}}}} | 26 {{{0x3cb8e202,0x3b7e,0x47dd,0x8a,0x3c,{0x7f,0xf2,0xa1,0x3c,0xfc,0xec}}}} |
27 #define GPT_ENT_TYPE_CHROMEOS_RESERVED \ | 27 #define GPT_ENT_TYPE_CHROMEOS_RESERVED \ |
28 {{Uuid: {0x2e0a753d,0x9e48,0x43b0,0x83,0x37,{0xb1,0x51,0x92,0xcb,0x1b,0x5e}}}} | 28 {{{0x2e0a753d,0x9e48,0x43b0,0x83,0x37,{0xb1,0x51,0x92,0xcb,0x1b,0x5e}}}} |
29 | 29 |
30 #define UUID_NODE_LEN 6 | 30 #define UUID_NODE_LEN 6 |
31 #define GUID_SIZE 16 | 31 #define GUID_SIZE 16 |
32 | 32 |
33 /* GUID definition. | 33 /* GUID definition. |
34 * Defined in appendix A of EFI standard. | 34 * Defined in appendix A of EFI standard. |
35 */ | 35 */ |
36 typedef struct { | 36 typedef struct { |
37 union { | 37 union { |
38 struct { | 38 struct { |
39 uint32_t time_low; | 39 uint32_t time_low; |
40 uint16_t time_mid; | 40 uint16_t time_mid; |
41 uint16_t time_high_and_version; | 41 uint16_t time_high_and_version; |
42 uint8_t clock_seq_high_and_reserved; | 42 uint8_t clock_seq_high_and_reserved; |
43 uint8_t clock_seq_low; | 43 uint8_t clock_seq_low; |
44 uint8_t node[UUID_NODE_LEN]; | 44 uint8_t node[UUID_NODE_LEN]; |
45 } Uuid; | 45 } Uuid; |
46 uint8_t raw[GUID_SIZE]; | 46 uint8_t raw[GUID_SIZE]; |
47 }; | 47 } u; |
48 } __attribute__((packed)) Guid; | 48 } __attribute__((packed)) Guid; |
49 | 49 |
50 /* GPT header defines how many partitions exist on a drive and sectors managed. | 50 /* GPT header defines how many partitions exist on a drive and sectors managed. |
51 * For every drive device, there are 2 headers, primary and secondary. | 51 * For every drive device, there are 2 headers, primary and secondary. |
52 * Most of fields are duplicated except my_lba and entries_lba. | 52 * Most of fields are duplicated except my_lba and entries_lba. |
53 * | 53 * |
54 * You may find more details in chapter 5 of EFI standard. | 54 * You may find more details in chapter 5 of EFI standard. |
55 */ | 55 */ |
56 typedef struct { | 56 typedef struct { |
57 char signature[8]; | 57 char signature[8]; |
(...skipping 22 matching lines...) Expand all Loading... |
80 typedef struct { | 80 typedef struct { |
81 Guid type; | 81 Guid type; |
82 Guid unique; | 82 Guid unique; |
83 uint64_t starting_lba; | 83 uint64_t starting_lba; |
84 uint64_t ending_lba; | 84 uint64_t ending_lba; |
85 uint64_t attributes; | 85 uint64_t attributes; |
86 uint16_t name[36]; /* UTF-16 encoded partition name */ | 86 uint16_t name[36]; /* UTF-16 encoded partition name */ |
87 } GptEntry; | 87 } GptEntry; |
88 | 88 |
89 #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ | 89 #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ |
OLD | NEW |