| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 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 | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * This file contains common parts of x86-32 and x86-64 internals (inline | 8 * This file contains common parts of x86-32 and x86-64 internals (inline |
| 9 * functions and defines). | 9 * functions and defines). |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_VALIDATOR_INTERNAL_H_ | 12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_VALIDATOR_INTERNAL_H_ |
| 13 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_VALIDATOR_INTERNAL_H_ | 13 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_VALIDATOR_INTERNAL_H_ |
| 14 | 14 |
| 15 #include "native_client/src/shared/platform/nacl_check.h" | 15 #include "native_client/src/shared/platform/nacl_check.h" |
| 16 #include "native_client/src/shared/utils/types.h" | 16 #include "native_client/src/shared/utils/types.h" |
| 17 #include "native_client/src/trusted/validator_ragel/unreviewed/decoding.h" | 17 #include "native_client/src/trusted/validator_ragel/decoding.h" |
| 18 #include "native_client/src/trusted/validator_ragel/validator.h" | 18 #include "native_client/src/trusted/validator_ragel/validator.h" |
| 19 | 19 |
| 20 /* Maximum set of R-DFA allowable CPUID features. */ | 20 /* Maximum set of R-DFA allowable CPUID features. */ |
| 21 extern const NaClCPUFeaturesX86 kValidatorCPUIDFeatures; | 21 extern const NaClCPUFeaturesX86 kValidatorCPUIDFeatures; |
| 22 | 22 |
| 23 /* Macroses to suppport CPUID handling. */ | 23 /* Macroses to suppport CPUID handling. */ |
| 24 #define SET_CPU_FEATURE(F) \ | 24 #define SET_CPU_FEATURE(F) \ |
| 25 if (!(F##_Allowed)) { \ | 25 if (!(F##_Allowed)) { \ |
| 26 instruction_info_collected |= UNRECOGNIZED_INSTRUCTION; \ | 26 instruction_info_collected |= UNRECOGNIZED_INSTRUCTION; \ |
| 27 } \ | 27 } \ |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 rip[-2] + 256U * ((uint32_t) rip[-1])))); | 328 rip[-2] + 256U * ((uint32_t) rip[-1])))); |
| 329 size_t jump_dest = offset + (rip - codeblock_start); | 329 size_t jump_dest = offset + (rip - codeblock_start); |
| 330 | 330 |
| 331 if (MarkJumpTarget(jump_dest, jump_dests, jumpdests_size)) | 331 if (MarkJumpTarget(jump_dest, jump_dests, jumpdests_size)) |
| 332 *instruction_info_collected |= RELATIVE_32BIT; | 332 *instruction_info_collected |= RELATIVE_32BIT; |
| 333 else | 333 else |
| 334 *instruction_info_collected |= RELATIVE_32BIT | DIRECT_JUMP_OUT_OF_RANGE; | 334 *instruction_info_collected |= RELATIVE_32BIT | DIRECT_JUMP_OUT_OF_RANGE; |
| 335 } | 335 } |
| 336 | 336 |
| 337 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_VALIDATOR_INTERNAL_H_ */ | 337 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_VALIDATOR_INTERNAL_H_ */ |
| OLD | NEW |