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

Side by Side Diff: firmware/include/utility.h

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 | « firmware/include/sysincludes.h ('k') | firmware/lib/cgptlib/cgptlib_internal.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) 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 /* Helper functions/wrappers for memory allocations, manipulation and 6 /* Helper functions/wrappers for memory allocations, manipulation and
7 * comparison. 7 * comparison.
8 */ 8 */
9 9
10 #ifndef VBOOT_REFERENCE_UTILITY_H_ 10 #ifndef VBOOT_REFERENCE_UTILITY_H_
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 /* Free memory pointed by [ptr] previously allocated by Malloc(). */ 45 /* Free memory pointed by [ptr] previously allocated by Malloc(). */
46 void Free(void* ptr); 46 void Free(void* ptr);
47 47
48 /* Compare [n] bytes in [src1] and [src2] 48 /* Compare [n] bytes in [src1] and [src2]
49 * Returns an integer less than, equal to, or greater than zero if the first [n] 49 * Returns an integer less than, equal to, or greater than zero if the first [n]
50 * bytes of [src1] is found, respectively, to be less than, to match, or be 50 * bytes of [src1] is found, respectively, to be less than, to match, or be
51 * greater than the first n bytes of [src2]. */ 51 * greater than the first n bytes of [src2]. */
52 int Memcmp(const void* src1, const void* src2, size_t n); 52 int Memcmp(const void* src1, const void* src2, size_t n);
53 53
54 /* Copy [n] bytes from [src] to [dest]. */ 54 /* Copy [n] bytes from [src] to [dest]. */
55 void* Memcpy(void* dest, const void* src, size_t n); 55 void* Memcpy(void* dest, const void* src, uint64_t n);
56 56
57 /* Set [n] bytes starting at [s] to [c]. */ 57 /* Set [n] bytes starting at [s] to [c]. */
58 void* Memset(void *dest, const uint8_t c, size_t n); 58 void* Memset(void *dest, const uint8_t c, uint64_t n);
59 59
60 /* Compare [n] bytes starting at [s1] with [s2] and return 0 if they match, 60 /* Compare [n] bytes starting at [s1] with [s2] and return 0 if they match,
61 * 1 if they don't. Time taken to perform the comparison is only dependent on 61 * 1 if they don't. Time taken to perform the comparison is only dependent on
62 * [n] and not on the relationship of the match between [s1] and [s2]. 62 * [n] and not on the relationship of the match between [s1] and [s2].
63 */ 63 */
64 int SafeMemcmp(const void* s1, const void* s2, size_t n); 64 int SafeMemcmp(const void* s1, const void* s2, size_t n);
65 65
66 /* Ensure that only our stub implementations are used, not standard C */ 66 /* Ensure that only our stub implementations are used, not standard C */
67 #ifndef _STUB_IMPLEMENTATION_ 67 #ifndef _STUB_IMPLEMENTATION_
68 #define malloc _do_not_use_standard_malloc 68 #define malloc _do_not_use_standard_malloc
69 #define free _do_not_use_standard_free 69 #define free _do_not_use_standard_free
70 #define memcmp _do_not_use_standard_memcmp 70 #define memcmp _do_not_use_standard_memcmp
71 #define memcpy _do_not_use_standard_memcpy 71 #define memcpy _do_not_use_standard_memcpy
72 #define memset _do_not_use_standard_memset 72 #define memset _do_not_use_standard_memset
73 #endif 73 #endif
74 74
75 75
76 #endif /* VBOOT_REFERENCE_UTILITY_H_ */ 76 #endif /* VBOOT_REFERENCE_UTILITY_H_ */
OLDNEW
« no previous file with comments | « firmware/include/sysincludes.h ('k') | firmware/lib/cgptlib/cgptlib_internal.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698