Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1448)

Unified Diff: firmware/include/vboot_struct.h

Issue 6626045: Pass VbSharedData between LoadFirmware() and LoadKernel() (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Fixes from code review. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/include/vboot_nvstorage.h ('k') | firmware/lib/include/vboot_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/include/vboot_struct.h
diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h
index ed83f3e7e5f73445cf917d2d4b1d5f09e20e8c6e..1e988ee180ff8ea2ca473f68b37ed22c6c759231 100644
--- a/firmware/include/vboot_struct.h
+++ b/firmware/include/vboot_struct.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
@@ -131,6 +131,49 @@ typedef struct VbKernelPreambleHeader {
#define EXPECTED_VBKERNELPREAMBLEHEADER_SIZE 96
+/* Minimum and recommended size of shared_data_blob in bytes. */
+#define VB_SHARED_DATA_MIN_SIZE 3072
+#define VB_SHARED_DATA_REC_SIZE 16384
+
+/* Data shared between LoadFirmware(), LoadKernel(), and OS.
+ *
+ * The boot process is:
+ * 1) Caller allocates buffer, at least VB_SHARED_DATA_MIN bytes, ideally
+ * VB_SHARED_DATA_REC_SIZE bytes.
+ * 2) If non-recovery boot, this is passed to LoadFirmware(), which
+ * initializes the buffer, adding this header and some data.
+ * 3) Buffer is passed to LoadKernel(). If this is a recovery boot,
+ * LoadKernel() initializes the buffer, adding this header. Regardless
+ * of boot type, LoadKernel() adds some data to the buffer.
+ * 4) Caller makes data available to the OS in a platform-dependent manner.
+ * For example, via ACPI or ATAGs. */
+typedef struct VbSharedDataHeader {
+ /* Fields present in version 1 */
+ uint32_t struct_version; /* Version of this structure */
+ uint64_t struct_size; /* Size of this structure in bytes */
+ uint64_t data_size; /* Size of shared data buffer in bytes */
+ uint64_t data_used; /* Amount of shared data used so far */
+
+ VbPublicKey kernel_subkey; /* Kernel subkey, from firmware */
+ uint64_t kernel_subkey_data_offset; /* Offset of kernel subkey data from
+ * start of this struct */
+ uint64_t kernel_subkey_data_size; /* Offset of kernel subkey data */
+
+ uint64_t flags; /* Flags */
+
+ /* After read-only firmware which uses version 1 is released, any additional
+ * fields must be added below, and the struct version must be increased.
+ * Before reading/writing those fields, make sure that the struct being
+ * accessed is at least version 2.
+ *
+ * It's always ok for an older firmware to access a newer struct, since all
+ * the fields it knows about are present. Newer firmware needs to use
+ * reasonable defaults when accessing older structs. */
+
+} __attribute__((packed)) VbSharedDataHeader;
+
+#define VB_SHARED_DATA_VERSION 1 /* Version for struct_version */
+
__pragma(pack(pop)) /* Support packing for MSVC. */
#endif /* VBOOT_REFERENCE_VBOOT_STRUCT_H_ */
« no previous file with comments | « firmware/include/vboot_nvstorage.h ('k') | firmware/lib/include/vboot_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698