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

Unified Diff: firmware/lib/cgptlib/cgptlib_internal.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 | « firmware/lib/cgptlib/cgptlib.c ('k') | firmware/lib/cgptlib/include/cgptlib_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/cgptlib/cgptlib_internal.c
diff --git a/firmware/lib/cgptlib/cgptlib_internal.c b/firmware/lib/cgptlib/cgptlib_internal.c
index 7faf3832a32e8701e7010fc0dd46ddece1c3c83e..85b4906182392189e1c7b192112188f9f54fd424 100644
--- a/firmware/lib/cgptlib/cgptlib_internal.c
+++ b/firmware/lib/cgptlib/cgptlib_internal.c
@@ -309,40 +309,40 @@ void GptRepair(GptData *gpt) {
int GetEntrySuccessful(const GptEntry* e) {
- return (e->attributes & CGPT_ATTRIBUTE_SUCCESSFUL_MASK) >>
- CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
+ return (e->attrs.fields.gpt_att & CGPT_ATTRIBUTE_SUCCESSFUL_MASK) >>
+ CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
}
int GetEntryPriority(const GptEntry* e) {
- return (e->attributes & CGPT_ATTRIBUTE_PRIORITY_MASK) >>
- CGPT_ATTRIBUTE_PRIORITY_OFFSET;
+ return (e->attrs.fields.gpt_att & CGPT_ATTRIBUTE_PRIORITY_MASK) >>
+ CGPT_ATTRIBUTE_PRIORITY_OFFSET;
}
int GetEntryTries(const GptEntry* e) {
- return (e->attributes & CGPT_ATTRIBUTE_TRIES_MASK) >>
- CGPT_ATTRIBUTE_TRIES_OFFSET;
+ return (e->attrs.fields.gpt_att & CGPT_ATTRIBUTE_TRIES_MASK) >>
+ CGPT_ATTRIBUTE_TRIES_OFFSET;
}
void SetEntrySuccessful(GptEntry* e, int successful) {
if (successful)
- e->attributes |= CGPT_ATTRIBUTE_SUCCESSFUL_MASK;
+ e->attrs.fields.gpt_att |= CGPT_ATTRIBUTE_SUCCESSFUL_MASK;
else
- e->attributes &= ~CGPT_ATTRIBUTE_SUCCESSFUL_MASK;
+ e->attrs.fields.gpt_att &= ~CGPT_ATTRIBUTE_SUCCESSFUL_MASK;
}
void SetEntryPriority(GptEntry* e, int priority) {
- e->attributes &= ~CGPT_ATTRIBUTE_PRIORITY_MASK;
- e->attributes |= ((uint64_t)priority << CGPT_ATTRIBUTE_PRIORITY_OFFSET) &
+ e->attrs.fields.gpt_att &= ~CGPT_ATTRIBUTE_PRIORITY_MASK;
+ e->attrs.fields.gpt_att |= (priority << CGPT_ATTRIBUTE_PRIORITY_OFFSET) &
CGPT_ATTRIBUTE_PRIORITY_MASK;
}
void SetEntryTries(GptEntry* e, int tries) {
- e->attributes &= ~CGPT_ATTRIBUTE_TRIES_MASK;
- e->attributes |= ((uint64_t)tries << CGPT_ATTRIBUTE_TRIES_OFFSET) &
+ e->attrs.fields.gpt_att &= ~CGPT_ATTRIBUTE_TRIES_MASK;
+ e->attrs.fields.gpt_att |= (tries << CGPT_ATTRIBUTE_TRIES_OFFSET) &
CGPT_ATTRIBUTE_TRIES_MASK;
}
« no previous file with comments | « firmware/lib/cgptlib/cgptlib.c ('k') | firmware/lib/cgptlib/include/cgptlib_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698