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 * ragel_tester.c | 8 * ragel_tester.c |
9 * Implements a ragel decoder that can be used as a NaClEnumeratorDecoder. | 9 * Implements a ragel decoder that can be used as a NaClEnumeratorDecoder. |
10 */ | 10 */ |
11 #ifndef NACL_TRUSTED_BUT_NOT_TCB | 11 #ifndef NACL_TRUSTED_BUT_NOT_TCB |
12 #error("This file is not meant for use in the TCB.") | 12 #error("This file is not meant for use in the TCB.") |
13 #endif | 13 #endif |
14 | 14 |
15 #include "native_client/src/trusted/validator/x86/testing/enuminsts/enuminsts.h" | 15 #include "native_client/src/trusted/validator/x86/testing/enuminsts/enuminsts.h" |
16 | 16 |
17 #include <string.h> | 17 #include <string.h> |
18 #include "native_client/src/trusted/validator/types_memory_model.h" | 18 #include "native_client/src/trusted/validator/types_memory_model.h" |
19 #include "native_client/src/trusted/validator/x86/ncinstbuffer.h" | 19 #include "native_client/src/trusted/validator/x86/ncinstbuffer.h" |
20 #include "native_client/src/trusted/validator/x86/testing/enuminsts/str_utils.h" | 20 #include "native_client/src/trusted/validator/x86/testing/enuminsts/str_utils.h" |
21 #include "native_client/src/trusted/validator_ragel/unreviewed/decoder.h" | 21 #include "native_client/src/trusted/validator_ragel/decoder.h" |
22 #include "native_client/src/trusted/validator_ragel/unreviewed/validator.h" | 22 #include "native_client/src/trusted/validator_ragel/unreviewed/validator.h" |
23 | 23 |
24 #define kBufferSize 1024 | 24 #define kBufferSize 1024 |
25 | 25 |
26 /* Defines the virtual table for the ragel decoder. */ | 26 /* Defines the virtual table for the ragel decoder. */ |
27 struct { | 27 struct { |
28 /* The virtual table that implements this decoder. */ | 28 /* The virtual table that implements this decoder. */ |
29 NaClEnumeratorDecoder _base; | 29 NaClEnumeratorDecoder _base; |
30 } ragel_decoder; | 30 } ragel_decoder; |
31 | 31 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 ragel_decoder._base._install_flag_fn = InstallFlag; | 209 ragel_decoder._base._install_flag_fn = InstallFlag; |
210 ragel_decoder._base._get_inst_mnemonic_fn = RGetInstMnemonic; | 210 ragel_decoder._base._get_inst_mnemonic_fn = RGetInstMnemonic; |
211 ragel_decoder._base._get_inst_num_operands_fn = NULL; | 211 ragel_decoder._base._get_inst_num_operands_fn = NULL; |
212 ragel_decoder._base._get_inst_operands_text_fn = NULL; | 212 ragel_decoder._base._get_inst_operands_text_fn = NULL; |
213 ragel_decoder._base._writes_to_reserved_reg_fn = NULL; | 213 ragel_decoder._base._writes_to_reserved_reg_fn = NULL; |
214 ragel_decoder._base._maybe_inst_validates_fn = RIsInstValid; | 214 ragel_decoder._base._maybe_inst_validates_fn = RIsInstValid; |
215 ragel_decoder._base._segment_validates_fn = NULL; | 215 ragel_decoder._base._segment_validates_fn = NULL; |
216 ragel_decoder._base._usage_message = "Runs ragel to decode instructions."; | 216 ragel_decoder._base._usage_message = "Runs ragel to decode instructions."; |
217 return &ragel_decoder._base; | 217 return &ragel_decoder._base; |
218 } | 218 } |
OLD | NEW |