Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: firmware/lib/cgptlib/cgptlib.c

Issue 2799019: Modify the size of the attributes field to comply with msc limitations. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Fix the attribute field to allow compilation in the BIOS environment. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cgpt/cmd_show.c ('k') | firmware/lib/cgptlib/cgptlib_internal.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/cgptlib/cgptlib.c
diff --git a/firmware/lib/cgptlib/cgptlib.c b/firmware/lib/cgptlib/cgptlib.c
index 4856311af363f9db9b26611d3c9d778938b1c829..4d2ee6c0a803a2b9909a57727a09e7c8059185c3 100644
--- a/firmware/lib/cgptlib/cgptlib.c
+++ b/firmware/lib/cgptlib/cgptlib.c
@@ -93,7 +93,7 @@ int GptUpdateKernelEntry(GptData* gpt, uint32_t update_type) {
GptHeader* header = (GptHeader*)gpt->primary_header;
GptEntry* entries = (GptEntry*)gpt->primary_entries;
GptEntry* e = entries + gpt->current_kernel;
- uint64_t previous_attr = e->attributes;
+ uint16_t previous_attr = e->attrs.fields.gpt_att;
if (gpt->current_kernel == CGPT_KERNEL_ENTRY_NOT_FOUND)
return GPT_ERROR_INVALID_UPDATE_TYPE;
@@ -117,9 +117,10 @@ int GptUpdateKernelEntry(GptData* gpt, uint32_t update_type) {
}
case GPT_UPDATE_ENTRY_BAD: {
/* Giving up on this partition entirely. */
- e->attributes &= ~(CGPT_ATTRIBUTE_SUCCESSFUL_MASK |
- CGPT_ATTRIBUTE_TRIES_MASK |
- CGPT_ATTRIBUTE_PRIORITY_MASK);
+ e->attrs.fields.gpt_att = previous_attr & ~(
+ CGPT_ATTRIBUTE_SUCCESSFUL_MASK |
+ CGPT_ATTRIBUTE_TRIES_MASK |
+ CGPT_ATTRIBUTE_PRIORITY_MASK);
break;
}
default:
@@ -127,7 +128,7 @@ int GptUpdateKernelEntry(GptData* gpt, uint32_t update_type) {
}
/* If no change to attributes, we're done */
- if (e->attributes == previous_attr)
+ if (e->attrs.fields.gpt_att == previous_attr)
return GPT_SUCCESS;
/* Update the CRCs */
« no previous file with comments | « cgpt/cmd_show.c ('k') | firmware/lib/cgptlib/cgptlib_internal.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698