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

Unified Diff: cgpt/cgpt_common.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 | « no previous file | cgpt/cmd_add.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cgpt/cgpt_common.c
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c
index f165f7a73d37a2a602da8b6d088f3d6f21e6ca8a..8e8196b4df2a97f3373b0d1860b855cfed9927d2 100644
--- a/cgpt/cgpt_common.c
+++ b/cgpt/cgpt_common.c
@@ -522,15 +522,15 @@ void SetPriority(GptData *gpt, int secondary, int entry_index, int priority) {
entry = GetEntry(gpt, secondary, entry_index);
assert(priority >= 0 && priority <= CGPT_ATTRIBUTE_MAX_PRIORITY);
- entry->attributes &= ~CGPT_ATTRIBUTE_PRIORITY_MASK;
- entry->attributes |= (uint64_t)priority << CGPT_ATTRIBUTE_PRIORITY_OFFSET;
+ entry->attrs.fields.gpt_att &= ~CGPT_ATTRIBUTE_PRIORITY_MASK;
+ entry->attrs.fields.gpt_att |= priority << CGPT_ATTRIBUTE_PRIORITY_OFFSET;
}
int GetPriority(GptData *gpt, int secondary, int entry_index) {
GptEntry *entry;
entry = GetEntry(gpt, secondary, entry_index);
- return (entry->attributes & CGPT_ATTRIBUTE_PRIORITY_MASK) >>
- CGPT_ATTRIBUTE_PRIORITY_OFFSET;
+ return (entry->attrs.fields.gpt_att & CGPT_ATTRIBUTE_PRIORITY_MASK) >>
+ CGPT_ATTRIBUTE_PRIORITY_OFFSET;
}
void SetTries(GptData *gpt, int secondary, int entry_index, int tries) {
@@ -538,15 +538,15 @@ void SetTries(GptData *gpt, int secondary, int entry_index, int tries) {
entry = GetEntry(gpt, secondary, entry_index);
assert(tries >= 0 && tries <= CGPT_ATTRIBUTE_MAX_TRIES);
- entry->attributes &= ~CGPT_ATTRIBUTE_TRIES_MASK;
- entry->attributes |= (uint64_t)tries << CGPT_ATTRIBUTE_TRIES_OFFSET;
+ entry->attrs.fields.gpt_att &= ~CGPT_ATTRIBUTE_TRIES_MASK;
+ entry->attrs.fields.gpt_att |= tries << CGPT_ATTRIBUTE_TRIES_OFFSET;
}
int GetTries(GptData *gpt, int secondary, int entry_index) {
GptEntry *entry;
entry = GetEntry(gpt, secondary, entry_index);
- return (entry->attributes & CGPT_ATTRIBUTE_TRIES_MASK) >>
- CGPT_ATTRIBUTE_TRIES_OFFSET;
+ return (entry->attrs.fields.gpt_att & CGPT_ATTRIBUTE_TRIES_MASK) >>
+ CGPT_ATTRIBUTE_TRIES_OFFSET;
}
void SetSuccessful(GptData *gpt, int secondary, int entry_index, int success) {
@@ -554,14 +554,14 @@ void SetSuccessful(GptData *gpt, int secondary, int entry_index, int success) {
entry = GetEntry(gpt, secondary, entry_index);
assert(success >= 0 && success <= CGPT_ATTRIBUTE_MAX_SUCCESSFUL);
- entry->attributes &= ~CGPT_ATTRIBUTE_SUCCESSFUL_MASK;
- entry->attributes |= (uint64_t)success << CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
+ entry->attrs.fields.gpt_att &= ~CGPT_ATTRIBUTE_SUCCESSFUL_MASK;
+ entry->attrs.fields.gpt_att |= success << CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
}
int GetSuccessful(GptData *gpt, int secondary, int entry_index) {
GptEntry *entry;
entry = GetEntry(gpt, secondary, entry_index);
- return (entry->attributes & CGPT_ATTRIBUTE_SUCCESSFUL_MASK) >>
+ return (entry->attrs.fields.gpt_att & CGPT_ATTRIBUTE_SUCCESSFUL_MASK) >>
CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
}
« no previous file with comments | « no previous file | cgpt/cmd_add.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698