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_ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 uint32_t reserved_zero; | 76 uint32_t reserved_zero; |
77 uint64_t my_lba; | 77 uint64_t my_lba; |
78 uint64_t alternate_lba; | 78 uint64_t alternate_lba; |
79 uint64_t first_usable_lba; | 79 uint64_t first_usable_lba; |
80 uint64_t last_usable_lba; | 80 uint64_t last_usable_lba; |
81 Guid disk_uuid; | 81 Guid disk_uuid; |
82 uint64_t entries_lba; | 82 uint64_t entries_lba; |
83 uint32_t number_of_entries; | 83 uint32_t number_of_entries; |
84 uint32_t size_of_entry; | 84 uint32_t size_of_entry; |
85 uint32_t entries_crc32; | 85 uint32_t entries_crc32; |
86 uint8_t reserved_padding[]; /* entire sector reserved for header */ | 86 /* Remainder of sector is reserved and should be 0 */ |
87 } __attribute__((packed)) GptHeader; | 87 } __attribute__((packed)) GptHeader; |
88 | 88 |
89 /* GPT partition entry defines the starting and ending LBAs of a partition. | 89 /* GPT partition entry defines the starting and ending LBAs of a partition. |
90 * It also contains the unique GUID, type, and attribute bits. | 90 * It also contains the unique GUID, type, and attribute bits. |
91 * | 91 * |
92 * You may find more details in chapter 5 of EFI standard. | 92 * You may find more details in chapter 5 of EFI standard. |
93 */ | 93 */ |
94 typedef struct { | 94 typedef struct { |
95 Guid type; | 95 Guid type; |
96 Guid unique; | 96 Guid unique; |
97 uint64_t starting_lba; | 97 uint64_t starting_lba; |
98 uint64_t ending_lba; | 98 uint64_t ending_lba; |
99 union { | 99 union { |
100 struct { | 100 struct { |
101 uint64_t : 48; | 101 uint64_t : 48; |
102 uint16_t gpt_att : 16; | 102 uint16_t gpt_att : 16; |
103 } __attribute__((packed)) fields; | 103 } __attribute__((packed)) fields; |
104 uint64_t whole; | 104 uint64_t whole; |
105 } attrs; | 105 } attrs; |
106 uint16_t name[36]; /* UTF-16 encoded partition name */ | 106 uint16_t name[36]; /* UTF-16 encoded partition name */ |
107 uint8_t reserved[]; /* nothing, really */ | 107 /* Remainder of entry is reserved and should be 0 */ |
108 } __attribute__((packed)) GptEntry; | 108 } __attribute__((packed)) GptEntry; |
109 | 109 |
110 #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ | 110 #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ |
OLD | NEW |