aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/chromeos.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2014-09-12 09:59:46 -0700
committerAaron Durbin <adurbin@google.com>2015-03-24 14:48:22 +0100
commit1bbac3fd248ad7c91511d12c74b61c239ba3aa9f (patch)
treec303d7309e703b9ee869dc255b09ade120690ee9 /src/vendorcode/google/chromeos/chromeos.h
parentefddcfbb52cd328ad2eb86d88cd306ac30294109 (diff)
vboot2: Make struct vb2_working_data cpu architecture agnostic
this allows vb2_working_data to be accessed from stages running on different cpu architectures. BUG=none TEST=Built firmware for Blaze with USE=+/-vboot2. Ran faft on Blaze. BRANCH=none Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Original-Change-Id: Ife2844637af8bf9e0d032a50fb516d98b8f80497 Original-Reviewed-on: https://chromium-review.googlesource.com/217835 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Original-Tested-by: Daisuke Nojiri <dnojiri@chromium.org> (cherry picked from commit 2b36749bc5a761003f00b7a0d17edb1629245b88) Change-Id: Idc10f23ed2927717f5308f0112aa8113a683010e Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8882 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/vendorcode/google/chromeos/chromeos.h')
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index 14e0b10d18..0d8da8feaf 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -130,20 +130,42 @@ void vboot_reboot(void);
/*
* this is placed at the start of the vboot work buffer. selected_region is used
* for the verstage to return the location of the selected slot. buffer is used
- * by the vboot2 core.
- *
- * TODO: Make the sizes of the struct and its members independent of cpu
- * architectures as it crosses stage boundaries.
+ * by the vboot2 core. Keep the struct cpu architecture agnostic as it crosses
+ * stage boundaries.
*/
struct vb2_working_data {
- struct vboot_region selected_region;
- size_t buffer_size;
- uint8_t *buffer;
+ uint32_t selected_region_offset;
+ uint32_t selected_region_size;
+ uint64_t buffer_size;
+ uint64_t buffer;
};
struct vb2_working_data * const vboot_get_working_data(void);
-int vboot_is_slot_selected(struct vb2_working_data *wd);
-int vboot_is_readonly_path(struct vb2_working_data *wd);
+
+static inline void vb2_get_selected_region(struct vb2_working_data *wd,
+ struct vboot_region *region)
+{
+ region->offset_addr = wd->selected_region_offset;
+ region->size = wd->selected_region_size;
+}
+
+static inline void vb2_set_selected_region(struct vb2_working_data *wd,
+ struct vboot_region *region)
+{
+ wd->selected_region_offset = region->offset_addr;
+ wd->selected_region_size = region->size;
+}
+
+static inline int vboot_is_slot_selected(struct vb2_working_data *wd)
+{
+ return wd->selected_region_size > 0;
+}
+
+static inline int vboot_is_readonly_path(struct vb2_working_data *wd)
+{
+ return wd->selected_region_size == 0;
+}
+
#endif /* CONFIG_VBOOT2_VERIFY_FIRMWARE */
#endif