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 #ifndef NACL_TRUSTED_BUT_NOT_TCB | 7 #ifndef NACL_TRUSTED_BUT_NOT_TCB |
8 #error("This file is not meant for use in the TCB") | 8 #error("This file is not meant for use in the TCB") |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 /* TODO(pasko): Validator initialization can be slow, make it run only once. | 114 /* TODO(pasko): Validator initialization can be slow, make it run only once. |
115 */ | 115 */ |
116 const struct NaClValidatorInterface *validator = NaClCreateValidator(); | 116 const struct NaClValidatorInterface *validator = NaClCreateValidator(); |
117 | 117 |
118 /* check if NaCl thinks the given code segment is valid. */ | 118 /* check if NaCl thinks the given code segment is valid. */ |
119 NaClSetAllCPUFeaturesX86((NaClCPUFeatures *) &cpu_features); | 119 NaClSetAllCPUFeaturesX86((NaClCPUFeatures *) &cpu_features); |
120 status = validator->Validate( | 120 status = validator->Validate( |
121 vbase, mbase, size, | 121 vbase, mbase, size, |
122 /* stubout_mode= */ FALSE, /* readonly_text= */ FALSE, | 122 /* stubout_mode= */ FALSE, /* readonly_text= */ FALSE, |
123 (NaClCPUFeatures *) &cpu_features, | 123 (NaClCPUFeatures *) &cpu_features, |
124 NULL); | 124 NULL, NULL); |
125 switch (status) { | 125 switch (status) { |
126 case NaClValidationSucceeded: | 126 case NaClValidationSucceeded: |
127 return TRUE; | 127 return TRUE; |
128 default: | 128 default: |
129 return FALSE; | 129 return FALSE; |
130 } | 130 } |
131 } | 131 } |
OLD | NEW |