OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 * | 5 * |
6 * Alternatively, this software may be distributed under the terms of the | 6 * Alternatively, this software may be distributed under the terms of the |
7 * GNU General Public License ("GPL") version 2 as published by the Free | 7 * GNU General Public License ("GPL") version 2 as published by the Free |
8 * Software Foundation. | 8 * Software Foundation. |
9 */ | 9 */ |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 /* index = 0: firmware A; 1: firmware B; anything else: invalid */ | 38 /* index = 0: firmware A; 1: firmware B; anything else: invalid */ |
39 if (index != 0 && index != 1) { | 39 if (index != 0 && index != 1) { |
40 debug(PREFIX "incorrect index: %d\n", index); | 40 debug(PREFIX "incorrect index: %d\n", index); |
41 return 1; | 41 return 1; |
42 } | 42 } |
43 | 43 |
44 ci = (caller_internal_t *) params->caller_internal; | 44 ci = (caller_internal_t *) params->caller_internal; |
45 | 45 |
46 if (index == 0) { | 46 if (index == 0) { |
47 block = params->verification_block_0; | 47 block = params->verification_block_0; |
48 firmware_body = (uint8_t *) CONFIG_FIRMWARE_BODY_BUFFER_0; | |
Che-Liang Chiou
2011/03/01 08:45:22
Changes due to earlier code review comments. Remov
| |
49 } else { | 48 } else { |
50 block = params->verification_block_1; | 49 block = params->verification_block_1; |
51 firmware_body = (uint8_t *) CONFIG_FIRMWARE_BODY_BUFFER_1; | |
52 } | 50 } |
53 data_offset = ci->firmware_data_offset[index]; | 51 data_offset = ci->firmware_data_offset[index]; |
54 ci->firmware_body[index] = malloc(MAX(CONFIG_LENGTH_FW_A_DATA, | 52 ci->firmware_body[index] = malloc(MAX(CONFIG_LENGTH_FW_A_DATA, |
55 CONFIG_LENGTH_FW_B_DATA)); | 53 CONFIG_LENGTH_FW_B_DATA)); |
56 | 54 |
57 kbh = (VbKeyBlockHeader *) block; | 55 kbh = (VbKeyBlockHeader *) block; |
58 fph = (VbFirmwarePreambleHeader *) (block + kbh->key_block_size); | 56 fph = (VbFirmwarePreambleHeader *) (block + kbh->key_block_size); |
59 | 57 |
60 debug(PREFIX "key block address: %p\n", kbh); | 58 debug(PREFIX "key block address: %p\n", kbh); |
61 debug(PREFIX "preamble address: %p\n", fph); | 59 debug(PREFIX "preamble address: %p\n", fph); |
(...skipping 20 matching lines...) Expand all Loading... | |
82 } | 80 } |
83 | 81 |
84 /* See vboot_reference/firmware/include/load_firmware_fw.h for | 82 /* See vboot_reference/firmware/include/load_firmware_fw.h for |
85 * documentation of this function. */ | 83 * documentation of this function. */ |
86 UpdateFirmwareBodyHash(params, firmware_body, n); | 84 UpdateFirmwareBodyHash(params, firmware_body, n); |
87 firmware_body += n; | 85 firmware_body += n; |
88 } | 86 } |
89 | 87 |
90 return 0; | 88 return 0; |
91 } | 89 } |
OLD | NEW |