| 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 22 matching lines...) Expand all Loading... |
| 33 uint32_t flags, | 33 uint32_t flags, |
| 34 int readonly_text, | 34 int readonly_text, |
| 35 const NaClCPUFeatures *f, | 35 const NaClCPUFeatures *f, |
| 36 const struct NaClValidationMetadata *metadata, | 36 const struct NaClValidationMetadata *metadata, |
| 37 struct NaClValidationCache *cache) { | 37 struct NaClValidationCache *cache) { |
| 38 /* TODO(jfb) Use a safe cast here. */ | 38 /* TODO(jfb) Use a safe cast here. */ |
| 39 NaClCPUFeaturesX86 *cpu_features = (NaClCPUFeaturesX86 *) f; | 39 NaClCPUFeaturesX86 *cpu_features = (NaClCPUFeaturesX86 *) f; |
| 40 enum NaClValidationStatus status = NaClValidationFailed; | 40 enum NaClValidationStatus status = NaClValidationFailed; |
| 41 void *query = NULL; | 41 void *query = NULL; |
| 42 struct StubOutCallbackData callback_data; | 42 struct StubOutCallbackData callback_data; |
| 43 |
| 43 callback_data.flags = flags; | 44 callback_data.flags = flags; |
| 44 callback_data.did_rewrite = 0; | 45 callback_data.did_rewrite = 0; |
| 46 callback_data.chunk_processed_as_a_contiguous_stream = 0; |
| 47 callback_data.bundle_begin_offset = (intptr_t) data & kBundleMask; |
| 48 callback_data.cpu_features = cpu_features; |
| 45 UNREFERENCED_PARAMETER(guest_addr); | 49 UNREFERENCED_PARAMETER(guest_addr); |
| 46 | 50 |
| 47 if (stubout_mode) | 51 if (stubout_mode) |
| 48 return NaClValidationFailedNotImplemented; | 52 return NaClValidationFailedNotImplemented; |
| 49 if (!NaClArchSupportedX86(cpu_features)) | 53 if (!NaClArchSupportedX86(cpu_features)) |
| 50 return NaClValidationFailedCpuNotSupported; | 54 return NaClValidationFailedCpuNotSupported; |
| 51 if (size & kBundleMask) | 55 if (size & kBundleMask) |
| 52 return NaClValidationFailed; | 56 return NaClValidationFailed; |
| 53 | 57 |
| 54 /* | 58 /* |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 sizeof(NaClCPUFeaturesX86), | 308 sizeof(NaClCPUFeaturesX86), |
| 305 NaClSetAllCPUFeaturesX86, | 309 NaClSetAllCPUFeaturesX86, |
| 306 NaClGetCurrentCPUFeaturesX86, | 310 NaClGetCurrentCPUFeaturesX86, |
| 307 NaClFixCPUFeaturesX86, | 311 NaClFixCPUFeaturesX86, |
| 308 IsOnInstBoundary_x86_64, | 312 IsOnInstBoundary_x86_64, |
| 309 }; | 313 }; |
| 310 | 314 |
| 311 const struct NaClValidatorInterface *NaClDfaValidatorCreate_x86_64(void) { | 315 const struct NaClValidatorInterface *NaClDfaValidatorCreate_x86_64(void) { |
| 312 return &validator; | 316 return &validator; |
| 313 } | 317 } |
| OLD | NEW |