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

Unified Diff: lib/chromeos/load_util.c

Issue 6628009: Add a wrapper function of LoadKernel() (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/u-boot-next.git@chromeos-v2010.09
Patch Set: Fix return value Created 9 years, 10 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 | « lib/chromeos/Makefile ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/chromeos/load_util.c
diff --git a/lib/chromeos/load_util.c b/lib/chromeos/load_util.c
new file mode 100644
index 0000000000000000000000000000000000000000..a0bc5c9a97ec9a1b5cac90c57333dc770c598ebb
--- /dev/null
+++ b/lib/chromeos/load_util.c
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#include <common.h>
+#include <chromeos/load_util.h>
+
+#define PREFIX "load_kernel: "
+
+int load_kernel(LoadKernelParams *params, uint8_t *kernel_sign_key_blob,
sjg 2011/03/06 21:34:09 It's not great having load_kernel() and LoadKernel
Che-Liang Chiou 2011/03/07 05:06:52 I think you are right. I was thinking that this fu
+ void *kernel_buffer, uint64_t kernel_buffer_size,
sjg 2011/03/06 21:34:09 Why void* rather than char*? If an address perhaps
Che-Liang Chiou 2011/03/07 05:06:52 I am not sure if I am making the right choice here
+ uint64_t boot_flags)
+{
+ block_dev_desc_t *dev_desc;
+
+ dev_desc = get_bootdev();
+ if (!dev_desc) {
+ debug(PREFIX "get_bootdev fail\n");
+ return LOAD_KERNEL_NOT_FOUND;
+ }
+
+ params->header_sign_key_blob = kernel_sign_key_blob;
+
+ params->bytes_per_lba = (uint64_t) dev_desc->blksz;
+ params->ending_lba = (uint64_t) get_limit() - 1;
+
+ params->kernel_buffer = kernel_buffer;
+ params->kernel_buffer_size = kernel_buffer_size;
+
+ params->boot_flags = boot_flags;
+
+ return LoadKernel(params);
+}
« no previous file with comments | « lib/chromeos/Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698