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

Side by Side Diff: src/trusted/validator_x86/nc_segment.h

Issue 6883091: Start unit testing for functions in nc_inst_state.c (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can be
4 * be found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * Defines the notion of a code segment. 8 * Defines the notion of a code segment.
9 */ 9 */
10 10
11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_ 11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_
12 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_ 12 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_
13 13
14 #include "native_client/src/trusted/validator_x86/nc_inst_state.h" 14 #include "native_client/src/trusted/validator_x86/nc_inst_state.h"
15 15
16 EXTERN_C_BEGIN
17
16 /* Model of a code segment. */ 18 /* Model of a code segment. */
17 typedef struct NaClSegment { 19 typedef struct NaClSegment {
18 /* Points the the beginning of the sequence of bytes in the code segment. */ 20 /* Points the the beginning of the sequence of bytes in the code segment. */
19 uint8_t* mbase; 21 uint8_t* mbase;
20 /* Defines the virtual pc value associated with the beginning 22 /* Defines the virtual pc value associated with the beginning
21 * of the code segment. 23 * of the code segment.
22 */ 24 */
23 NaClPcAddress vbase; 25 NaClPcAddress vbase;
24 /* Defines the maximum+1 (virtual) pc value. Used to define 26 /* Defines the maximum+1 (virtual) pc value. Used to define
25 * when the end of the segment is reached. Corresponds to 27 * when the end of the segment is reached. Corresponds to
26 * vbase + size; 28 * vbase + size;
27 */ 29 */
28 NaClPcAddress vlimit; 30 NaClPcAddress vlimit;
29 /* The number of bytes in the code segment. */ 31 /* The number of bytes in the code segment. */
30 NaClMemorySize size; 32 NaClMemorySize size;
31 } NaClSegment; 33 } NaClSegment;
32 34
33 /* Initializes the given code segment with the given values. */ 35 /* Initializes the given code segment with the given values. */
34 void NaClSegmentInitialize( 36 void NaClSegmentInitialize(
35 uint8_t* mbase, 37 uint8_t* mbase,
36 NaClPcAddress vbase, 38 NaClPcAddress vbase,
37 NaClMemorySize size, 39 NaClMemorySize size,
38 NaClSegment* segment); 40 NaClSegment* segment);
39 41
42 EXTERN_C_END
43
40 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_ */ 44 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698