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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #define kPrefixSEGGS 0x0008 /* 0x65 */ | 50 #define kPrefixSEGGS 0x0008 /* 0x65 */ |
51 #define kPrefixDATA16 0x0010 /* 0x66 - OKAY */ | 51 #define kPrefixDATA16 0x0010 /* 0x66 - OKAY */ |
52 #define kPrefixADDR16 0x0020 /* 0x67 - disallowed */ | 52 #define kPrefixADDR16 0x0020 /* 0x67 - disallowed */ |
53 #define kPrefixREPNE 0x0040 /* 0xf2 - OKAY */ | 53 #define kPrefixREPNE 0x0040 /* 0xf2 - OKAY */ |
54 #define kPrefixREP 0x0080 /* 0xf3 - OKAY */ | 54 #define kPrefixREP 0x0080 /* 0xf3 - OKAY */ |
55 #define kPrefixLOCK 0x0100 /* 0xf0 - OKAY */ | 55 #define kPrefixLOCK 0x0100 /* 0xf0 - OKAY */ |
56 #define kPrefixSEGES 0x0200 /* 0x26 - disallowed */ | 56 #define kPrefixSEGES 0x0200 /* 0x26 - disallowed */ |
57 #define kPrefixSEGDS 0x0400 /* 0x3e - disallowed */ | 57 #define kPrefixSEGDS 0x0400 /* 0x3e - disallowed */ |
58 #define kPrefixREX 0x1000 /* 0x40 - 0x4f Rex prefix */ | 58 #define kPrefixREX 0x1000 /* 0x40 - 0x4f Rex prefix */ |
59 | 59 |
| 60 /* Readability macros for bitset testing. */ |
| 61 #define NaClHasBit(set, bit) ((set) & (bit)) |
| 62 #define NaClExcludesBit(set, bit) (~(set) & bit) |
| 63 |
60 /* a new enumerated type for instructions. | 64 /* a new enumerated type for instructions. |
61 * Note: Each enumerate type is marked with one of the following symbols, | 65 * Note: Each enumerate type is marked with one of the following symbols, |
62 * defining the validator it us used for: | 66 * defining the validator it us used for: |
63 * 32 - The x86-32 validator. | 67 * 32 - The x86-32 validator. |
64 * 64 - The x86-64 validator. | 68 * 64 - The x86-64 validator. |
65 * Both - Both the x86-32 and the x86-64 validators. | 69 * Both - Both the x86-32 and the x86-64 validators. |
66 * Note: The code for the x86-64 validator is being cleaned up, and there | 70 * Note: The code for the x86-64 validator is being cleaned up, and there |
67 * are still uses of the "32" tag for x86 instructions. | 71 * are still uses of the "32" tag for x86 instructions. |
68 * TODO(karl) - Fix this comment when modeling for the x86-64 has been cleaned | 72 * TODO(karl) - Fix this comment when modeling for the x86-64 has been cleaned |
69 * up. | 73 * up. |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 NCDecoderStats newsegment, | 491 NCDecoderStats newsegment, |
488 NCDecoderStats segmentationerror, | 492 NCDecoderStats segmentationerror, |
489 NCDecoderStats internalerror); | 493 NCDecoderStats internalerror); |
490 | 494 |
491 /* Given a (decoded) instruction, return the instruction that appeared | 495 /* Given a (decoded) instruction, return the instruction that appeared |
492 * n elements before it. | 496 * n elements before it. |
493 */ | 497 */ |
494 extern NCDecoderInst *PreviousInst(const NCDecoderInst* dinst, int n); | 498 extern NCDecoderInst *PreviousInst(const NCDecoderInst* dinst, int n); |
495 | 499 |
496 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCDECODE_H_ */ | 500 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCDECODE_H_ */ |
OLD | NEW |