| 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 ApplyValidatorVerbosely API for the x86-64 architecture. */ | 7 /* Implement the ApplyValidatorVerbosely API for the x86-64 architecture. */ |
| 8 | 8 |
| 9 #include "native_client/src/trusted/validator/ncvalidate.h" | 9 #include "native_client/src/trusted/validator/ncvalidate.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 NaClValidatorStateSetErrorReporter(vstate, &kNaClVerboseErrorReporter); | 39 NaClValidatorStateSetErrorReporter(vstate, &kNaClVerboseErrorReporter); |
| 40 NaClValidateSegment(data, guest_addr, size, vstate); | 40 NaClValidateSegment(data, guest_addr, size, vstate); |
| 41 status = | 41 status = |
| 42 NaClValidatesOk(vstate) ? NaClValidationSucceeded : NaClValidationFailed; | 42 NaClValidatesOk(vstate) ? NaClValidationSucceeded : NaClValidationFailed; |
| 43 NaClValidatorStateDestroy(vstate); | 43 NaClValidatorStateDestroy(vstate); |
| 44 return status; | 44 return status; |
| 45 } | 45 } |
| 46 | 46 |
| 47 NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely, x86, 64) | 47 NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely, x86, 64) |
| 48 (enum NaClSBKind sb_kind, | 48 (enum NaClSBKind sb_kind, |
| 49 NaClApplyValidationKind kind, | |
| 50 uintptr_t guest_addr, | 49 uintptr_t guest_addr, |
| 51 uint8_t *data, | 50 uint8_t *data, |
| 52 size_t size, | 51 size_t size, |
| 53 int bundle_size, | 52 int bundle_size, |
| 54 const NaClCPUFeaturesX86 *cpu_features) { | 53 const NaClCPUFeaturesX86 *cpu_features) { |
| 55 NaClValidationStatus status = NaClValidationFailedNotImplemented; | 54 NaClValidationStatus status = NaClValidationFailedNotImplemented; |
| 56 assert(NACL_SB_DEFAULT == sb_kind); | 55 assert(NACL_SB_DEFAULT == sb_kind); |
| 57 if (bundle_size == 16 || bundle_size == 32) { | 56 if (bundle_size == 16 || bundle_size == 32) { |
| 58 if (!NaClArchSupported(cpu_features)) | 57 if (!NaClArchSupported(cpu_features)) |
| 59 return NaClValidationFailedCpuNotSupported; | 58 return NaClValidationFailedCpuNotSupported; |
| 60 switch (kind) { | 59 status = NaClApplyValidatorVerbosely_x86_64( |
| 61 case NaClApplyCodeValidation: | 60 guest_addr, data, size, bundle_size, cpu_features); |
| 62 status = NaClApplyValidatorVerbosely_x86_64( | |
| 63 guest_addr, data, size, bundle_size, cpu_features); | |
| 64 break; | |
| 65 case NaClApplyValidationDoStubout: | |
| 66 status = NaClApplyValidatorStubout_x86_64( | |
| 67 guest_addr, data, size, bundle_size, cpu_features); | |
| 68 break; | |
| 69 default: | |
| 70 /* If reached, it isn't implemented (yet). */ | |
| 71 break; | |
| 72 } | |
| 73 } | 61 } |
| 74 return status; | 62 return status; |
| 75 } | 63 } |
| OLD | NEW |