summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-11-12 21:47:27 +0800
committerCommit Bot <commit-bot@chromium.org>2019-11-25 13:38:20 +0000
commitc7d266e0d6e66a23adfd7681efa39e08f6ccf51b (patch)
tree27f9e3fe8ccd7f976d9a4e638dc5968222739746 /firmware
parent30481361d88718fa6eead75508c552cc70c728dc (diff)
downloadvboot-c7d266e0d6e66a23adfd7681efa39e08f6ccf51b.tar.gz
vboot: workbuf alignment should always use 8
Rather than depending on the architecture and environment to provide the correct memory alignment (__BIGGEST_ALIGNMENT__), hardcode to 8, which should be sufficient for all cases. (Previously, by using __BIGGEST_ALIGNMENT__, this is set to 16 in all known cases, which is unnecessarily large.) Update vb2_workbuf tests to be more flexible according to VB2_WORKBUF_ALIGN value. BUG=b:124141368 TEST=make clean && make runtests TEST=Try values of VB2_WORKBUF_ALIGN=2,4,8,16,32,64 BRANCH=none Change-Id: I819586119fa3102fa423a01e0737e6864c05d752 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1911921 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/include/2constants.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/2lib/include/2constants.h b/firmware/2lib/include/2constants.h
index 8560d0de..b2abd4ab 100644
--- a/firmware/2lib/include/2constants.h
+++ b/firmware/2lib/include/2constants.h
@@ -66,9 +66,9 @@
* wb.size = sizeof(buf);
*/
-/* We might get away with using __alignof__(void *), but since GCC defines a
- * macro for us we'll be safe and use that. */
-#define VB2_WORKBUF_ALIGN __BIGGEST_ALIGNMENT__
+/* We want consistent alignment across all architectures.
+ 8-byte should work for all of them. */
+#define VB2_WORKBUF_ALIGN 8
/* Maximum length of a HWID in bytes, counting terminating null. */
#define VB2_GBB_HWID_MAX_SIZE 256