| 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-64 architecture. */ | 7 /* Implement the Validator API for the x86-64 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 #endif | 23 #endif |
| 24 | 24 |
| 25 | 25 |
| 26 static NaClValidationStatus ApplyDfaValidator_x86_64( | 26 static NaClValidationStatus ApplyDfaValidator_x86_64( |
| 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 (ValidateChunkAMD64(data, size, 0 /*options*/, cpu_features, | 48 if (ValidateChunkAMD64(data, size, 0 /*options*/, cpu_features, |
| 47 readonly_text ? | 49 readonly_text ? |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 ValidatorCodeReplacement_x86_64, | 195 ValidatorCodeReplacement_x86_64, |
| 194 sizeof(NaClCPUFeaturesX86), | 196 sizeof(NaClCPUFeaturesX86), |
| 195 NaClSetAllCPUFeaturesX86, | 197 NaClSetAllCPUFeaturesX86, |
| 196 NaClGetCurrentCPUFeaturesX86, | 198 NaClGetCurrentCPUFeaturesX86, |
| 197 NaClFixCPUFeaturesX86, | 199 NaClFixCPUFeaturesX86, |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 const struct NaClValidatorInterface *NaClDfaValidatorCreate_x86_64(void) { | 202 const struct NaClValidatorInterface *NaClDfaValidatorCreate_x86_64(void) { |
| 201 return &validator; | 203 return &validator; |
| 202 } | 204 } |
| OLD | NEW |