Index: src/platform/vboot_reference/cgptlib/cgpt.h |
diff --git a/src/platform/vboot_reference/cgptlib/cgpt.h b/src/platform/vboot_reference/cgptlib/cgpt.h |
index acc1ec9e66c06f9e18bc59fa2698e13d0d7e62bb..c9cd04ddb9c9d93eed0e523af2830869ec7d7858 100644 |
--- a/src/platform/vboot_reference/cgptlib/cgpt.h |
+++ b/src/platform/vboot_reference/cgptlib/cgpt.h |
@@ -9,10 +9,11 @@ |
#include <stdint.h> |
enum { |
- GPT_ERROR_INVALID_HEADERS = 1, |
- GPT_ERROR_INVALID_ENTRIES, |
- GPT_ERROR_INVALID_SECTOR_SIZE, |
- GPT_ERROR_INVALID_SECTOR_NUMBER, |
+ GPT_ERROR_NO_VALID_KERNEL = 1, |
+ GPT_ERROR_INVALID_HEADERS, |
+ GPT_ERROR_INVALID_ENTRIES, |
+ GPT_ERROR_INVALID_SECTOR_SIZE, |
+ GPT_ERROR_INVALID_SECTOR_NUMBER, |
}; |
#define GPT_MODIFIED_HEADER1 0x01 |
@@ -28,27 +29,27 @@ enum { |
* invalid. */ |
struct GPTData { |
- /* Fill in the following fields before calling GPTInit() */ |
- uint8_t *header1; /* GPT primary header, from sector 1 of disk |
- * (size: 512 bytes) */ |
- uint8_t *header2; /* GPT secondary header, from last sector of |
- * disk (size: 512 bytes) */ |
- uint8_t *entries1; /* primary GPT table, follows primary header |
- * (size: 16 KB) */ |
- uint8_t *entries2; /* secondary GPT table, precedes secondary |
- * header (size: 16 KB) */ |
- uint32_t sector_bytes; /* Size of a LBA sector, in bytes */ |
- uint64_t drive_sectors; /* Size of drive in LBA sectors, in sectors */ |
+ /* Fill in the following fields before calling GPTInit() */ |
+ uint8_t *header1; /* GPT primary header, from sector 1 of disk |
+ * (size: 512 bytes) */ |
+ uint8_t *header2; /* GPT secondary header, from last sector of |
+ * disk (size: 512 bytes) */ |
+ uint8_t *entries1; /* primary GPT table, follows primary header |
+ * (size: 16 KB) */ |
+ uint8_t *entries2; /* secondary GPT table, precedes secondary |
+ * header (size: 16 KB) */ |
+ uint32_t sector_bytes; /* Size of a LBA sector, in bytes */ |
+ uint64_t drive_sectors; /* Size of drive in LBA sectors, in sectors */ |
- /* Outputs */ |
- uint8_t modified; /* Which inputs have been modified? |
- * 0x01 = header1 |
- * 0x02 = header2 |
- * 0x04 = table1 |
- * 0x08 = table2 */ |
+ /* Outputs */ |
+ uint8_t modified; /* Which inputs have been modified? |
+ * 0x01 = header1 |
+ * 0x02 = header2 |
+ * 0x04 = table1 |
+ * 0x08 = table2 */ |
- /* Internal state */ |
- uint8_t current_kernel; // the current kernel index |
+ /* Internal state */ |
+ uint8_t current_kernel; // the current kernel index |
}; |
typedef struct GPTData GPTData_t; |
@@ -74,7 +75,8 @@ int GPTNextKernelEntry(GPTData_t *gpt, uint64_t *start_sector, uint64_t *size); |
* for the start of the kernel partition, and the size parameter contains the |
* size of the kernel partition in LBA sectors. |
* |
- * Returns 0 if successful, 1 if error or no more sectors. */ |
+ * Returns 0 if successful, else |
+ * GPT_ERROR_NO_VALID_KERNEL, no avaliable kernel, enters recovery mode */ |
int GPTUpdateKernelEntry(GPTData_t *gpt, uint32_t update_type); |
/* Updates the kernel entry with the specified index, using the specified type |
@@ -85,4 +87,4 @@ int GPTUpdateKernelEntry(GPTData_t *gpt, uint32_t update_type); |
* |
* Returns 0 if successful, 1 if error. */ |
-#endif // VBOOT_REFERENCE_CGPT_H_ |
+#endif /* VBOOT_REFERENCE_CGPT_H_ */ |