summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-04-25 15:41:35 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-05-17 18:36:46 -0700
commit8a4f0bef0ec665a24ca3a01b2ee6915e2e392a18 (patch)
tree75688b45ec9fa1a988ee330fce05390691e6f5ad /firmware
parente7db36856ce418552637d1981c173d22dfe5bf39 (diff)
downloadvboot-8a4f0bef0ec665a24ca3a01b2ee6915e2e392a18.tar.gz
vboot: hide 2common.h from external API
2common.h contains code which should be internal to vboot. Most notably of which is 2struct.h, which contains the vb2_shared_data data structure. BUG=b:124141368, chromium:956474 TEST=make clean && make runtests BRANCH=none Cq-Depend: chromium:1587981, chromium:1599567, chromium:1610164 Change-Id: I712f51915bb9b0b03dce558e2b843eb83662f434 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1583819 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/include/2api.h1
-rw-r--r--firmware/2lib/include/2common.h17
-rw-r--r--firmware/2lib/include/2constants.h17
3 files changed, 17 insertions, 18 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_ */