summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-03-06 18:41:33 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-11 23:52:13 -0700
commit6988559fb77e99a6ac2fc420cf83922ea162081e (patch)
tree72335cef7c2c4026a9e67a3d06ea50774f2b01fe /tests
parent9e53b92e50165b777111f159daa2b4e3b3c8b355 (diff)
downloadvboot-6988559fb77e99a6ac2fc420cf83922ea162081e.tar.gz
vboot: move general constants to a separate header
coreboot uses the C preprocessor on its linker scripts to allow evaluation of macros when defining memory layout. Move constants from 2api.h to an independent file in order to allow for coreboot to use these constants in its memlayout file, without needing to include the entire vboot API. Note this commit creates two new header files: - firmware/2lib/include/2constants.h: contains the constants - firmware/include/vb2_constants.h: externally importable header Also, rename VB2_WORKBUF_RECOMMENDED_SIZE to VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE for clarity. BUG=b:124141368, b:124192753 TEST=Build locally TEST=/work/vboot/src/repohooks/pre-upload.py TEST=make clean && make runtests TEST=make clean && COV=1 make coverage && make coverage_html BRANCH=none Change-Id: Id17c6955b67e51cb048b10b4be0901c0e9110a1f Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1504490 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/vb20_api_tests.c2
-rw-r--r--tests/vb20_misc_tests.c2
-rw-r--r--tests/vb21_api_tests.c2
-rw-r--r--tests/vb21_misc_tests.c2
-rw-r--r--tests/vb2_api_tests.c2
-rw-r--r--tests/vb2_misc_tests.c2
-rw-r--r--tests/vb2_nvstorage_tests.c2
-rw-r--r--tests/vb2_secdata_tests.c2
-rw-r--r--tests/vb2_secdatak_tests.c2
9 files changed, 9 insertions, 9 deletions
diff --git a/tests/vb20_api_tests.c b/tests/vb20_api_tests.c
index e9dff9fe..3a5d4968 100644
--- a/tests/vb20_api_tests.c
+++ b/tests/vb20_api_tests.c
@@ -17,7 +17,7 @@
#include "test_common.h"
/* Common context for tests */
-static uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
static struct vb2_context cc;
static struct vb2_shared_data *sd;
diff --git a/tests/vb20_misc_tests.c b/tests/vb20_misc_tests.c
index 9442aa0a..995e0fc6 100644
--- a/tests/vb20_misc_tests.c
+++ b/tests/vb20_misc_tests.c
@@ -18,7 +18,7 @@
#include "test_common.h"
/* Common context for tests */
-static uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
static struct vb2_context cc;
static struct vb2_shared_data *sd;
diff --git a/tests/vb21_api_tests.c b/tests/vb21_api_tests.c
index e9eab10d..89e683b0 100644
--- a/tests/vb21_api_tests.c
+++ b/tests/vb21_api_tests.c
@@ -23,7 +23,7 @@
#include "test_common.h"
/* Common context for tests */
-static uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
static struct vb2_context ctx;
static struct vb2_shared_data *sd;
diff --git a/tests/vb21_misc_tests.c b/tests/vb21_misc_tests.c
index 8bf2a6e8..c33432d9 100644
--- a/tests/vb21_misc_tests.c
+++ b/tests/vb21_misc_tests.c
@@ -19,7 +19,7 @@
#include "test_common.h"
/* Common context for tests */
-static uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
static struct vb2_context ctx;
static struct vb2_shared_data *sd;
diff --git a/tests/vb2_api_tests.c b/tests/vb2_api_tests.c
index 88dfa967..64995591 100644
--- a/tests/vb2_api_tests.c
+++ b/tests/vb2_api_tests.c
@@ -17,7 +17,7 @@
#include "test_common.h"
/* Common context for tests */
-static uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
static struct vb2_context cc;
static struct vb2_shared_data *sd;
diff --git a/tests/vb2_misc_tests.c b/tests/vb2_misc_tests.c
index fddd49df..1bb9686f 100644
--- a/tests/vb2_misc_tests.c
+++ b/tests/vb2_misc_tests.c
@@ -15,7 +15,7 @@
#include "test_common.h"
/* Common context for tests */
-static uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
static struct vb2_context cc;
static struct vb2_shared_data *sd;
diff --git a/tests/vb2_nvstorage_tests.c b/tests/vb2_nvstorage_tests.c
index 9d1b1bb0..fe73216a 100644
--- a/tests/vb2_nvstorage_tests.c
+++ b/tests/vb2_nvstorage_tests.c
@@ -86,7 +86,7 @@ static void nv_storage_test(uint32_t ctxflags)
{
struct nv_field *vnf;
uint8_t goodcrc;
- uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+ uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
struct vb2_context c = {
.flags = ctxflags,
diff --git a/tests/vb2_secdata_tests.c b/tests/vb2_secdata_tests.c
index 1abfcb2e..823efab5 100644
--- a/tests/vb2_secdata_tests.c
+++ b/tests/vb2_secdata_tests.c
@@ -32,7 +32,7 @@ static void test_changed(struct vb2_context *ctx, int changed, const char *why)
static void secdata_test(void)
{
- uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+ uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
struct vb2_context c = {
.flags = 0,
diff --git a/tests/vb2_secdatak_tests.c b/tests/vb2_secdatak_tests.c
index 4bc15cf9..c0207a3a 100644
--- a/tests/vb2_secdatak_tests.c
+++ b/tests/vb2_secdatak_tests.c
@@ -33,7 +33,7 @@ static void test_changed(struct vb2_context *ctx, int changed, const char *why)
static void secdatak_test(void)
{
- uint8_t workbuf[VB2_WORKBUF_RECOMMENDED_SIZE]
+ uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
struct vb2_context c = {
.flags = 0,