summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/2lib/include/2api.h1
-rw-r--r--firmware/2lib/include/2common.h17
-rw-r--r--firmware/2lib/include/2constants.h17
-rw-r--r--futility/futility.h1
-rw-r--r--tests/vboot_api_devmode_tests.c2
-rw-r--r--tests/vboot_api_kernel_tests.c2
6 files changed, 20 insertions, 20 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 26417c59..eed7e126 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -21,7 +21,6 @@
#define VBOOT_2_API_H_
#include <stdint.h>
-#include "2common.h"
#include "2constants.h"
#include "2crypto.h"
#include "2fw_hash_tags.h"
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index 0a6dccd2..4b80e12c 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -45,23 +45,6 @@ struct vb2_public_key;
#endif
#endif
-/*
- * Alignment for work buffer pointers/allocations should be useful for any
- * data type. When declaring workbuf buffers on the stack, the caller should
- * use explicit alignment to avoid run-time errors. For example:
- *
- * int foo(void)
- * {
- * struct vb2_workbuf wb;
- * uint8_t buf[NUM] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
- * wb.buf = buf;
- * 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__
-
/**
* Round up a number to a multiple of VB2_WORKBUF_ALIGN
*
diff --git a/firmware/2lib/include/2constants.h b/firmware/2lib/include/2constants.h
index aa9e99e2..81d1cc56 100644
--- a/firmware/2lib/include/2constants.h
+++ b/firmware/2lib/include/2constants.h
@@ -47,4 +47,21 @@
/* Recommended buffer size for vb2api_get_pcr_digest. */
#define VB2_PCR_DIGEST_RECOMMENDED_SIZE 32
+/*
+ * Alignment for work buffer pointers/allocations should be useful for any
+ * data type. When declaring workbuf buffers on the stack, the caller should
+ * use explicit alignment to avoid run-time errors. For example:
+ *
+ * int foo(void)
+ * {
+ * struct vb2_workbuf wb;
+ * uint8_t buf[NUM] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
+ * wb.buf = buf;
+ * 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__
+
#endif /* VBOOT_REFERENCE_2CONSTANTS_H_ */
diff --git a/futility/futility.h b/futility/futility.h
index af5e0f76..9a1ac6dc 100644
--- a/futility/futility.h
+++ b/futility/futility.h
@@ -7,6 +7,7 @@
#define VBOOT_REFERENCE_FUTILITY_H_
#include <stdint.h>
+#include "2common.h"
#include "vboot_common.h"
#include "gbb_header.h"
#include "host_key.h"
diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
index 9d20e322..286972c2 100644
--- a/tests/vboot_api_devmode_tests.c
+++ b/tests/vboot_api_devmode_tests.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include "2sysincludes.h"
-#include "2api.h"
+#include "2common.h"
#include "2misc.h"
#include "2nvstorage.h"
#include "crc32.h"
diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c
index 1bc2c9aa..92f6dcc9 100644
--- a/tests/vboot_api_kernel_tests.c
+++ b/tests/vboot_api_kernel_tests.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include "2sysincludes.h"
-#include "2api.h"
+#include "2common.h"
#include "2nvstorage.h"
#include "gbb_header.h"
#include "load_kernel_fw.h"