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

Unified Diff: src/platform/vboot_reference/cgptlib/cgpt.c

Issue 1547038: cgptlib stub for verified boot development. (Closed)
Patch Set: coding-style fix Created 10 years, 8 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 | « src/platform/vboot_reference/cgptlib/cgpt.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/cgptlib/cgpt.c
diff --git a/src/platform/vboot_reference/cgptlib/cgpt.c b/src/platform/vboot_reference/cgptlib/cgpt.c
new file mode 100644
index 0000000000000000000000000000000000000000..7f18a1cf8d45b6bc2a925592acdf1a5f7a04e69d
--- /dev/null
+++ b/src/platform/vboot_reference/cgptlib/cgpt.c
@@ -0,0 +1,27 @@
+/* Copyright (c) 2010 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.
+ */
+
+#include "cgpt.h"
+
+/* stub code */
+static int start[] = { 34, 10034 };
+
+int GPTInit(GPTData_t *gpt) {
+ gpt->current_kernel = 1;
+ return 0;
+}
+
+int GPTNextKernelEntry(GPTData_t *gpt, uint64_t *start_sector, uint64_t *size) {
+ gpt->current_kernel ^= 1;
+ if (start_sector) *start_sector = start[gpt->current_kernel];
+ if (size) *size = 10000;
+ return 0;
+}
+
+int GPTUpdateKernelEntry(GPTData_t *gpt, uint32_t update_type) {
+ gpt->modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_ENTRIES1) <<
+ gpt->current_kernel;
+ return 0;
+}
« no previous file with comments | « src/platform/vboot_reference/cgptlib/cgpt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698