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

Unified Diff: firmware/lib/vboot_common.c

Issue 6719005: Cherry-pick vboot_reference files from TOT to support crossystem (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@0.11.257.B
Patch Set: 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/lib/tpm_lite/tlcl.c ('k') | firmware/lib/vboot_firmware.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_common.c
diff --git a/firmware/lib/vboot_common.c b/firmware/lib/vboot_common.c
index abba130bf6489494b35f2ae89a520c874ff76c1b..edc6e163b88b84163e2f5a1d6e446765f1898845 100644
--- a/firmware/lib/vboot_common.c
+++ b/firmware/lib/vboot_common.c
@@ -381,6 +381,10 @@ int VerifyKernelPreamble(const VbKernelPreambleHeader* preamble,
int VbSharedDataInit(VbSharedDataHeader* header, uint64_t size) {
+
+ VBDEBUG(("VbSharedDataInit, %d bytes, header %d bytes\n", (int)size,
+ sizeof(VbSharedDataHeader)));
+
if (size < sizeof(VbSharedDataHeader)) {
VBDEBUG(("Not enough data for header.\n"));
return VBOOT_SHARED_DATA_INVALID;
@@ -397,10 +401,12 @@ int VbSharedDataInit(VbSharedDataHeader* header, uint64_t size) {
Memset(header, 0, sizeof(VbSharedDataHeader));
/* Initialize fields */
+ header->magic = VB_SHARED_DATA_MAGIC;
header->struct_version = VB_SHARED_DATA_VERSION;
header->struct_size = sizeof(VbSharedDataHeader);
header->data_size = size;
header->data_used = sizeof(VbSharedDataHeader);
+ header->firmware_index = 0xFF;
/* Success */
return VBOOT_SUCCESS;
@@ -410,6 +416,8 @@ int VbSharedDataInit(VbSharedDataHeader* header, uint64_t size) {
uint64_t VbSharedDataReserve(VbSharedDataHeader* header, uint64_t size) {
uint64_t offs = header->data_used;
+ VBDEBUG(("VbSharedDataReserve %d bytes at %d\n", (int)size, (int)offs));
+
if (!header || size > header->data_size - header->data_used) {
VBDEBUG(("VbSharedData buffer out of space.\n"));
return 0; /* Not initialized, or not enough space left. */
« no previous file with comments | « firmware/lib/tpm_lite/tlcl.c ('k') | firmware/lib/vboot_firmware.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698