| 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 exposed by the Native Client validators. */ | 10 /* Defines the API exposed by the Native Client validators. */ |
| 11 | 11 |
| 12 #include "native_client/src/include/nacl_base.h" | 12 #include "native_client/src/include/nacl_base.h" |
| 13 #include "native_client/src/include/portability.h" | 13 #include "native_client/src/include/portability.h" |
| 14 #include "native_client/src/trusted/cpu_features/cpu_features.h" | 14 #include "native_client/src/trusted/cpu_features/cpu_features.h" |
| 15 | 15 |
| 16 | 16 |
| 17 EXTERN_C_BEGIN | 17 EXTERN_C_BEGIN |
| 18 | 18 |
| 19 struct NaClValidationCache; | 19 struct NaClValidationCache; |
| 20 struct NaClValidationMetadata; |
| 20 | 21 |
| 21 /* Defines possible validation status values. */ | 22 /* Defines possible validation status values. */ |
| 22 typedef enum NaClValidationStatus { | 23 typedef enum NaClValidationStatus { |
| 23 /* The call to the validator succeeded. */ | 24 /* The call to the validator succeeded. */ |
| 24 NaClValidationSucceeded, | 25 NaClValidationSucceeded, |
| 25 /* The call to the validator failed (Reason unspecified) */ | 26 /* The call to the validator failed (Reason unspecified) */ |
| 26 NaClValidationFailed, | 27 NaClValidationFailed, |
| 27 /* The call to the validator failed, due to not enough memory. */ | 28 /* The call to the validator failed, due to not enough memory. */ |
| 28 NaClValidationFailedOutOfMemory, | 29 NaClValidationFailedOutOfMemory, |
| 29 /* The call to the validator failed, due to it not being implemented yet. */ | 30 /* The call to the validator failed, due to it not being implemented yet. */ |
| (...skipping 26 matching lines...) Expand all Loading... |
| 56 * cpu_features - The CPU features to support while validating. | 57 * cpu_features - The CPU features to support while validating. |
| 57 * cache - Pointer to NaCl validation cache. | 58 * cache - Pointer to NaCl validation cache. |
| 58 */ | 59 */ |
| 59 typedef NaClValidationStatus (*NaClValidateFunc)( | 60 typedef NaClValidationStatus (*NaClValidateFunc)( |
| 60 uintptr_t guest_addr, | 61 uintptr_t guest_addr, |
| 61 uint8_t *data, | 62 uint8_t *data, |
| 62 size_t size, | 63 size_t size, |
| 63 int stubout_mode, | 64 int stubout_mode, |
| 64 int readonly_text, | 65 int readonly_text, |
| 65 const NaClCPUFeatures *cpu_features, | 66 const NaClCPUFeatures *cpu_features, |
| 67 const struct NaClValidationMetadata *metadata, |
| 66 struct NaClValidationCache *cache); | 68 struct NaClValidationCache *cache); |
| 67 | 69 |
| 68 /* Function type to copy an instruction safely. Returns non-zero on success. | 70 /* Function type to copy an instruction safely. Returns non-zero on success. |
| 69 * Implemented by the Service Runtime. | 71 * Implemented by the Service Runtime. |
| 70 */ | 72 */ |
| 71 typedef int (*NaClCopyInstructionFunc)( | 73 typedef int (*NaClCopyInstructionFunc)( |
| 72 uint8_t *dst, | 74 uint8_t *dst, |
| 73 uint8_t *src, | 75 uint8_t *src, |
| 74 uint8_t sz); | 76 uint8_t sz); |
| 75 | 77 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 NACL_TARGET_ARCH, | 171 NACL_TARGET_ARCH, |
| 170 NACL_TARGET_SUBARCH)( | 172 NACL_TARGET_SUBARCH)( |
| 171 uintptr_t guest_addr, | 173 uintptr_t guest_addr, |
| 172 uint8_t *data, | 174 uint8_t *data, |
| 173 size_t size, | 175 size_t size, |
| 174 const NaClCPUFeatures *cpu_features); | 176 const NaClCPUFeatures *cpu_features); |
| 175 | 177 |
| 176 EXTERN_C_END | 178 EXTERN_C_END |
| 177 | 179 |
| 178 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ | 180 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ |
| OLD | NEW |