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

Side by Side Diff: vboot_firmware/lib/include/stateful_util.h

Issue 2833012: Move all system includes in vboot_firmware to sysincludes.h (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Oops, forgot the new header 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 | « vboot_firmware/lib/cryptolib/sha1.c ('k') | vboot_firmware/lib/include/tss_constants.h » ('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_FIRMWARE_LIB_UTILITY_H_ 10 #ifndef VBOOT_FIRMWARE_LIB_UTILITY_H_
11 #define VBOOT_FIRMWARE_LIB_UTILITY_H_ 11 #define VBOOT_FIRMWARE_LIB_UTILITY_H_
12 12
13 #include <stdint.h> 13 #include "sysincludes.h"
14 #include <string.h>
15
16 #include "utility.h"
17 14
18 /* Track remaining data to be read in a buffer. */ 15 /* Track remaining data to be read in a buffer. */
19 typedef struct MemcpyState { 16 typedef struct MemcpyState {
20 void* remaining_buf; 17 void* remaining_buf;
21 uint64_t remaining_len; /* Remaining length of the buffer. */ 18 uint64_t remaining_len; /* Remaining length of the buffer. */
22 uint8_t overrun; /* Flag set to 1 when an overrun occurs. */ 19 uint8_t overrun; /* Flag set to 1 when an overrun occurs. */
23 } MemcpyState; 20 } MemcpyState;
24 21
25 /* Skip [len] bytes only if there's enough data to skip according 22 /* Skip [len] bytes only if there's enough data to skip according
26 * to [state]. 23 * to [state].
(...skipping 29 matching lines...) Expand all
56 * a constant value. 53 * a constant value.
57 * On success, return a meaningless but non-NULL pointer and updates [state]. 54 * On success, return a meaningless but non-NULL pointer and updates [state].
58 * On failure, return NULL, set remaining_len in state to -1. 55 * On failure, return NULL, set remaining_len in state to -1.
59 * 56 *
60 * After the first failure (buffer overrun), successive calls will always fail. 57 * After the first failure (buffer overrun), successive calls will always fail.
61 */ 58 */
62 const void* StatefulMemset_r(MemcpyState* state, const uint8_t val, 59 const void* StatefulMemset_r(MemcpyState* state, const uint8_t val,
63 uint64_t len); 60 uint64_t len);
64 61
65 #endif /* VBOOT_FIRMWARE_LIB_UTILITY_H_ */ 62 #endif /* VBOOT_FIRMWARE_LIB_UTILITY_H_ */
OLDNEW
« no previous file with comments | « vboot_firmware/lib/cryptolib/sha1.c ('k') | vboot_firmware/lib/include/tss_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698