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 #include "native_client/src/trusted/validator_mips/ncvalidate.h" | 7 #include "native_client/src/trusted/validator_mips/ncvalidate.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "native_client/src/include/nacl_string.h" | 11 #include "native_client/src/include/nacl_string.h" |
12 #include "native_client/src/include/portability.h" | 12 #include "native_client/src/include/portability.h" |
| 13 #include "native_client/src/shared/platform/nacl_check.h" |
13 #include "native_client/src/shared/utils/types.h" | 14 #include "native_client/src/shared/utils/types.h" |
14 #include "native_client/src/trusted/service_runtime/arch/mips/sel_ldr_mips.h" | 15 #include "native_client/src/trusted/service_runtime/arch/mips/sel_ldr_mips.h" |
15 #include "native_client/src/trusted/cpu_features/arch/mips/cpu_mips.h" | 16 #include "native_client/src/trusted/cpu_features/arch/mips/cpu_mips.h" |
16 #include "native_client/src/trusted/validator/validation_cache.h" | 17 #include "native_client/src/trusted/validator/validation_cache.h" |
17 #include "native_client/src/trusted/validator_mips/model.h" | 18 #include "native_client/src/trusted/validator_mips/model.h" |
18 #include "native_client/src/trusted/validator_mips/validator.h" | 19 #include "native_client/src/trusted/validator_mips/validator.h" |
19 | 20 |
20 using nacl_mips_val::SfiValidator; | 21 using nacl_mips_val::SfiValidator; |
21 using nacl_mips_val::CodeSegment; | 22 using nacl_mips_val::CodeSegment; |
22 using nacl_mips_dec::Register; | 23 using nacl_mips_dec::Register; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 if (!success) return 2; | 111 if (!success) return 2; |
111 | 112 |
112 return 0; | 113 return 0; |
113 } | 114 } |
114 | 115 |
115 static NaClValidationStatus ApplyValidatorMips( | 116 static NaClValidationStatus ApplyValidatorMips( |
116 uintptr_t guest_addr, | 117 uintptr_t guest_addr, |
117 uint8_t *data, | 118 uint8_t *data, |
118 size_t size, | 119 size_t size, |
119 int stubout_mode, | 120 int stubout_mode, |
| 121 uint32_t flags, |
120 int readonly_text, | 122 int readonly_text, |
121 const NaClCPUFeatures *cpu_features, | 123 const NaClCPUFeatures *cpu_features, |
122 const struct NaClValidationMetadata *metadata, | 124 const struct NaClValidationMetadata *metadata, |
123 struct NaClValidationCache *cache) { | 125 struct NaClValidationCache *cache) { |
| 126 CHECK((flags & MIPS_VALIDATION_FLAGS_MASK) == 0); |
124 void *query = NULL; | 127 void *query = NULL; |
125 const NaClCPUFeaturesMips *features = | 128 const NaClCPUFeaturesMips *features = |
126 (const NaClCPUFeaturesMips *) cpu_features; | 129 (const NaClCPUFeaturesMips *) cpu_features; |
127 NaClValidationStatus status = NaClValidationFailedNotImplemented; | 130 NaClValidationStatus status = NaClValidationFailedNotImplemented; |
128 | 131 |
129 /* Don't cache in stubout mode. */ | 132 /* Don't cache in stubout mode. */ |
130 if (stubout_mode) | 133 if (stubout_mode) |
131 cache = NULL; | 134 cache = NULL; |
132 | 135 |
133 /* If the validation caching interface is available, perform a query. */ | 136 /* If the validation caching interface is available, perform a query. */ |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 */ | 241 */ |
239 int NaClCopyInstruction(uint8_t *dst, uint8_t *src, uint8_t sz) { | 242 int NaClCopyInstruction(uint8_t *dst, uint8_t *src, uint8_t sz) { |
240 UNREFERENCED_PARAMETER(dst); | 243 UNREFERENCED_PARAMETER(dst); |
241 UNREFERENCED_PARAMETER(src); | 244 UNREFERENCED_PARAMETER(src); |
242 UNREFERENCED_PARAMETER(sz); | 245 UNREFERENCED_PARAMETER(sz); |
243 | 246 |
244 return 0; | 247 return 0; |
245 } | 248 } |
246 | 249 |
247 EXTERN_C_END | 250 EXTERN_C_END |
OLD | NEW |