OLD | NEW |
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 * ncopcode_desc.h - Descriptors to model opcode operands. | 8 * ncopcode_desc.h - Descriptors to model opcode operands. |
9 */ | 9 */ |
10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCOPCODE_DESC_H_ | 10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCOPCODE_DESC_H_ |
11 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCOPCODE_DESC_H_ | 11 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCOPCODE_DESC_H_ |
12 | 12 |
| 13 |
13 #include <stdio.h> | 14 #include <stdio.h> |
| 15 |
| 16 #include "native_client/src/include/portability.h" |
14 #include "native_client/src/shared/gio/gio.h" | 17 #include "native_client/src/shared/gio/gio.h" |
15 #include "native_client/src/trusted/validator_x86/ncdecode.h" | 18 #include "native_client/src/trusted/validator_x86/ncdecode.h" |
16 #include "native_client/src/shared/utils/types.h" | 19 #include "native_client/src/shared/utils/types.h" |
17 | 20 |
18 /* Define enumerated types. */ | 21 /* Define enumerated types. */ |
19 #include "gen/native_client/src/trusted/validator_x86/nacl_disallows.h" | 22 #include "gen/native_client/src/trusted/validator_x86/nacl_disallows.h" |
20 #include "gen/native_client/src/trusted/validator_x86/ncopcode_prefix.h" | 23 #include "gen/native_client/src/trusted/validator_x86/ncopcode_prefix.h" |
21 #include "gen/native_client/src/trusted/validator_x86/ncopcode_insts.h" | 24 #include "gen/native_client/src/trusted/validator_x86/ncopcode_insts.h" |
22 #include "gen/native_client/src/trusted/validator_x86/ncopcode_opcode_flags.h" | 25 #include "gen/native_client/src/trusted/validator_x86/ncopcode_opcode_flags.h" |
23 #include "gen/native_client/src/trusted/validator_x86/ncopcode_operand_kind.h" | 26 #include "gen/native_client/src/trusted/validator_x86/ncopcode_operand_kind.h" |
24 #include "gen/native_client/src/trusted/validator_x86/ncopcode_operand_flag.h" | 27 #include "gen/native_client/src/trusted/validator_x86/ncopcode_operand_flag.h" |
25 | 28 |
| 29 EXTERN_C_BEGIN |
| 30 |
26 /* Defines the maximum allowable bytes per x86 instruction. */ | 31 /* Defines the maximum allowable bytes per x86 instruction. */ |
27 #define NACL_MAX_BYTES_PER_X86_INSTRUCTION 15 | 32 #define NACL_MAX_BYTES_PER_X86_INSTRUCTION 15 |
28 | 33 |
29 /* Defines integer to represent sets of possible opcode (instruction) flags */ | 34 /* Defines integer to represent sets of possible opcode (instruction) flags */ |
30 typedef uint64_t NaClIFlags; | 35 typedef uint64_t NaClIFlags; |
31 | 36 |
32 /* Converts an NaClIFlagEnum to the corresponding bit in NaClIFlags. */ | 37 /* Converts an NaClIFlagEnum to the corresponding bit in NaClIFlags. */ |
33 #define NACL_IFLAG(x) (((NaClIFlags) 1) << (x)) | 38 #define NACL_IFLAG(x) (((NaClIFlags) 1) << (x)) |
34 | 39 |
35 /* Models the empty set of opcode flags. */ | 40 /* Models the empty set of opcode flags. */ |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 /* Print out the given operand structure to the given file. */ | 161 /* Print out the given operand structure to the given file. */ |
157 void NaClOpPrint(struct Gio* f, const NaClOp* operand); | 162 void NaClOpPrint(struct Gio* f, const NaClOp* operand); |
158 | 163 |
159 /* Print out the given instruction to the given file. However, always | 164 /* Print out the given instruction to the given file. However, always |
160 * print the value NULL for next_rule, even if the value is non-null. This | 165 * print the value NULL for next_rule, even if the value is non-null. This |
161 * function should be used to print out an individual opcode (instruction) | 166 * function should be used to print out an individual opcode (instruction) |
162 * pattern. | 167 * pattern. |
163 */ | 168 */ |
164 void NaClInstPrint(struct Gio* f, const NaClInst* inst); | 169 void NaClInstPrint(struct Gio* f, const NaClInst* inst); |
165 | 170 |
| 171 EXTERN_C_END |
| 172 |
166 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCOPCODE_DESC_H_ */ | 173 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCOPCODE_DESC_H_ */ |
OLD | NEW |