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 19 matching lines...) Expand all Loading... |
30 int bundle_size, | 30 int bundle_size, |
31 NaClCPUFeaturesX86 *cpu_features) { | 31 NaClCPUFeaturesX86 *cpu_features) { |
32 struct NaClValidatorState *vstate; | 32 struct NaClValidatorState *vstate; |
33 NaClValidationStatus status = | 33 NaClValidationStatus status = |
34 NaClValidatorSetup_x86_64(guest_addr, size, bundle_size, cpu_features, | 34 NaClValidatorSetup_x86_64(guest_addr, size, bundle_size, cpu_features, |
35 &vstate); | 35 &vstate); |
36 if (status != NaClValidationSucceeded) return status; | 36 if (status != NaClValidationSucceeded) return status; |
37 NaClValidatorStateSetLogVerbosity(vstate, LOG_ERROR); | 37 NaClValidatorStateSetLogVerbosity(vstate, LOG_ERROR); |
38 NaClValidatorStateSetMaxReportedErrors(vstate, -1); /* Report all errors. */ | 38 NaClValidatorStateSetMaxReportedErrors(vstate, -1); /* Report all errors. */ |
39 NaClValidatorStateSetErrorReporter(vstate, &kNaClVerboseErrorReporter); | 39 NaClValidatorStateSetErrorReporter(vstate, &kNaClVerboseErrorReporter); |
40 return NaClSegmentValidate_x86_64(guest_addr, data, size, vstate) | 40 NaClValidateSegment(data, guest_addr, size, vstate); |
41 ? NaClValidationSucceeded : NaClValidationFailed; | 41 status = |
| 42 NaClValidatesOk(vstate) ? NaClValidationSucceeded : NaClValidationFailed; |
| 43 NaClValidatorStateDestroy(vstate); |
| 44 return status; |
42 } | 45 } |
43 | 46 |
44 NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely, x86, 64) | 47 NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely, x86, 64) |
45 (enum NaClSBKind sb_kind, | 48 (enum NaClSBKind sb_kind, |
46 NaClApplyValidationKind kind, | 49 NaClApplyValidationKind kind, |
47 uintptr_t guest_addr, | 50 uintptr_t guest_addr, |
48 uint8_t *data, | 51 uint8_t *data, |
49 size_t size, | 52 size_t size, |
50 int bundle_size, | 53 int bundle_size, |
51 NaClCPUFeaturesX86 *cpu_features) { | 54 NaClCPUFeaturesX86 *cpu_features) { |
(...skipping 11 matching lines...) Expand all Loading... |
63 status = NaClApplyValidatorStubout_x86_64( | 66 status = NaClApplyValidatorStubout_x86_64( |
64 guest_addr, data, size, bundle_size, cpu_features); | 67 guest_addr, data, size, bundle_size, cpu_features); |
65 break; | 68 break; |
66 default: | 69 default: |
67 /* If reached, it isn't implemented (yet). */ | 70 /* If reached, it isn't implemented (yet). */ |
68 break; | 71 break; |
69 } | 72 } |
70 } | 73 } |
71 return status; | 74 return status; |
72 } | 75 } |
OLD | NEW |