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

Side by Side Diff: utility/load_kernel_test.c

Issue 2809037: Make vboot_reference build in MSVC command line environment. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Integrated trunk changes. 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
« no previous file with comments | « tests/vboot_common_tests.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5
6 /* Routines for verifying a file's signature. Useful in testing the core 6 /* Routines for verifying a file's signature. Useful in testing the core
7 * RSA verification implementation. 7 * RSA verification implementation.
8 */ 8 */
9 9
10 #include <inttypes.h> /* For PRIu64 macro */ 10 #include <inttypes.h> /* For PRIu64 macro */
11 #include <stdio.h> 11 #include <stdio.h>
12 #include <stdlib.h> 12 #include <stdlib.h>
13 #include <string.h> 13 #include <string.h>
14 #include <sys/types.h> 14 #include <sys/types.h>
15 15
16 #include "load_kernel_fw.h" 16 #include "load_kernel_fw.h"
17 #include "boot_device.h" 17 #include "boot_device.h"
18 #include "host_common.h" 18 #include "host_common.h"
19 #include "rollback_index.h" 19 #include "rollback_index.h"
20 #include "utility.h" 20 #include "utility.h"
21 #include "vboot_kernel.h" 21 #include "vboot_kernel.h"
22 22
23 /* ANSI Color coding sequences. */
24 #define COL_GREEN "\e[1;32m"
25 #define COL_RED "\e[0;31m"
26 #define COL_STOP "\e[m"
27
28
29 #define LBA_BYTES 512 23 #define LBA_BYTES 512
30 #define KERNEL_BUFFER_SIZE 0x600000 24 #define KERNEL_BUFFER_SIZE 0x600000
31 25
32 /* Global variables for stub functions */ 26 /* Global variables for stub functions */
33 static LoadKernelParams lkp; 27 static LoadKernelParams lkp;
34 static FILE *image_file = NULL; 28 static FILE *image_file = NULL;
35 29
36 30
37 /* Boot device stub implementations to read from the image file */ 31 /* Boot device stub implementations to read from the image file */
38 int BootDeviceReadLBA(uint64_t lba_start, uint64_t lba_count, void *buffer) { 32 int BootDeviceReadLBA(uint64_t lba_start, uint64_t lba_count, void *buffer) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (LOAD_KERNEL_SUCCESS == rv) { 130 if (LOAD_KERNEL_SUCCESS == rv) {
137 printf("Partition number: %" PRIu64 "\n", lkp.partition_number); 131 printf("Partition number: %" PRIu64 "\n", lkp.partition_number);
138 printf("Bootloader address: %" PRIu64 "\n", lkp.bootloader_address); 132 printf("Bootloader address: %" PRIu64 "\n", lkp.bootloader_address);
139 printf("Bootloader size: %" PRIu64 "\n", lkp.bootloader_size); 133 printf("Bootloader size: %" PRIu64 "\n", lkp.bootloader_size);
140 } 134 }
141 135
142 fclose(image_file); 136 fclose(image_file);
143 Free(lkp.kernel_buffer); 137 Free(lkp.kernel_buffer);
144 return 0; 138 return 0;
145 } 139 }
OLDNEW
« no previous file with comments | « tests/vboot_common_tests.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698