| 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 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ |
| 9 | 9 |
| 10 /* Defines the API to the native client validation code. | 10 /* Defines the API to the native client validation code. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * Hence, for example, NACL_SUBARCH_NAME(ApplyValidator, x86, 64) | 23 * Hence, for example, NACL_SUBARCH_NAME(ApplyValidator, x86, 64) |
| 24 * would generate the function name NaCL_ApplyValidator_x86_64. | 24 * would generate the function name NaCL_ApplyValidator_x86_64. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "native_client/src/include/nacl_base.h" | 27 #include "native_client/src/include/nacl_base.h" |
| 28 #include "native_client/src/shared/utils/types.h" | 28 #include "native_client/src/shared/utils/types.h" |
| 29 #include "native_client/src/trusted/validator/cpufeatures.h" | 29 #include "native_client/src/trusted/validator/cpufeatures.h" |
| 30 | 30 |
| 31 EXTERN_C_BEGIN | 31 EXTERN_C_BEGIN |
| 32 | 32 |
| 33 struct NaClValidationCache; |
| 34 |
| 33 /* Defines the API to select the validator kind. | 35 /* Defines the API to select the validator kind. |
| 34 * So far only the ARM architecture has a non-default validator kind | 36 * So far only the ARM architecture has a non-default validator kind |
| 35 * | 37 * |
| 36 * NaClSBKind can be architecture specific, but requries more | 38 * NaClSBKind can be architecture specific, but requries more |
| 37 * scaffolding. So it is probably not worth while to split up the flag. | 39 * scaffolding. So it is probably not worth while to split up the flag. |
| 38 */ | 40 */ |
| 39 enum NaClSBKind { | 41 enum NaClSBKind { |
| 40 NACL_SB_DEFAULT = 0, | 42 NACL_SB_DEFAULT = 0, |
| 41 NACL_SB_ARM_THUMB2 = 1 | 43 NACL_SB_ARM_THUMB2 = 1 |
| 42 }; | 44 }; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 */ | 105 */ |
| 104 extern NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator, | 106 extern NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator, |
| 105 NACL_TARGET_ARCH, | 107 NACL_TARGET_ARCH, |
| 106 NACL_TARGET_SUBARCH)( | 108 NACL_TARGET_SUBARCH)( |
| 107 enum NaClSBKind sb_kind, | 109 enum NaClSBKind sb_kind, |
| 108 NaClApplyValidationKind kind, | 110 NaClApplyValidationKind kind, |
| 109 uintptr_t guest_addr, | 111 uintptr_t guest_addr, |
| 110 uint8_t *data, | 112 uint8_t *data, |
| 111 size_t size, | 113 size_t size, |
| 112 int bundle_size, | 114 int bundle_size, |
| 113 NaClCPUFeatures *cpu_features); | 115 NaClCPUFeatures *cpu_features, |
| 116 struct NaClValidationCache *cache); |
| 114 | 117 |
| 115 /* Applies the validator, as used in a command-line tool to report issues. | 118 /* Applies the validator, as used in a command-line tool to report issues. |
| 116 * Note: This is intentionally separated from ApplyValidator, since it need | 119 * Note: This is intentionally separated from ApplyValidator, since it need |
| 117 * not be performance critical. | 120 * not be performance critical. |
| 118 * Parameters are: | 121 * Parameters are: |
| 119 * kind - The way the validator should be applied. | 122 * kind - The way the validator should be applied. |
| 120 * local_cpu: True if local cpu rules should be applied. | 123 * local_cpu: True if local cpu rules should be applied. |
| 121 * Otherwise, assume no cpu specific rules. | 124 * Otherwise, assume no cpu specific rules. |
| 122 * guest_addr - The virtual pc to assume with the beginning address of the | 125 * guest_addr - The virtual pc to assume with the beginning address of the |
| 123 * code segment. Typically, this is the corresponding addresss that | 126 * code segment. Typically, this is the corresponding addresss that |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 uintptr_t guest_addr, | 190 uintptr_t guest_addr, |
| 188 uint8_t *data_old, | 191 uint8_t *data_old, |
| 189 uint8_t *data_new, | 192 uint8_t *data_new, |
| 190 size_t size, | 193 size_t size, |
| 191 int bundle_size, | 194 int bundle_size, |
| 192 NaClCPUFeatures *cpu_features); | 195 NaClCPUFeatures *cpu_features); |
| 193 | 196 |
| 194 EXTERN_C_END | 197 EXTERN_C_END |
| 195 | 198 |
| 196 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ | 199 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ |
| OLD | NEW |