summaryrefslogtreecommitdiff
path: root/util/nvramtool/accessors
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2017-01-26 23:22:46 +0100
committerNico Huber <nico.h@gmx.de>2017-06-06 19:31:38 +0200
commit3af69850507e6e6afac7c0de689bbd8545a6085a (patch)
tree9af795830d31439b41f0f916831378528fb15c4c /util/nvramtool/accessors
parent00b9f4c4b1cd95a6cafe2b1e66641ff0f113082e (diff)
util/nvramtool: Bail out on unaligned multi-byte entries
coreboot doesn't support CMOS options that are not byte aligned but span multiple bytes. So treat them as error. Change-Id: I2bcff62f153932e9c6646b4ce08e8da1c1532947 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/18246 Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'util/nvramtool/accessors')
-rw-r--r--util/nvramtool/accessors/layout-bin.c6
-rw-r--r--util/nvramtool/accessors/layout-text.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/util/nvramtool/accessors/layout-bin.c b/util/nvramtool/accessors/layout-bin.c
index 34507c9af2..9f92283480 100644
--- a/util/nvramtool/accessors/layout-bin.c
+++ b/util/nvramtool/accessors/layout-bin.c
@@ -481,6 +481,12 @@ static void try_add_cmos_table_entry(cmos_entry_t * cmos_entry)
*/
return;
+ case LAYOUT_MULTIBYTE_ENTRY_NOT_ALIGNED:
+ fprintf(stderr,
+ "%s: Unaligned CMOS option table entry %s "
+ "spans multiple bytes.\n", prog_name, cmos_entry->name);
+ break;
+
default:
BUG();
}
diff --git a/util/nvramtool/accessors/layout-text.c b/util/nvramtool/accessors/layout-text.c
index bea3b3e9ec..f2735b9e35 100644
--- a/util/nvramtool/accessors/layout-text.c
+++ b/util/nvramtool/accessors/layout-text.c
@@ -695,6 +695,12 @@ static void try_add_layout_file_entry(const cmos_entry_t * cmos_entry)
*/
return;
+ case LAYOUT_MULTIBYTE_ENTRY_NOT_ALIGNED:
+ fprintf(stderr,
+ "%s: Unaligned CMOS option table entry %s "
+ "spans multiple bytes.\n", prog_name, cmos_entry->name);
+ break;
+
default:
BUG();
}