summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2021-04-22 21:11:50 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-15 19:35:55 +0000
commitda50d8587ae24b1a5e7528dde1ead5523e78f6b2 (patch)
tree36f5fa76495c54d6421d8221b25146a86670f9ec /firmware
parent43fa783cbf6014d23d8b23b5eb7b4e63b17864ec (diff)
downloadvboot-da50d8587ae24b1a5e7528dde1ead5523e78f6b2.tar.gz
vboot/vboot_kernel: remove LoadKernelParams struct
LoadKernelParams struct is identical to VbSelectAndLoadKernelParams. Remove it, and use the public interface internally. 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: I8b820d18c1e9a66404a7a091aa3ccc1b050a559d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2846282 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/include/vboot_api.h7
-rw-r--r--firmware/lib/include/load_kernel_fw.h32
-rw-r--r--firmware/lib/include/vboot_test.h4
-rw-r--r--firmware/lib/vboot_api_kernel.c4
-rw-r--r--firmware/lib/vboot_kernel.c5
5 files changed, 9 insertions, 43 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 43752e4a..98cbd9bc 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -44,7 +44,6 @@ typedef struct VbSharedDataHeader VbSharedDataHeader;
*/
typedef void *VbExDiskHandle_t;
-/* Data used only by VbSelectAndLoadKernel() */
typedef struct VbSelectAndLoadKernelParams {
/* Inputs to VbSelectAndLoadKernel() */
/* Destination buffer for kernel (normally at 0x100000 on x86) */
@@ -68,12 +67,6 @@ typedef struct VbSelectAndLoadKernelParams {
uint8_t partition_guid[16];
/* Flags set by signer */
uint32_t flags;
- /*
- * TODO: in H2C, all that pretty much just gets passed to the
- * bootloader as KernelBootloaderOptions, though the disk handle is
- * passed as an index instead of a handle. Is that used anymore now
- * that we're passing partition_guid?
- */
} VbSelectAndLoadKernelParams;
/**
diff --git a/firmware/lib/include/load_kernel_fw.h b/firmware/lib/include/load_kernel_fw.h
index b4661c3a..96c8f864 100644
--- a/firmware/lib/include/load_kernel_fw.h
+++ b/firmware/lib/include/load_kernel_fw.h
@@ -11,35 +11,6 @@
#include "vboot_api.h"
-struct vb2_context;
-
-/* Interface provided by verified boot library to BDS */
-
-typedef struct LoadKernelParams {
- /* Inputs to LoadKernel() */
- /* Disk handle for current device */
- VbExDiskHandle_t disk_handle;
- /* Destination buffer for kernel (normally at 0x100000) */
- void *kernel_buffer;
- /* Size of kernel buffer in bytes */
- uint64_t kernel_buffer_size;
-
- /*
- * Outputs from LoadKernel(); valid only if LoadKernel() returns
- * LOAD_KERNEL_SUCCESS
- */
- /* Partition number to boot on current device (1...M) */
- uint32_t partition_number;
- /* Address of bootloader image in RAM */
- uint64_t bootloader_address;
- /* Size of bootloader image in bytes */
- uint32_t bootloader_size;
- /* UniquePartitionGuid for boot partition */
- uint8_t partition_guid[16];
- /* Flags passed in by signer */
- uint32_t flags;
-} LoadKernelParams;
-
/**
* Attempt to load the kernel from the current device.
*
@@ -48,7 +19,8 @@ typedef struct LoadKernelParams {
*
* Returns VB2_SUCCESS if successful. If unsuccessful, returns an error code.
*/
-vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params,
+vb2_error_t LoadKernel(struct vb2_context *ctx,
+ VbSelectAndLoadKernelParams *params,
VbDiskInfo *disk_info);
#endif /* VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ */
diff --git a/firmware/lib/include/vboot_test.h b/firmware/lib/include/vboot_test.h
index 3cfe6377..41e8e5d9 100644
--- a/firmware/lib/include/vboot_test.h
+++ b/firmware/lib/include/vboot_test.h
@@ -11,7 +11,7 @@
/****************************************************************************
* vboot_api_kernel.c */
-struct LoadKernelParams;
-struct LoadKernelParams *VbApiKernelGetParams(void);
+struct VbSelectAndLoadKernelParams;
+struct VbSelectAndLoadKernelParams *VbApiKernelGetParams(void);
#endif /* VBOOT_REFERENCE_TEST_API_H_ */
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index f1e191a1..541cd028 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -21,11 +21,11 @@
#include "vboot_test.h"
/* Global variables */
-static LoadKernelParams lkp;
+static VbSelectAndLoadKernelParams lkp;
#ifdef CHROMEOS_ENVIRONMENT
/* Global variable accessor for unit tests */
-struct LoadKernelParams *VbApiKernelGetParams(void)
+struct VbSelectAndLoadKernelParams *VbApiKernelGetParams(void)
{
return &lkp;
}
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 75b40c4e..05458b09 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -343,7 +343,7 @@ enum vb2_load_partition_flags {
*/
static vb2_error_t vb2_load_partition(
struct vb2_context *ctx, VbExStream_t stream, uint32_t flags,
- LoadKernelParams *params)
+ VbSelectAndLoadKernelParams *params)
{
uint32_t read_ms = 0, start_ts;
struct vb2_workbuf wb;
@@ -456,7 +456,8 @@ static vb2_error_t vb2_load_partition(
return VB2_SUCCESS;
}
-vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params,
+vb2_error_t LoadKernel(struct vb2_context *ctx,
+ VbSelectAndLoadKernelParams *params,
VbDiskInfo *disk_info)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);