| 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 | 5 |
| 6 #ifndef VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ | 6 #ifndef VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ |
| 7 #define VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ | 7 #define VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ |
| 8 | 8 |
| 9 #include "sysincludes.h" | 9 #include "sysincludes.h" |
| 10 #include "cgptlib.h" | 10 #include "cgptlib.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 /* Defines GPT sizes */ | 55 /* Defines GPT sizes */ |
| 56 #define GPT_PMBR_SECTOR 1 /* size (in sectors) of PMBR */ | 56 #define GPT_PMBR_SECTOR 1 /* size (in sectors) of PMBR */ |
| 57 #define GPT_HEADER_SECTOR 1 | 57 #define GPT_HEADER_SECTOR 1 |
| 58 #define GPT_ENTRIES_SECTORS 32 /* assume sector size if 512 bytes, then | 58 #define GPT_ENTRIES_SECTORS 32 /* assume sector size if 512 bytes, then |
| 59 * (TOTAL_ENTRIES_SIZE / 512) = 32 */ | 59 * (TOTAL_ENTRIES_SIZE / 512) = 32 */ |
| 60 | 60 |
| 61 /* alias name of index in internal array for primary and secondary header and | 61 /* alias name of index in internal array for primary and secondary header and |
| 62 * entries. */ | 62 * entries. */ |
| 63 enum { | 63 enum { |
| 64 /* constants for index */ |
| 64 PRIMARY = 0, | 65 PRIMARY = 0, |
| 65 SECONDARY = 1, | 66 SECONDARY = 1, |
| 67 ANY_VALID = 9999, /* accept any between primary and secondary */ |
| 68 |
| 69 /* constants for bit mask */ |
| 66 MASK_NONE = 0, | 70 MASK_NONE = 0, |
| 67 MASK_PRIMARY = 1, | 71 MASK_PRIMARY = 1, |
| 68 MASK_SECONDARY = 2, | 72 MASK_SECONDARY = 2, |
| 69 MASK_BOTH = 3, | 73 MASK_BOTH = 3, |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 /* Verify GptData parameters are sane. */ | 76 /* Verify GptData parameters are sane. */ |
| 73 int CheckParameters(GptData* gpt); | 77 int CheckParameters(GptData* gpt); |
| 74 | 78 |
| 75 /* Check header fields. | 79 /* Check header fields. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 /* Return 1 if the entry is unused, 0 if it is used. */ | 113 /* Return 1 if the entry is unused, 0 if it is used. */ |
| 110 int IsUnusedEntry(const GptEntry* e); | 114 int IsUnusedEntry(const GptEntry* e); |
| 111 | 115 |
| 112 /* Returns 1 if the entry is a Chrome OS kernel partition, else 0. */ | 116 /* Returns 1 if the entry is a Chrome OS kernel partition, else 0. */ |
| 113 int IsKernelEntry(const GptEntry* e); | 117 int IsKernelEntry(const GptEntry* e); |
| 114 | 118 |
| 115 /* Copies the current kernel partition's UniquePartitionGuid to the dest */ | 119 /* Copies the current kernel partition's UniquePartitionGuid to the dest */ |
| 116 void GetCurrentKernelUniqueGuid(GptData *gpt, void *dest); | 120 void GetCurrentKernelUniqueGuid(GptData *gpt, void *dest); |
| 117 | 121 |
| 118 #endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ | 122 #endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ |
| OLD | NEW |