Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/trusted/validator_ragel/unreviewed/validator.h

Issue 9968039: Add ragel machine generators to SCONS (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 _VALIDATOR_X86_64_H_ 7 #ifndef _VALIDATOR_X86_64_H_
8 #define _VALIDATOR_X86_64_H_ 8 #define _VALIDATOR_X86_64_H_
9 9
10 #include <inttypes.h> 10 #include "native_client/src/include/portability.h"
11 #include <stdbool.h> 11
12 /*
13 * Microsoft C/C++ version 14.00.50727.762, which comes with Visual C++ 2005,
14 * and version 15.00.30729.01, which comes with Visual C++ 2008, do not.
15 * define _Bool.
16 */
17 #if defined(_MSC_VER) && _MSC_VER <= 1500
18 typedef int _Bool;
19 #endif
12 20
13 #ifdef __cplusplus 21 #ifdef __cplusplus
14 extern "C" { 22 extern "C" {
15 #endif 23 #endif
16 24
17 enum operand_type { 25 enum operand_type {
18 /* 26 /*
19 * OperandSize8bit and OperandSize16bit don't affect sandboxing state of the 27 * OperandSize8bit and OperandSize16bit don't affect sandboxing state of the
20 * register: it may become different, but top half does not change it's value. 28 * register: it may become different, but top half does not change it's value.
21 * R15 can not be used even with these operands. 29 * R15 can not be used even with these operands.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 REG_R15, 93 REG_R15,
86 REG_RM, /* Address in memory via rm field. */ 94 REG_RM, /* Address in memory via rm field. */
87 REG_RIP, /* RIP - used as base in x86-64 mode. */ 95 REG_RIP, /* RIP - used as base in x86-64 mode. */
88 REG_RIZ, /* EIZ/RIZ - used as "always zero index" register. */ 96 REG_RIZ, /* EIZ/RIZ - used as "always zero index" register. */
89 REG_IMM, /* Fixed value in imm field. */ 97 REG_IMM, /* Fixed value in imm field. */
90 REG_IMM2, /* Fixed value in second imm field. */ 98 REG_IMM2, /* Fixed value in second imm field. */
91 REG_DS_RBX, /* Fox xlat: %ds(%rbx). */ 99 REG_DS_RBX, /* Fox xlat: %ds(%rbx). */
92 REG_ES_RDI, /* For string instructions: %es:(%rsi). */ 100 REG_ES_RDI, /* For string instructions: %es:(%rsi). */
93 REG_DS_RSI, /* For string instructions: %ds:(%rdi). */ 101 REG_DS_RSI, /* For string instructions: %ds:(%rdi). */
94 REG_PORT_DX, /* 16-bit DX: for in/out instructions. */ 102 REG_PORT_DX, /* 16-bit DX: for in/out instructions. */
95 REG_NONE, /* For modrm: both index and base can be absent. */ 103 NO_REG, /* For modrm: both index and base can be absent. */
96 REG_ST, /* For x87 instructions: implicit %st. */ 104 REG_ST, /* For x87 instructions: implicit %st. */
97 JMP_TO /* Operand is jump target address: usually %rip+offset. */ 105 JMP_TO /* Operand is jump target address: usually %rip+offset. */
98 }; 106 };
99 107
100 typedef void (*process_error_func) (const uint8_t *ptr, void *userdata); 108 typedef void (*process_error_func) (const uint8_t *ptr, void *userdata);
101 109
102 int ValidateChunkAMD64(const uint8_t *data, size_t size, 110 int ValidateChunkAMD64(const uint8_t *data, size_t size,
103 process_error_func process_error, void *userdata); 111 process_error_func process_error, void *userdata);
104 112
105 int ValidateChunkIA32(const uint8_t *data, size_t size, 113 int ValidateChunkIA32(const uint8_t *data, size_t size,
106 process_error_func process_error, void *userdata); 114 process_error_func process_error, void *userdata);
107 115
108 #ifdef __cplusplus 116 #ifdef __cplusplus
109 } 117 }
110 #endif 118 #endif
111 119
112 #endif 120 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698