| 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 /* Implement the Validator API for the x86-32 architecture. */ | 7 /* Implement the Validator API for the x86-32 architecture. */ |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 # error "Can't compile, target is for x86-32" | 23 # error "Can't compile, target is for x86-32" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 NaClValidationStatus ApplyDfaValidator_x86_32( | 26 NaClValidationStatus ApplyDfaValidator_x86_32( |
| 27 uintptr_t guest_addr, | 27 uintptr_t guest_addr, |
| 28 uint8_t *data, | 28 uint8_t *data, |
| 29 size_t size, | 29 size_t size, |
| 30 int stubout_mode, | 30 int stubout_mode, |
| 31 int readonly_text, | 31 int readonly_text, |
| 32 const NaClCPUFeatures *f, | 32 const NaClCPUFeatures *f, |
| 33 const struct NaClValidationMetadata *metadata, |
| 33 struct NaClValidationCache *cache) { | 34 struct NaClValidationCache *cache) { |
| 34 /* TODO(jfb) Use a safe cast here. */ | 35 /* TODO(jfb) Use a safe cast here. */ |
| 35 NaClCPUFeaturesX86 *cpu_features = (NaClCPUFeaturesX86 *) f; | 36 NaClCPUFeaturesX86 *cpu_features = (NaClCPUFeaturesX86 *) f; |
| 36 enum NaClValidationStatus status = NaClValidationFailed; | 37 enum NaClValidationStatus status = NaClValidationFailed; |
| 37 UNREFERENCED_PARAMETER(guest_addr); | 38 UNREFERENCED_PARAMETER(guest_addr); |
| 39 UNREFERENCED_PARAMETER(metadata); |
| 38 UNREFERENCED_PARAMETER(cache); | 40 UNREFERENCED_PARAMETER(cache); |
| 39 | 41 |
| 40 if (stubout_mode) | 42 if (stubout_mode) |
| 41 return NaClValidationFailedNotImplemented; | 43 return NaClValidationFailedNotImplemented; |
| 42 if (!NaClArchSupportedX86(cpu_features)) | 44 if (!NaClArchSupportedX86(cpu_features)) |
| 43 return NaClValidationFailedCpuNotSupported; | 45 return NaClValidationFailedCpuNotSupported; |
| 44 if (size & kBundleMask) | 46 if (size & kBundleMask) |
| 45 return NaClValidationFailed; | 47 return NaClValidationFailed; |
| 46 if (ValidateChunkIA32(data, size, 0 /*options*/, cpu_features, | 48 if (ValidateChunkIA32(data, size, 0 /*options*/, cpu_features, |
| 47 readonly_text ? | 49 readonly_text ? |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 ValidatorCodeReplacement_x86_32, | 262 ValidatorCodeReplacement_x86_32, |
| 261 sizeof(NaClCPUFeaturesX86), | 263 sizeof(NaClCPUFeaturesX86), |
| 262 NaClSetAllCPUFeaturesX86, | 264 NaClSetAllCPUFeaturesX86, |
| 263 NaClGetCurrentCPUFeaturesX86, | 265 NaClGetCurrentCPUFeaturesX86, |
| 264 NaClFixCPUFeaturesX86, | 266 NaClFixCPUFeaturesX86, |
| 265 }; | 267 }; |
| 266 | 268 |
| 267 const struct NaClValidatorInterface *NaClDfaValidatorCreate_x86_32(void) { | 269 const struct NaClValidatorInterface *NaClDfaValidatorCreate_x86_32(void) { |
| 268 return &validator; | 270 return &validator; |
| 269 } | 271 } |
| OLD | NEW |