diff options
author | vbendeb <vbendeb@chromium.org> | 2010-06-21 08:44:16 -0700 |
---|---|---|
committer | vbendeb <vbendeb@chromium.org> | 2010-06-21 08:44:16 -0700 |
commit | f7a45cc01d7e4056482b2cdc23080bfabbbffc76 (patch) | |
tree | 15e826191fb3359c621903be6dd5405c90199c04 /cgpt/cmd_add.c | |
parent | 6216f5abe9901e9c47789d55ae90243c6cc50aeb (diff) | |
download | vboot-f7a45cc01d7e4056482b2cdc23080bfabbbffc76.tar.gz |
Reduce attributes size to comply with msc limitations.
It turned out that shared verified boot library fails to
work properly when compiled by msc in BIOS environment.
The culprit was identified as failing 64 bit logical
operations by preprocessor. It is probably possible to
come up with a certain compile flag set to fix the
operations, but it is not easy to modify and control the BIOS
compilation environment.
The alternative solution is to limit the size of the field
in question to 16 bits (especially since this is the only
part of the attributes field which is supposed to be
altered by firmware.
A union is being introduced in firmware/lib/cgptlib/include/gpt.h:GptEntry to allow
accessing the field both as a 64 bit entity and a top
16 bit field. All places where this field is used are
being modified appropriately.
tests/Makefile is being fixed to allow controlling test run
from the top level directory.
Tested by building everything and running tests.
All tests pass.
Review URL: http://codereview.chromium.org/2799019
Diffstat (limited to 'cgpt/cmd_add.c')
-rw-r--r-- | cgpt/cmd_add.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cgpt/cmd_add.c b/cgpt/cmd_add.c index 18a0285e..12ae57c9 100644 --- a/cgpt/cmd_add.c +++ b/cgpt/cmd_add.c @@ -45,7 +45,7 @@ int cmd_add(int argc, char *argv[]) { int successful = 0; int tries = 0; int priority = 0; - uint64_t raw_value = 0; + uint16_t raw_value = 0; int set_begin = 0; int set_size = 0; int set_type = 0; @@ -249,7 +249,7 @@ int cmd_add(int argc, char *argv[]) { memcpy(entry->name, buf, sizeof(entry->name)); } if (set_raw) { - entry->attributes = raw_value; + entry->attrs.fields.gpt_att = raw_value; } else { if (set_successful) SetSuccessful(&drive.gpt, PRIMARY, index, successful); |