| 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 <stdint.h> | 9 #include <stdint.h> |
| 10 #include "cgptlib.h" | 10 #include "cgptlib.h" |
| 11 #include "gpt.h" | 11 #include "gpt.h" |
| 12 | 12 |
| 13 /* If gpt->current_kernel is this value, means either: | 13 /* If gpt->current_kernel is this value, means either: |
| 14 * 1. an initial value before scanning GPT entries, | 14 * 1. an initial value before scanning GPT entries, |
| 15 * 2. after scanning, no any valid kernel is found. | 15 * 2. after scanning, no any valid kernel is found. |
| 16 */ | 16 */ |
| 17 #define CGPT_KERNEL_ENTRY_NOT_FOUND (-1) | 17 #define CGPT_KERNEL_ENTRY_NOT_FOUND (-1) |
| 18 | 18 |
| 19 /* Bit definitions and masks for GPT attributes. | 19 /* Bit definitions and masks for GPT attributes. |
| 20 * | 20 * |
| 21 * 63 -- do not automounting | 21 * 63-61 -- (reserved) |
| 22 * 62 -- hidden | |
| 23 * 60 -- read-only | 22 * 60 -- read-only |
| 24 * : | 23 * 59-57 -- (reserved) |
| 25 * 56 -- success | 24 * 56 -- success |
| 26 * 55,52 -- tries | 25 * 55-52 -- tries |
| 27 * 51,48 -- priority | 26 * 51-48 -- priority |
| 28 * 0 -- system partition | 27 * 47-2 -- UEFI: reserved for future use |
| 28 * 1 -- UEFI: partition is not mapped |
| 29 * 0 -- UEFI: partition is required |
| 29 */ | 30 */ |
| 30 #define CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET 56 | 31 #define CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET 56 |
| 31 #define CGPT_ATTRIBUTE_MAX_SUCCESSFUL (1ULL) | 32 #define CGPT_ATTRIBUTE_MAX_SUCCESSFUL (1ULL) |
| 32 #define CGPT_ATTRIBUTE_SUCCESSFUL_MASK (CGPT_ATTRIBUTE_MAX_SUCCESSFUL << \ | 33 #define CGPT_ATTRIBUTE_SUCCESSFUL_MASK (CGPT_ATTRIBUTE_MAX_SUCCESSFUL << \ |
| 33 CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET) | 34 CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET) |
| 34 | 35 |
| 35 #define CGPT_ATTRIBUTE_TRIES_OFFSET 52 | 36 #define CGPT_ATTRIBUTE_TRIES_OFFSET 52 |
| 36 #define CGPT_ATTRIBUTE_MAX_TRIES (15ULL) | 37 #define CGPT_ATTRIBUTE_MAX_TRIES (15ULL) |
| 37 #define CGPT_ATTRIBUTE_TRIES_MASK (CGPT_ATTRIBUTE_MAX_TRIES << \ | 38 #define CGPT_ATTRIBUTE_TRIES_MASK (CGPT_ATTRIBUTE_MAX_TRIES << \ |
| 38 CGPT_ATTRIBUTE_TRIES_OFFSET) | 39 CGPT_ATTRIBUTE_TRIES_OFFSET) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void SetEntryPriority(GptEntry* e, int priority); | 108 void SetEntryPriority(GptEntry* e, int priority); |
| 108 void SetEntryTries(GptEntry* e, int tries); | 109 void SetEntryTries(GptEntry* e, int tries); |
| 109 | 110 |
| 110 /* Return 1 if the entry is unused, 0 if it is used. */ | 111 /* Return 1 if the entry is unused, 0 if it is used. */ |
| 111 int IsUnusedEntry(const GptEntry* e); | 112 int IsUnusedEntry(const GptEntry* e); |
| 112 | 113 |
| 113 /* Returns 1 if the entry is a Chrome OS kernel partition, else 0. */ | 114 /* Returns 1 if the entry is a Chrome OS kernel partition, else 0. */ |
| 114 int IsKernelEntry(const GptEntry* e); | 115 int IsKernelEntry(const GptEntry* e); |
| 115 | 116 |
| 116 #endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ | 117 #endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ |
| OLD | NEW |