| 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 * and static functions and defines). | 9 * and static functions and defines). |
| 10 */ | 10 */ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * 3: 49 8d 34 37 lea (%r15,%rsi,1),%rsi | 24 * 3: 49 8d 34 37 lea (%r15,%rsi,1),%rsi |
| 25 * 7: 40 89 ff rex mov %edi,%edi | 25 * 7: 40 89 ff rex mov %edi,%edi |
| 26 * a: 49 8d 3c 3f lea (%r15,%rdi,1),%rdi | 26 * a: 49 8d 3c 3f lea (%r15,%rdi,1),%rdi |
| 27 * e: f2 48 a7 repnz cmpsq %es:(%rdi),%ds:(%rsi) | 27 * e: f2 48 a7 repnz cmpsq %es:(%rdi),%ds:(%rsi) |
| 28 */ | 28 */ |
| 29 #define MAX_INSTRUCTION_LENGTH 17 | 29 #define MAX_INSTRUCTION_LENGTH 17 |
| 30 | 30 |
| 31 Bool NaClDfaProcessValidationError(const uint8_t *begin, const uint8_t *end, | 31 Bool NaClDfaProcessValidationError(const uint8_t *begin, const uint8_t *end, |
| 32 uint32_t info, void *callback_data); | 32 uint32_t info, void *callback_data); |
| 33 | 33 |
| 34 Bool NaClDfaStubOutCPUUnsupportedInstruction(const uint8_t *begin, | 34 struct StubOutCallbackData { |
| 35 const uint8_t *end, | 35 uint32_t flags; |
| 36 uint32_t info, | 36 int did_rewrite; |
| 37 void *callback_data); | 37 }; |
| 38 |
| 39 Bool NaClDfaStubOutUnsupportedInstruction(const uint8_t *begin, |
| 40 const uint8_t *end, |
| 41 uint32_t info, |
| 42 void *callback_data); |
| 43 |
| 38 struct CodeCopyCallbackData { | 44 struct CodeCopyCallbackData { |
| 39 NaClCopyInstructionFunc copy_func; | 45 NaClCopyInstructionFunc copy_func; |
| 40 /* Difference between addresses: dest - src. */ | 46 /* Difference between addresses: dest - src. */ |
| 41 ptrdiff_t existing_minus_new; | 47 ptrdiff_t existing_minus_new; |
| 42 }; | 48 }; |
| 43 | 49 |
| 44 Bool NaClDfaProcessCodeCopyInstruction(const uint8_t *begin_new, | 50 Bool NaClDfaProcessCodeCopyInstruction(const uint8_t *begin_new, |
| 45 const uint8_t *end_new, | 51 const uint8_t *end_new, |
| 46 uint32_t info, | 52 uint32_t info, |
| 47 void *callback_data); | 53 void *callback_data); |
| 48 | 54 |
| 49 /* Check whether instruction is stubouted because it is not supported by current | 55 /* Check whether instruction is stubouted because it is not supported by current |
| 50 CPU. */ | 56 CPU. */ |
| 51 Bool NaClDfaCodeReplacementIsStubouted(const uint8_t *begin_existing, | 57 Bool NaClDfaCodeReplacementIsStubouted(const uint8_t *begin_existing, |
| 52 size_t instruction_length); | 58 size_t instruction_length); |
| 53 | 59 |
| 54 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_DFA_VALIDATE_COMMON_H_ */ | 60 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_RAGEL_DFA_VALIDATE_COMMON_H_ */ |
| OLD | NEW |