| OLD | NEW |
| (Empty) |
| 1 /* | |
| 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 | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCVALIDATE_DETAILE
D_H__ | |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCVALIDATE_DETAILE
D_H__ | |
| 9 | |
| 10 /* | |
| 11 * ncvalidate_details.h: Secondary API for the validator to the segment-based | |
| 12 * sandbox. | |
| 13 * | |
| 14 * This is a secondary interface to the validator for the segment-based sandbox. | |
| 15 * This version should be used when details about reporting errors is needed. | |
| 16 * In particular, this interface should be used when the validator is run | |
| 17 * in verbose or stubout mode. In these cases, getting details right | |
| 18 * (i.e. the instruction that causes a code segment to violate NaCl rules) | |
| 19 * is important. For verbose mode, this implies that the | |
| 20 * error messages will report each instruction that violates a NaCl rule. For | |
| 21 * stubout mode, it will automatically stub out (i.e. replace with HALT | |
| 22 * instructions) instructions that violate NaCl rules. | |
| 23 * | |
| 24 * See ncvalidate.h for the primary interface to the segment-based sandbox | |
| 25 * NaCl validator. | |
| 26 * | |
| 27 * This secondary interface is considerbly slower than the primary interface | |
| 28 * in that it does 2 walks over the code segment instead of one. However, by | |
| 29 * doing this second walk, it can generate more detailed error reports. | |
| 30 * The secondary interface is engaged if one calls NCValidateInitDetailed | |
| 31 * in place of NCValidateInit. The rest of the interface to the | |
| 32 * NaCl validator is the same. | |
| 33 * | |
| 34 * Basic usage: | |
| 35 * if (!NaClArchSuppported()) fail | |
| 36 * vstate = NCValidateInitDetailed(base, size, cpu_features) | |
| 37 * if vstate == 0 fail | |
| 38 * for each section: | |
| 39 * NCValidateSegment(maddr, base, size, vstate); | |
| 40 * rc = NCValidateFinish(); | |
| 41 * if rc != 0 fail | |
| 42 * NCValidateFreeState(&vstate); | |
| 43 * | |
| 44 * See the README file in this directory for more info on the general | |
| 45 * structure of the validator. | |
| 46 */ | |
| 47 | |
| 48 #include "native_client/src/trusted/validator/x86/ncval_seg_sfi/ncvalidate.h" | |
| 49 | |
| 50 /* | |
| 51 * NCValidateInitDetailed: Initialize NaCl validator internal state. Focus | |
| 52 * is on error details rather then performance. Note: The paramters and | |
| 53 * return values for this function is the same as NCValidateInit | |
| 54 * from the primary interface to the NaCl validator, and replaces it | |
| 55 * in the secondary interface.o | |
| 56 * | |
| 57 * Parameters: | |
| 58 * vbase: base virtual address for code segment | |
| 59 * codesize: size in bytes of code segment | |
| 60 * features: the features supported by the CPU that will run the code | |
| 61 * Returns: | |
| 62 * an initialized struct NCValidatorState * if everything is okay, | |
| 63 * else NULL | |
| 64 */ | |
| 65 struct NCValidatorState *NCValidateInitDetailed( | |
| 66 const NaClPcAddress vbase, | |
| 67 const NaClMemorySize codesize, | |
| 68 const NaClCPUFeaturesX86 *features); | |
| 69 | |
| 70 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCVALIDATE_DETA
ILED_H__ */ | |
| OLD | NEW |