Chromium Code Reviews| 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/build_config.h" | 12 #include "native_client/src/include/build_config.h" |
| 13 #include "native_client/src/include/nacl_base.h" | 13 #include "native_client/src/include/nacl_base.h" |
| 14 #include "native_client/src/include/portability.h" | 14 #include "native_client/src/include/portability.h" |
| 15 #include "native_client/src/trusted/cpu_features/cpu_features.h" | 15 #include "native_client/src/trusted/cpu_features/cpu_features.h" |
| 16 | 16 |
| 17 | 17 |
| 18 EXTERN_C_BEGIN | 18 EXTERN_C_BEGIN |
| 19 | 19 |
| 20 struct NaClValidationCache; | 20 struct NaClValidationCache; |
| 21 struct NaClValidationMetadata; | 21 struct NaClValidationMetadata; |
| 22 | 22 |
| 23 /* Defines possible validation flags. */ | |
| 24 typedef enum NaClValidationFlags { | |
| 25 NORMAL_VALIDATION, | |
|
Petr Hosek
2015/07/28 22:24:38
I'd drop this and just use `0` as a default value
ruiq
2015/07/28 22:45:35
Done.
| |
| 26 DISABLE_UNSUPPORTED | |
|
Petr Hosek
2015/07/28 22:24:38
Could you please set the value for this as `0x1`?
ruiq
2015/07/28 22:45:35
Done.
| |
| 27 } NaClValidationFlags; | |
| 28 | |
| 23 /* Defines possible validation status values. */ | 29 /* Defines possible validation status values. */ |
| 24 typedef enum NaClValidationStatus { | 30 typedef enum NaClValidationStatus { |
| 25 /* The call to the validator succeeded. */ | 31 /* The call to the validator succeeded. */ |
| 26 NaClValidationSucceeded, | 32 NaClValidationSucceeded, |
| 27 /* The call to the validator failed (Reason unspecified) */ | 33 /* The call to the validator failed (Reason unspecified) */ |
| 28 NaClValidationFailed, | 34 NaClValidationFailed, |
| 29 /* The call to the validator failed, due to not enough memory. */ | 35 /* The call to the validator failed, due to not enough memory. */ |
| 30 NaClValidationFailedOutOfMemory, | 36 NaClValidationFailedOutOfMemory, |
| 31 /* The call to the validator failed, due to it not being implemented yet. */ | 37 /* The call to the validator failed, due to it not being implemented yet. */ |
| 32 NaClValidationFailedNotImplemented, | 38 NaClValidationFailedNotImplemented, |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 56 * in sel_ldr or command-line tool). | 62 * in sel_ldr or command-line tool). |
| 57 * readonly_text - If code should be considered read-only. | 63 * readonly_text - If code should be considered read-only. |
| 58 * cpu_features - The CPU features to support while validating. | 64 * cpu_features - The CPU features to support while validating. |
| 59 * cache - Pointer to NaCl validation cache. | 65 * cache - Pointer to NaCl validation cache. |
| 60 */ | 66 */ |
| 61 typedef NaClValidationStatus (*NaClValidateFunc)( | 67 typedef NaClValidationStatus (*NaClValidateFunc)( |
| 62 uintptr_t guest_addr, | 68 uintptr_t guest_addr, |
| 63 uint8_t *data, | 69 uint8_t *data, |
| 64 size_t size, | 70 size_t size, |
| 65 int stubout_mode, | 71 int stubout_mode, |
| 72 uint32_t flags, | |
| 66 int readonly_text, | 73 int readonly_text, |
| 67 const NaClCPUFeatures *cpu_features, | 74 const NaClCPUFeatures *cpu_features, |
| 68 const struct NaClValidationMetadata *metadata, | 75 const struct NaClValidationMetadata *metadata, |
| 69 struct NaClValidationCache *cache); | 76 struct NaClValidationCache *cache); |
| 70 | 77 |
| 71 /* Function type to copy an instruction safely. Returns non-zero on success. | 78 /* Function type to copy an instruction safely. Returns non-zero on success. |
| 72 * Implemented by the Service Runtime. | 79 * Implemented by the Service Runtime. |
| 73 */ | 80 */ |
| 74 typedef int (*NaClCopyInstructionFunc)( | 81 typedef int (*NaClCopyInstructionFunc)( |
| 75 uint8_t *dst, | 82 uint8_t *dst, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 NACL_BUILD_ARCH, | 209 NACL_BUILD_ARCH, |
| 203 NACL_BUILD_SUBARCH)( | 210 NACL_BUILD_SUBARCH)( |
| 204 uintptr_t guest_addr, | 211 uintptr_t guest_addr, |
| 205 uint8_t *data, | 212 uint8_t *data, |
| 206 size_t size, | 213 size_t size, |
| 207 const NaClCPUFeatures *cpu_features); | 214 const NaClCPUFeatures *cpu_features); |
| 208 | 215 |
| 209 EXTERN_C_END | 216 EXTERN_C_END |
| 210 | 217 |
| 211 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ | 218 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_H__ */ |
| OLD | NEW |