OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * Functions for loading a kernel from disk. | 5 * Functions for loading a kernel from disk. |
6 * (Firmware portion) | 6 * (Firmware portion) |
7 */ | 7 */ |
8 | 8 |
9 #include "vboot_kernel.h" | 9 #include "vboot_kernel.h" |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return 1; | 99 return 1; |
100 } | 100 } |
101 Free(gptdata->secondary_header); | 101 Free(gptdata->secondary_header); |
102 } | 102 } |
103 | 103 |
104 /* Success */ | 104 /* Success */ |
105 return 0; | 105 return 0; |
106 } | 106 } |
107 | 107 |
108 | 108 |
109 int LoadKernel2(LoadKernelParams* params) { | 109 int LoadKernel(LoadKernelParams* params) { |
110 | 110 |
111 VbPublicKey* kernel_subkey = (VbPublicKey*)params->header_sign_key_blob; | 111 VbPublicKey* kernel_subkey = (VbPublicKey*)params->header_sign_key_blob; |
112 | 112 |
113 GptData gpt; | 113 GptData gpt; |
114 uint64_t part_start, part_size; | 114 uint64_t part_start, part_size; |
115 uint64_t blba = params->bytes_per_lba; | 115 uint64_t blba = params->bytes_per_lba; |
116 uint64_t kbuf_sectors = KBUF_SIZE / blba; | 116 uint64_t kbuf_sectors = KBUF_SIZE / blba; |
117 uint8_t* kbuf = NULL; | 117 uint8_t* kbuf = NULL; |
118 int found_partitions = 0; | 118 int found_partitions = 0; |
119 int good_partition = -1; | 119 int good_partition = -1; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 /* Success! */ | 371 /* Success! */ |
372 return LOAD_KERNEL_SUCCESS; | 372 return LOAD_KERNEL_SUCCESS; |
373 } | 373 } |
374 | 374 |
375 // Handle error cases | 375 // Handle error cases |
376 if (found_partitions) | 376 if (found_partitions) |
377 return LOAD_KERNEL_INVALID; | 377 return LOAD_KERNEL_INVALID; |
378 else | 378 else |
379 return LOAD_KERNEL_NOT_FOUND; | 379 return LOAD_KERNEL_NOT_FOUND; |
380 } | 380 } |
OLD | NEW |