| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 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 /* | 7 /* |
| 8 * ncdecode.h - table driven decoder for Native Client. | 8 * ncdecode.h - table driven decoder for Native Client. |
| 9 * | 9 * |
| 10 * This header file contains type declarations and constants | 10 * This header file contains type declarations and constants |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 struct NCDecoderState* dstate; | 178 struct NCDecoderState* dstate; |
| 179 /* Corresopnding index of this instruction wrt to inst_buffer in | 179 /* Corresopnding index of this instruction wrt to inst_buffer in |
| 180 * in the corresponding decoder state NCDecoderState. | 180 * in the corresponding decoder state NCDecoderState. |
| 181 */ | 181 */ |
| 182 size_t inst_index; | 182 size_t inst_index; |
| 183 /* The number of instructions parsed so far (including this instrruction). | 183 /* The number of instructions parsed so far (including this instrruction). |
| 184 * Used to detect when one tries to get a previous instruction that doesn't | 184 * Used to detect when one tries to get a previous instruction that doesn't |
| 185 * exist. | 185 * exist. |
| 186 */ | 186 */ |
| 187 size_t inst_count; | 187 size_t inst_count; |
| 188 /* True if the instruction is unchanged while dynamically replacing code. |
| 189 * False if the instruction has changed or if code replacement is not being |
| 190 * performed (i.e. normal validation.) |
| 191 */ |
| 192 Bool unchanged; |
| 188 } NCDecoderInst; | 193 } NCDecoderInst; |
| 189 | 194 |
| 190 /* Given a (decoded) instruction, return the instruction that appeared | 195 /* Given a (decoded) instruction, return the instruction that appeared |
| 191 * n elements before it, or NULL if no such instruction exists. | 196 * n elements before it, or NULL if no such instruction exists. |
| 192 * | 197 * |
| 193 * Parameters: | 198 * Parameters: |
| 194 * dinst - The instruction to look up relative to. | 199 * dinst - The instruction to look up relative to. |
| 195 * n - number of elements back to look. | 200 * n - number of elements back to look. |
| 196 */ | 201 */ |
| 197 extern NCDecoderInst *PreviousInst(const NCDecoderInst* dinst, int n); | 202 extern NCDecoderInst *PreviousInst(const NCDecoderInst* dinst, int n); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 * Destruct a decoder state pair. | 394 * Destruct a decoder state pair. |
| 390 * | 395 * |
| 391 * Note: Destructors of subclasses of NCDecoderStatePair should | 396 * Note: Destructors of subclasses of NCDecoderStatePair should |
| 392 * call this distructor last, after the subinstance has been destructed. | 397 * call this distructor last, after the subinstance has been destructed. |
| 393 */ | 398 */ |
| 394 extern void NCDecoderStatePairDestruct(NCDecoderStatePair* tthis); | 399 extern void NCDecoderStatePairDestruct(NCDecoderStatePair* tthis); |
| 395 | 400 |
| 396 EXTERN_C_END | 401 EXTERN_C_END |
| 397 | 402 |
| 398 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCDECODE_H_ */ | 403 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCDECODE_H_ */ |
| OLD | NEW |