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 /* | 7 /* |
8 * This is the core of ia32-mode validator. Please note that this file | 8 * This is the core of ia32-mode validator. Please note that this file |
9 * combines ragel machine description and C language actions. Please read | 9 * combines ragel machine description and C language actions. Please read |
10 * validator_internals.html first to understand how the whole thing is built: | 10 * validator_internals.html first to understand how the whole thing is built: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; | 51 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; |
52 include immediate_fields_parsing | 52 include immediate_fields_parsing |
53 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; | 53 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; |
54 include relative_fields_validator_actions | 54 include relative_fields_validator_actions |
55 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; | 55 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; |
56 include relative_fields_parsing | 56 include relative_fields_parsing |
57 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; | 57 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; |
58 include cpuid_actions | 58 include cpuid_actions |
59 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; | 59 "native_client/src/trusted/validator_ragel/parse_instruction.rl"; |
60 | 60 |
| 61 action unsupported_instruction { |
| 62 instruction_info_collected |= UNSUPPORTED_INSTRUCTION; |
| 63 } |
| 64 |
61 include decode_x86_32 "validator_x86_32_instruction.rl"; | 65 include decode_x86_32 "validator_x86_32_instruction.rl"; |
62 | 66 |
63 special_instruction = | 67 special_instruction = |
64 # and $~0x1f, %eXX call %eXX | 68 # and $~0x1f, %eXX call %eXX |
65 # vvvvvvvvvv | 69 # vvvvvvvvvv |
66 (0x83 0xe0 0xe0 0xff (0xd0|0xe0) | # naclcall/jmp %eax | 70 (0x83 0xe0 0xe0 0xff (0xd0|0xe0) | # naclcall/jmp %eax |
67 0x83 0xe1 0xe0 0xff (0xd1|0xe1) | # naclcall/jmp %ecx | 71 0x83 0xe1 0xe0 0xff (0xd1|0xe1) | # naclcall/jmp %ecx |
68 0x83 0xe2 0xe0 0xff (0xd2|0xe2) | # naclcall/jmp %edx | 72 0x83 0xe2 0xe0 0xff (0xd2|0xe2) | # naclcall/jmp %edx |
69 0x83 0xe3 0xe0 0xff (0xd3|0xe3) | # naclcall/jmp %ebx | 73 0x83 0xe3 0xe0 0xff (0xd3|0xe3) | # naclcall/jmp %ebx |
70 0x83 0xe4 0xe0 0xff (0xd4|0xe4) | # naclcall/jmp %esp | 74 0x83 0xe4 0xe0 0xff (0xd4|0xe4) | # naclcall/jmp %esp |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 jump_dests, | 250 jump_dests, |
247 user_callback, | 251 user_callback, |
248 callback_data); | 252 callback_data); |
249 | 253 |
250 /* We only use malloc for a large code sequences */ | 254 /* We only use malloc for a large code sequences */ |
251 if (jump_dests != &jump_dests_small) free(jump_dests); | 255 if (jump_dests != &jump_dests_small) free(jump_dests); |
252 if (valid_targets != &valid_targets_small) free(valid_targets); | 256 if (valid_targets != &valid_targets_small) free(valid_targets); |
253 if (!result) errno = EINVAL; | 257 if (!result) errno = EINVAL; |
254 return result; | 258 return result; |
255 } | 259 } |
OLD | NEW |