| 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 | 11 |
| 12 int CheckParameters(GptData *gpt); | 12 int CheckParameters(GptData *gpt); |
| 13 uint32_t CheckHeaderSignature(GptData *gpt); | 13 uint32_t CheckHeaderSignature(GptData *gpt); |
| 14 uint32_t CheckRevision(GptData *gpt); | 14 uint32_t CheckRevision(GptData *gpt); |
| 15 uint32_t CheckSize(GptData *gpt); | 15 uint32_t CheckSize(GptData *gpt); |
| 16 uint32_t CheckReservedFields(GptData *gpt); | 16 uint32_t CheckReservedFields(GptData *gpt); |
| 17 uint32_t CheckMyLba(GptData *gpt); | 17 uint32_t CheckMyLba(GptData *gpt); |
| 18 uint32_t CheckSizeOfPartitionEntry(GptData *gpt); | 18 uint32_t CheckSizeOfPartitionEntry(GptData *gpt); |
| 19 uint32_t CheckNumberOfEntries(GptData *gpt); | 19 uint32_t CheckNumberOfEntries(GptData *gpt); |
| 20 uint32_t CheckEntriesLba(GptData *gpt); | 20 uint32_t CheckEntriesLba(GptData *gpt); |
| 21 uint32_t CheckValidUsableLbas(GptData *gpt); | 21 uint32_t CheckValidUsableLbas(GptData *gpt); |
| 22 uint32_t CheckHeaderCrc(GptData *gpt); | 22 uint32_t CheckHeaderCrc(GptData *gpt); |
| 23 uint32_t CheckEntriesCrc(GptData *gpt); | 23 uint32_t CheckEntriesCrc(GptData *gpt); |
| 24 uint32_t CheckValidEntries(GptData *gpt); | 24 uint32_t CheckValidEntries(GptData *gpt); |
| 25 int OverlappedEntries(GptEntry *entries, uint32_t number_of_entries); | |
| 26 uint32_t CheckOverlappedPartition(GptData *gpt); | |
| 27 uint8_t RepairEntries(GptData *gpt, const uint32_t valid_entries); | |
| 28 uint8_t RepairHeader(GptData *gpt, const uint32_t valid_headers); | |
| 29 typedef struct { | 25 typedef struct { |
| 30 uint64_t starting; | 26 uint64_t starting; |
| 31 uint64_t ending; | 27 uint64_t ending; |
| 32 } pair_t; | 28 } pair_t; |
| 29 int OverlappedEntries(GptEntry *entries, uint32_t number_of_entries); |
| 30 uint32_t CheckOverlappedPartition(GptData *gpt); |
| 31 int IsSynonymous(const GptHeader* a, const GptHeader* b); |
| 32 uint8_t RepairEntries(GptData *gpt, const uint32_t valid_entries); |
| 33 uint8_t RepairHeader(GptData *gpt, const uint32_t valid_headers); |
| 34 void UpdateCrc(GptData *gpt); |
| 35 int GptSanityCheck(GptData *gpt); |
| 36 void GptRepair(GptData *gpt); |
| 33 | 37 |
| 34 void UpdateCrc(GptData *gpt); | |
| 35 GptEntry *GetEntry(GptData *gpt, int secondary, int entry_index); | 38 GptEntry *GetEntry(GptData *gpt, int secondary, int entry_index); |
| 36 void SetPriority(GptData *gpt, int secondary, int entry_index, int priority); | 39 void SetPriority(GptData *gpt, int secondary, int entry_index, int priority); |
| 37 int GetPriority(GptData *gpt, int secondary, int entry_index); | 40 int GetPriority(GptData *gpt, int secondary, int entry_index); |
| 38 void SetBad(GptData *gpt, int secondary, int entry_index, int bad); | 41 void SetBad(GptData *gpt, int secondary, int entry_index, int bad); |
| 39 int GetBad(GptData *gpt, int secondary, int entry_index); | 42 int GetBad(GptData *gpt, int secondary, int entry_index); |
| 40 void SetTries(GptData *gpt, int secondary, int entry_index, int tries); | 43 void SetTries(GptData *gpt, int secondary, int entry_index, int tries); |
| 41 int GetTries(GptData *gpt, int secondary, int entry_index); | 44 int GetTries(GptData *gpt, int secondary, int entry_index); |
| 42 void SetSuccessful(GptData *gpt, int secondary, int entry_index, int success); | 45 void SetSuccessful(GptData *gpt, int secondary, int entry_index, int success); |
| 43 int GetSuccessful(GptData *gpt, int secondary, int entry_index); | 46 int GetSuccessful(GptData *gpt, int secondary, int entry_index); |
| 44 | 47 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #define CGPT_ATTRIBUTE_MAX_TRIES (15ULL) | 80 #define CGPT_ATTRIBUTE_MAX_TRIES (15ULL) |
| 78 #define CGPT_ATTRIBUTE_TRIES_MASK (CGPT_ATTRIBUTE_MAX_TRIES << \ | 81 #define CGPT_ATTRIBUTE_TRIES_MASK (CGPT_ATTRIBUTE_MAX_TRIES << \ |
| 79 CGPT_ATTRIBUTE_TRIES_OFFSET) | 82 CGPT_ATTRIBUTE_TRIES_OFFSET) |
| 80 | 83 |
| 81 #define CGPT_ATTRIBUTE_PRIORITY_OFFSET 48 | 84 #define CGPT_ATTRIBUTE_PRIORITY_OFFSET 48 |
| 82 #define CGPT_ATTRIBUTE_MAX_PRIORITY (15ULL) | 85 #define CGPT_ATTRIBUTE_MAX_PRIORITY (15ULL) |
| 83 #define CGPT_ATTRIBUTE_PRIORITY_MASK (CGPT_ATTRIBUTE_MAX_PRIORITY << \ | 86 #define CGPT_ATTRIBUTE_PRIORITY_MASK (CGPT_ATTRIBUTE_MAX_PRIORITY << \ |
| 84 CGPT_ATTRIBUTE_PRIORITY_OFFSET) | 87 CGPT_ATTRIBUTE_PRIORITY_OFFSET) |
| 85 | 88 |
| 86 #endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ | 89 #endif /* VBOOT_REFERENCE_CGPTLIB_INTERNAL_H_ */ |
| OLD | NEW |