diff options
author | Duncan Laurie <dlaurie@google.com> | 2019-05-22 17:25:18 -0700 |
---|---|---|
committer | Duncan Laurie <dlaurie@google.com> | 2019-05-23 00:38:05 +0000 |
commit | c610ddcd08ab3664c3889f168f24e20298c5f44d (patch) | |
tree | f5ae664135500b8d3402885e5b4ec763380940a5 | |
parent | 7b19d50b5aa11defc45d485b89c745ebab4361ab (diff) | |
download | vboot-c610ddcd08ab3664c3889f168f24e20298c5f44d.tar.gz |
Revert "vboot: hide 2common.h from external API"
This reverts commit 40ec89fc5bc23d8d340b0f55b931459953b35e55.
BUG=none
TEST=none
Change-Id: Ib42bbc112be42dc7a9729219237e6374988a4db8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1626766
Reviewed-by: Duncan Laurie <dlaurie@google.com>
Commit-Queue: Duncan Laurie <dlaurie@google.com>
Tested-by: Duncan Laurie <dlaurie@google.com>
-rw-r--r-- | firmware/2lib/include/2api.h | 1 | ||||
-rw-r--r-- | firmware/2lib/include/2common.h | 17 | ||||
-rw-r--r-- | firmware/2lib/include/2constants.h | 17 | ||||
-rw-r--r-- | futility/futility.h | 1 | ||||
-rw-r--r-- | tests/vboot_api_devmode_tests.c | 2 | ||||
-rw-r--r-- | tests/vboot_api_kernel_tests.c | 2 |
6 files changed, 20 insertions, 20 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index eed7e126..26417c59 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -21,6 +21,7 @@ #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 4b80e12c..0a6dccd2 100644 --- a/firmware/2lib/include/2common.h +++ b/firmware/2lib/include/2common.h @@ -45,6 +45,23 @@ 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 81d1cc56..aa9e99e2 100644 --- a/firmware/2lib/include/2constants.h +++ b/firmware/2lib/include/2constants.h @@ -47,21 +47,4 @@ /* 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 9a1ac6dc..af5e0f76 100644 --- a/futility/futility.h +++ b/futility/futility.h @@ -7,7 +7,6 @@ #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 286972c2..9d20e322 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 "2common.h" +#include "2api.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 92f6dcc9..1bc2c9aa 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 "2common.h" +#include "2api.h" #include "2nvstorage.h" #include "gbb_header.h" #include "load_kernel_fw.h" |