summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2012-07-18 02:55:43 -0700
committerGerrit <chrome-bot@google.com>2012-07-19 18:45:16 -0700
commitb1aa7aea2dd2b956dc6d04c430bda29d4d15679f (patch)
treebb479ca1778bd862dc4d34ee698647b5bb32ef8f
parent0c66fee70419aeda3b35731cd0910c3ac7a71ae2 (diff)
downloadvboot-b1aa7aea2dd2b956dc6d04c430bda29d4d15679f.tar.gz
Change VbExEcGetExpectedRW so that vboot picks an ec image instead of U-Boot.
This changes the signature of the function above so that it takes an additional parameter that specifies which EC image vboot wants. This is better than making U-Boot decide because U-Boot doesn't really keep track of which version it is (it peeks at internal vboot data) and vboot does. Also, some consts were removed from the image pointer pointer. The pointer itself will be changed in the body of the function to tell vboot where the EC has been loaded, and the contents of the buffer will be changed because U-Boot will have to actually load the EC there. BUG=chrome-os-partner:11148 TEST=Built vboot_reference, vboot_reference-firmware, chromeos-u-boot, and chromeos-bootimage for Daisy and Link and saw them complete successfully with and without the signature for U-Boot's version of this function being updated. That works because the function isn't actually being used yet. Change-Id: I2814c8210eb5b3d965bb8bbf23c0f283f9e44c90 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/27755 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
-rw-r--r--firmware/include/vboot_api.h6
-rw-r--r--firmware/stub/vboot_api_stub.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 4b37a07b..3f0a7faf 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -636,8 +636,10 @@ VbError_t VbExEcStayInRO(void);
/* Read the SHA-256 hash of the rewriteable EC image. */
VbError_t VbExEcHashRW(const uint8_t **hash, int *hash_size);
-/* Get the expected contents of the EC image as stored in the main firmware. */
-VbError_t VbExEcGetExpectedRW(const uint8_t **image, int *image_size);
+/* Get the expected contents of the EC image associated with the main firmware
+ * specified by the "select" argument. */
+VbError_t VbExEcGetExpectedRW(enum VbSelectFirmware_t select, uint8_t **image,
+ int *image_size);
/* Update the EC rewritable image. */
VbError_t VbExEcUpdateRW(const uint8_t *image, int image_size);
diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c
index 6452e97d..f41d8d95 100644
--- a/firmware/stub/vboot_api_stub.c
+++ b/firmware/stub/vboot_api_stub.c
@@ -173,8 +173,9 @@ VbError_t VbExEcHashRW(const uint8_t **hash, int *hash_size) {
return VBERROR_SUCCESS;
}
-VbError_t VbExEcGetExpectedRW(const uint8_t **image, int *image_size) {
- static const uint8_t fake_image[64] = {5, 6, 7, 8};
+VbError_t VbExEcGetExpectedRW(enum VbSelectFirmware_t select, uint8_t **image,
+ int *image_size) {
+ static uint8_t fake_image[64] = {5, 6, 7, 8};
*image = fake_image;
*image_size = sizeof(fake_image);
return VBERROR_SUCCESS;