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

Side by Side Diff: firmware/stub/utility_stub.c

Issue 6719005: Cherry-pick vboot_reference files from TOT to support crossystem (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@0.11.257.B
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « firmware/stub/load_firmware_stub.c ('k') | host/lib/crossystem.c » ('j') | 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) 2011 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 * Stub implementations of utility functions which call their linux-specific 5 * Stub implementations of utility functions which call their linux-specific
6 * equivalents. 6 * equivalents.
7 */ 7 */
8 8
9 #define _STUB_IMPLEMENTATION_ 9 #define _STUB_IMPLEMENTATION_
10 #include "utility.h" 10 #include "utility.h"
11 11
12 #include <stdarg.h> 12 #include <stdarg.h>
13 #include <stdio.h> 13 #include <stdio.h>
14 #include <stdlib.h> 14 #include <stdlib.h>
15 #include <string.h> 15 #include <string.h>
16 #include <sys/time.h>
16 17
17 void error(const char *format, ...) { 18 void error(const char *format, ...) {
18 va_list ap; 19 va_list ap;
19 va_start(ap, format); 20 va_start(ap, format);
20 fprintf(stderr, "ERROR: "); 21 fprintf(stderr, "ERROR: ");
21 vfprintf(stderr, format, ap); 22 vfprintf(stderr, format, ap);
22 va_end(ap); 23 va_end(ap);
23 exit(1); 24 exit(1);
24 } 25 }
25 26
(...skipping 18 matching lines...) Expand all
44 free(ptr); 45 free(ptr);
45 } 46 }
46 47
47 int Memcmp(const void* src1, const void* src2, size_t n) { 48 int Memcmp(const void* src1, const void* src2, size_t n) {
48 return memcmp(src1, src2, n); 49 return memcmp(src1, src2, n);
49 } 50 }
50 51
51 void* Memcpy(void* dest, const void* src, uint64_t n) { 52 void* Memcpy(void* dest, const void* src, uint64_t n) {
52 return memcpy(dest, src, (size_t)n); 53 return memcpy(dest, src, (size_t)n);
53 } 54 }
55
56 uint64_t VbGetTimer(void) {
57 struct timeval tv;
58 gettimeofday(&tv, NULL);
59 return (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec;
60 }
61
62 uint64_t VbGetTimerMaxFreq(void) {
63 return UINT64_C(1000000);
64 }
OLDNEW
« no previous file with comments | « firmware/stub/load_firmware_stub.c ('k') | host/lib/crossystem.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698