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_H_ | 6 #ifndef VBOOT_REFERENCE_CGPTLIB_H_ |
7 #define VBOOT_REFERENCE_CGPTLIB_H_ | 7 #define VBOOT_REFERENCE_CGPTLIB_H_ |
8 | 8 |
9 #include "gpt.h" | 9 #include "gpt.h" |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 | 11 |
12 enum { | 12 enum { |
13 GPT_SUCCESS = 0, | 13 GPT_SUCCESS = 0, |
14 GPT_ERROR_NO_VALID_KERNEL, | 14 GPT_ERROR_NO_VALID_KERNEL, |
15 GPT_ERROR_INVALID_HEADERS, | 15 GPT_ERROR_INVALID_HEADERS, |
16 GPT_ERROR_INVALID_ENTRIES, | 16 GPT_ERROR_INVALID_ENTRIES, |
17 GPT_ERROR_INVALID_SECTOR_SIZE, | 17 GPT_ERROR_INVALID_SECTOR_SIZE, |
18 GPT_ERROR_INVALID_SECTOR_NUMBER, | 18 GPT_ERROR_INVALID_SECTOR_NUMBER, |
19 GPT_ERROR_INVALID_UPDATE_TYPE, | 19 GPT_ERROR_INVALID_UPDATE_TYPE, |
20 }; | 20 }; |
21 | 21 |
| 22 const char *GptError(int errno); |
| 23 |
22 /* Bit masks for GptData.modified field. */ | 24 /* Bit masks for GptData.modified field. */ |
23 #define GPT_MODIFIED_HEADER1 0x01 | 25 #define GPT_MODIFIED_HEADER1 0x01 |
24 #define GPT_MODIFIED_HEADER2 0x02 | 26 #define GPT_MODIFIED_HEADER2 0x02 |
25 #define GPT_MODIFIED_ENTRIES1 0x04 | 27 #define GPT_MODIFIED_ENTRIES1 0x04 |
26 #define GPT_MODIFIED_ENTRIES2 0x08 | 28 #define GPT_MODIFIED_ENTRIES2 0x08 |
27 | 29 |
28 /* The 'update_type' of GptUpdateKernelEntry() | 30 /* The 'update_type' of GptUpdateKernelEntry() |
29 * We expose TRY and BAD only because those are what verified boot needs. | 31 * We expose TRY and BAD only because those are what verified boot needs. |
30 * For more precise control on GPT attribute bits, please refer to | 32 * For more precise control on GPT attribute bits, please refer to |
31 * gpt_internal.h */ | 33 * gpt_internal.h */ |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 * of update (GPT_UPDATE_ENTRY_*). | 129 * of update (GPT_UPDATE_ENTRY_*). |
128 * | 130 * |
129 * On return the modified field may be set, if the GPT data has been modified | 131 * On return the modified field may be set, if the GPT data has been modified |
130 * and should be written to disk. | 132 * and should be written to disk. |
131 * | 133 * |
132 * Returns GPT_SUCCESS if successful, else | 134 * Returns GPT_SUCCESS if successful, else |
133 * GPT_ERROR_INVALID_UPDATE_TYPE, invalid 'update_type' is given. | 135 * GPT_ERROR_INVALID_UPDATE_TYPE, invalid 'update_type' is given. |
134 */ | 136 */ |
135 | 137 |
136 #endif /* VBOOT_REFERENCE_CGPTLIB_H_ */ | 138 #endif /* VBOOT_REFERENCE_CGPTLIB_H_ */ |
OLD | NEW |