mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-30 21:23:40 +00:00
@@ -95,7 +95,6 @@ int GptUpdateKernelEntry(GptData* gpt, uint32_t update_type) {
|
||||
GptEntry* e = entries + gpt->current_kernel;
|
||||
uint64_t previous_attr = e->attributes;
|
||||
|
||||
/* TODO: need a better return code for these errors? */
|
||||
if (gpt->current_kernel == CGPT_KERNEL_ENTRY_NOT_FOUND)
|
||||
return GPT_ERROR_INVALID_UPDATE_TYPE;
|
||||
if (!IsKernelEntry(e))
|
||||
|
||||
@@ -60,7 +60,7 @@ int CheckHeader(GptHeader *h, int is_secondary, uint64_t drive_sectors) {
|
||||
if (h->reserved_zero)
|
||||
return 1;
|
||||
|
||||
/* TODO: Padding must be set to zero. */
|
||||
/* Could check that padding is zero, but that doesn't matter to us. */
|
||||
|
||||
/* If entry size is different than our struct, we won't be able to
|
||||
* parse it. Technically, any size 2^N where N>=7 is valid. */
|
||||
|
||||
@@ -24,6 +24,10 @@ enum {
|
||||
#define GPT_MODIFIED_ENTRIES1 0x04
|
||||
#define GPT_MODIFIED_ENTRIES2 0x08
|
||||
|
||||
#define TOTAL_ENTRIES_SIZE 16384 /* Size of GptData.primary_entries
|
||||
* and secondary_entries: 128
|
||||
* bytes/entry * 128 entries. */
|
||||
|
||||
/* The 'update_type' of GptUpdateKernelEntry()
|
||||
* We expose TRY and BAD only because those are what verified boot needs.
|
||||
* For more precise control on GPT attribute bits, please refer to
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
CGPT_ATTRIBUTE_PRIORITY_OFFSET)
|
||||
|
||||
/* Defines ChromeOS-specific limitation on GPT */
|
||||
/* TODO: Move these to cgptlib_internal.h */
|
||||
#define MIN_SIZE_OF_HEADER 92
|
||||
#define MAX_SIZE_OF_HEADER 512
|
||||
#define MIN_SIZE_OF_ENTRY 128
|
||||
@@ -52,7 +51,6 @@
|
||||
#define SIZE_OF_ENTRY_MULTIPLE 8
|
||||
#define MIN_NUMBER_OF_ENTRIES 32
|
||||
#define MAX_NUMBER_OF_ENTRIES 512
|
||||
#define TOTAL_ENTRIES_SIZE 16384 /* usual case is 128 bytes * 128 entries */
|
||||
|
||||
/* Defines GPT sizes */
|
||||
#define GPT_PMBR_SECTOR 1 /* size (in sectors) of PMBR */
|
||||
|
||||
Reference in New Issue
Block a user