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

Side by Side Diff: vboot_firmware/include/load_firmware_fw.h

Issue 2745007: Major refactoring of structures, with unit tests. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Implemented LoadFirmware2() Created 10 years, 6 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 unified diff | Download patch
OLDNEW
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 * High-level firmware API for loading and verifying rewritable firmware. 5 * High-level firmware API for loading and verifying rewritable firmware.
6 * (Firmware Portion) 6 * (Firmware Portion)
7 */ 7 */
8 8
9 #ifndef VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ 9 #ifndef VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_
10 #define VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ 10 #define VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_
(...skipping 26 matching lines...) Expand all
37 37
38 /* Update the data hash for the current firmware image, extending it 38 /* Update the data hash for the current firmware image, extending it
39 * by [size] bytes stored in [*data]. This function must only be 39 * by [size] bytes stored in [*data]. This function must only be
40 * called inside GetFirmwareBody(). */ 40 * called inside GetFirmwareBody(). */
41 void UpdateFirmwareBodyHash(uint8_t* data, uint64_t size); 41 void UpdateFirmwareBodyHash(uint8_t* data, uint64_t size);
42 42
43 43
44 typedef struct LoadFirmwareParams { 44 typedef struct LoadFirmwareParams {
45 /* Inputs to LoadFirmware() */ 45 /* Inputs to LoadFirmware() */
46 void *firmware_root_key_blob; /* Key used to sign firmware header */ 46 void *firmware_root_key_blob; /* Key used to sign firmware header */
47 void *verification_block_0; /* Key block + preamble for firmware 0 */ 47 void *verification_block_0; /* Key block + preamble for firmware 0 */
48 void *verification_block_1; /* Key block + preamble for firmware 1 */ 48 void *verification_block_1; /* Key block + preamble for firmware 1 */
49 uint64_t verification_size_0; /* Verification block 0 size in bytes */
50 uint64_t verification_size_1; /* Verification block 1 size in bytes */
49 51
50 /* Outputs from LoadFirmware(); valid only if LoadFirmware() returns 52 /* Outputs from LoadFirmware(); valid only if LoadFirmware() returns
51 * LOAD_FIRMWARE_SUCCESS. */ 53 * LOAD_FIRMWARE_SUCCESS. */
52 uint64_t firmware_index; /* Firmware index to run. */ 54 uint64_t firmware_index; /* Firmware index to run. */
53 void *kernel_sign_key_blob; /* Key to use when loading kernel. 55 void *kernel_sign_key_blob; /* Key to use when loading kernel.
54 * Pass this data to LoadKernel() in 56 * Pass this data to LoadKernel() in
55 * LoadKernelParams.header_sign_key_blob. 57 * LoadKernelParams.header_sign_key_blob.
56 * Key data may be copied/relocated 58 * Key data may be copied/relocated
57 * if necessary. */ 59 * if necessary. */
58 uint64_t kernel_sign_key_size; /* Size of kernel signing key blob, 60 uint64_t kernel_sign_key_size; /* Size of kernel signing key blob,
59 * in bytes. */ 61 * in bytes. */
60 } LoadFirmwareParams; 62 } LoadFirmwareParams;
61 63
62 64
63 /* Attempts to load the rewritable firmware. 65 /* Attempts to load the rewritable firmware.
64 * 66 *
65 * Returns LOAD_FIRMWARE_SUCCESS if successful, error code on failure. */ 67 * Returns LOAD_FIRMWARE_SUCCESS if successful, error code on failure. */
66 int LoadFirmware(LoadFirmwareParams* params); 68 int LoadFirmware(LoadFirmwareParams* params);
67 69
68 70
69 #endif /* VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ */ 71 #endif /* VBOOT_REFERENCE_LOAD_FIRMWARE_FW_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698