| 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 NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NCVALIDATE_ITER_DE
TAILED_H__ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NCVALIDATE_ITER_DE
TAILED_H__ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NCVALIDATE_ITER_DE
TAILED_H__ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NCVALIDATE_ITER_DE
TAILED_H__ |
| 9 | 9 |
| 10 /* | 10 /* |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 * | 33 * |
| 34 * Basic usage: | 34 * Basic usage: |
| 35 * -- base is initial address of ELF file. | 35 * -- base is initial address of ELF file. |
| 36 * -- limit is the size of the ELF file. | 36 * -- limit is the size of the ELF file. |
| 37 * -- maddr is the address to the memory of a section. | 37 * -- maddr is the address to the memory of a section. |
| 38 * -- vaddr is the starting virtual address associated with a section. | 38 * -- vaddr is the starting virtual address associated with a section. |
| 39 * -- size is the number of bytes in a section. | 39 * -- size is the number of bytes in a section. |
| 40 * | 40 * |
| 41 * if (!NaClArchSupported()) fail; | 41 * if (!NaClArchSupported()) fail; |
| 42 * NaClValidatorState* state = | 42 * NaClValidatorState* state = |
| 43 * NaClValidatorStateCreateDetailed(base, limit - base, 32, RegR15); | 43 * NaClValidatorStateCreateDetailed(base, limit - base, RegR15, features); |
| 44 * if (state == NULL) fail; | 44 * if (state == NULL) fail; |
| 45 * for each section: | 45 * for each section: |
| 46 * NaClValidateSegment(maddr, vaddr, size, state); | 46 * NaClValidateSegment(maddr, vaddr, size, state); |
| 47 * if (!NaClValidatesOk(state)) fail; | 47 * if (!NaClValidatesOk(state)) fail; |
| 48 * NaClValidatorStateDestroy(state); | 48 * NaClValidatorStateDestroy(state); |
| 49 * | 49 * |
| 50 * See the README file in this directory for more info on the general | 50 * See the README file in this directory for more info on the general |
| 51 * structure of the validator. | 51 * structure of the validator. |
| 52 */ | 52 */ |
| 53 | 53 |
| 54 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter.
h" | 54 #include "native_client/src/trusted/validator/x86/ncval_reg_sfi/ncvalidate_iter.
h" |
| 55 | 55 |
| 56 /* Create a validator state to validate the code segment with the given | 56 /* Create a validator state to validate the code segment with the given |
| 57 * parameters, This state is set up to generate detailed errors instead | 57 * parameters, This state is set up to generate detailed errors instead |
| 58 * of summary (jump) errors. | 58 * of summary (jump) errors. |
| 59 * | 59 * |
| 60 * Note: Messages (if any) produced by the validator are sent to the stream | 60 * Note: Messages (if any) produced by the validator are sent to the stream |
| 61 * defined by native_client/src/shared/platform/nacl_log.h. | 61 * defined by native_client/src/shared/platform/nacl_log.h. |
| 62 * | 62 * |
| 63 * Parameters. | 63 * Parameters. |
| 64 * vbase - The virtual address for the contents of the code segment. | 64 * vbase - The virtual address for the contents of the code segment. |
| 65 * sz - The number of bytes in the code segment | 65 * sz - The number of bytes in the code segment |
| 66 * alignment: 16 or 32, specifying alignment. | |
| 67 * base_register - OperandKind defining value for base register (or | 66 * base_register - OperandKind defining value for base register (or |
| 68 * RegUnknown if not defined). | 67 * RegUnknown if not defined). |
| 69 * features - The CPU features to use. Uses local features of machine if NULL. | 68 * features - The CPU features to use. Uses local features of machine if NULL. |
| 70 * Returns: | 69 * Returns: |
| 71 * A pointer to an initialized validator state if everything is ok, NULL | 70 * A pointer to an initialized validator state if everything is ok, NULL |
| 72 * otherwise. | 71 * otherwise. |
| 73 */ | 72 */ |
| 74 NaClValidatorState* NaClValidatorStateCreateDetailed( | 73 NaClValidatorState* NaClValidatorStateCreateDetailed( |
| 75 const NaClPcAddress vbase, | 74 const NaClPcAddress vbase, |
| 76 const NaClMemorySize sz, | 75 const NaClMemorySize sz, |
| 77 const uint8_t alignment, | |
| 78 const NaClOpKind base_register, | 76 const NaClOpKind base_register, |
| 79 const NaClCPUFeaturesX86* features); | 77 const NaClCPUFeaturesX86* features); |
| 80 | 78 |
| 81 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NCVALIDATE_ITER
_DETAILED_H__ */ | 79 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_REG_SFI_NCVALIDATE_ITER
_DETAILED_H__ */ |
| OLD | NEW |