diff options
author | Joel Kitching <kitching@google.com> | 2021-04-28 16:26:59 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-03 07:14:49 +0000 |
commit | 48622af657f1e4f05832301364bb2d65b0b55c19 (patch) | |
tree | d4c95ababb8480d584997c4b3027a65fd3110170 /tests | |
parent | ae68d58998b93a96c5b55a29b31fa9e3a36bc354 (diff) | |
download | vboot-48622af657f1e4f05832301364bb2d65b0b55c19.tar.gz |
vboot/vboot_kernel: store kparams pointer instead of copying data
Store kparams as a pointer in vboot_api_kernel.c, rather than a
full struct passed around as a "buffer copy".
This CL is part of a series to merge vboot1 and vboot2.0
kernel verification code; see b/181739551.
BUG=b:181739551
TEST=make clean && make runtests
BRANCH=none
Signed-off-by: Joel Kitching <kitching@google.com>
Change-Id: I7be7280761564c35e928bc947177b3fce61d6215
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2856360
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vboot_api_kernel_tests.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c index 9294fd7f..16933ea6 100644 --- a/tests/vboot_api_kernel_tests.c +++ b/tests/vboot_api_kernel_tests.c @@ -403,6 +403,7 @@ static uint32_t got_external_mismatch; static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] __attribute__((aligned(VB2_WORKBUF_ALIGN))); static struct vb2_context *ctx; +static struct VbSelectAndLoadKernelParams kparams; /** * Reset mock data (for use before each test) @@ -412,7 +413,9 @@ static void ResetMocks(int i) TEST_SUCC(vb2api_init(workbuf, sizeof(workbuf), &ctx), "vb2api_init failed"); - memset(VbApiKernelGetParams(), 0, sizeof(VbSelectAndLoadKernelParams)); + memset(&kparams, 0, sizeof(VbSelectAndLoadKernelParams)); + *VbApiKernelGetParamsPtr() = &kparams; + memset(&mock_disks, 0, sizeof(mock_disks)); load_kernel_calls = 0; |