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 "sysincludes.h" | 13 #include "sysincludes.h" |
14 | 14 |
15 PACK_START /* Support packing for MSVC */ | 15 #ifdef _MSC_VER |
| 16 #pragma pack(push,1) /* Support packing for MSVC. */ |
| 17 #endif |
16 | 18 |
17 #define GPT_HEADER_SIGNATURE "EFI PART" | 19 #define GPT_HEADER_SIGNATURE "EFI PART" |
18 #define GPT_HEADER_SIGNATURE_SIZE sizeof(GPT_HEADER_SIGNATURE) | 20 #define GPT_HEADER_SIGNATURE_SIZE sizeof(GPT_HEADER_SIGNATURE) |
19 #define GPT_HEADER_REVISION 0x00010000 | 21 #define GPT_HEADER_REVISION 0x00010000 |
20 | 22 |
21 /* The first 3 numbers should be stored in network-endian format | 23 /* The first 3 numbers should be stored in network-endian format |
22 * according to the GUID RFC. The UEFI spec appendix A claims they | 24 * according to the GUID RFC. The UEFI spec appendix A claims they |
23 * should be stored in little-endian format. But they need to be | 25 * should be stored in little-endian format. But they need to be |
24 * _displayed_ in network-endian format, which is also how they're | 26 * _displayed_ in network-endian format, which is also how they're |
25 * documented in the specs. | 27 * documented in the specs. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 uint16_t gpt_att; | 110 uint16_t gpt_att; |
109 } __attribute__((packed)) fields; | 111 } __attribute__((packed)) fields; |
110 uint64_t whole; | 112 uint64_t whole; |
111 } attrs; | 113 } attrs; |
112 uint16_t name[36]; /* UTF-16 encoded partition name */ | 114 uint16_t name[36]; /* UTF-16 encoded partition name */ |
113 /* Remainder of entry is reserved and should be 0 */ | 115 /* Remainder of entry is reserved and should be 0 */ |
114 } __attribute__((packed)) GptEntry; | 116 } __attribute__((packed)) GptEntry; |
115 | 117 |
116 #define GPTENTRY_EXPECTED_SIZE 128 | 118 #define GPTENTRY_EXPECTED_SIZE 128 |
117 | 119 |
118 PACK_STOP /* Support packing for MSVC */ | 120 #ifdef _MSC_VER |
| 121 #pragma pack(pop) /* Support packing for MSVC. */ |
| 122 #endif |
119 | 123 |
120 #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ | 124 #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ |
OLD | NEW |