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); |
+} |