Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: src/trusted/validator/x86/32/ncvalidate_verbose.c

Issue 10024039: Replace kind variable from validator API with Boolean stubout parameter. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Final edits Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/trusted/validator/x86/32/ncvalidate.c ('k') | src/trusted/validator/x86/64/ncvalidate.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-32 architecture. */ 7 /* Implement the ApplyValidatorVerbosely API for the x86-32 architecture. */
8 8
9 #include "native_client/src/trusted/validator/ncvalidate.h" 9 #include "native_client/src/trusted/validator/ncvalidate.h"
10 10
(...skipping 29 matching lines...) Expand all
40 NCValidateSetErrorReporter(vstate, &kNCVerboseErrorReporter); 40 NCValidateSetErrorReporter(vstate, &kNCVerboseErrorReporter);
41 NCValidateSegment(data, guest_addr, size, vstate); 41 NCValidateSegment(data, guest_addr, size, vstate);
42 validator_result = NCValidateFinish(vstate); 42 validator_result = NCValidateFinish(vstate);
43 NCValidateFreeState(&vstate); 43 NCValidateFreeState(&vstate);
44 return (validator_result == 0) 44 return (validator_result == 0)
45 ? NaClValidationSucceeded : NaClValidationFailed; 45 ? NaClValidationSucceeded : NaClValidationFailed;
46 } 46 }
47 47
48 NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely, x86, 32) 48 NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely, x86, 32)
49 (enum NaClSBKind sb_kind, 49 (enum NaClSBKind sb_kind,
50 NaClApplyValidationKind kind,
51 uintptr_t guest_addr, 50 uintptr_t guest_addr,
52 uint8_t *data, 51 uint8_t *data,
53 size_t size, 52 size_t size,
54 int bundle_size, 53 int bundle_size,
55 const NaClCPUFeaturesX86 *cpu_features) { 54 const NaClCPUFeaturesX86 *cpu_features) {
56 NaClValidationStatus status = NaClValidationFailedNotImplemented; 55 NaClValidationStatus status = NaClValidationFailedNotImplemented;
57 assert(NACL_SB_DEFAULT == sb_kind); 56 assert(NACL_SB_DEFAULT == sb_kind);
58 if (bundle_size == 16 || bundle_size == 32) { 57 if (bundle_size == 16 || bundle_size == 32) {
59 if (!NaClArchSupported(cpu_features)) 58 if (!NaClArchSupported(cpu_features))
60 return NaClValidationFailedCpuNotSupported; 59 return NaClValidationFailedCpuNotSupported;
61 switch (kind) { 60 status = NCApplyValidatorVerbosely_x86_32(
62 case NaClApplyCodeValidation: 61 guest_addr, data, size, bundle_size, cpu_features);
63 status = NCApplyValidatorVerbosely_x86_32(
64 guest_addr, data, size, bundle_size, cpu_features);
65 break;
66 case NaClApplyValidationDoStubout:
67 status = NCApplyValidatorStubout_x86_32(
68 guest_addr, data, size, bundle_size, cpu_features);
69 break;
70 default:
71 /* If reached, it isn't implemented (yet). */
72 break;
73 }
74 } 62 }
75 return status; 63 return status;
76 } 64 }
OLDNEW
« no previous file with comments | « src/trusted/validator/x86/32/ncvalidate.c ('k') | src/trusted/validator/x86/64/ncvalidate.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698