Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / native_client / src / trusted / validator / x86 / nc_segment.h
1 /*
2  * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 /*
8  * Defines the notion of a code segment.
9  */
10
11 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_
12 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_
13
14 #include "native_client/src/trusted/validator/types_memory_model.h"
15
16 EXTERN_C_BEGIN
17
18 /* Model of a code segment. */
19 typedef struct NaClSegment {
20   /* Points the the beginning of the sequence of bytes in the code segment. */
21   uint8_t* mbase;
22   /* Defines the virtual pc value associated with the beginning
23    * of the code segment.
24    */
25   NaClPcAddress vbase;
26   /* The number of bytes in the code segment. */
27   NaClMemorySize size;
28 } NaClSegment;
29
30 /* Initializes the given code segment with the given values. */
31 void NaClSegmentInitialize(
32     uint8_t* mbase,
33     NaClPcAddress vbase,
34     NaClMemorySize size,
35     NaClSegment* segment);
36
37 EXTERN_C_END
38
39 #endif  /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NC_SEGMENT_H_ */