2 * SPDX-License-Identifier: MIT
4 * Copyright 2012-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 #include <lttng/ust-abi.h>
14 * offsets are absolute from start of bytecode.
18 /* Initially, symbol offset. After link, field offset. */
20 } __attribute__((packed
));
25 } __attribute__((packed
));
27 struct get_index_u16
{
29 } __attribute__((packed
));
31 struct get_index_u64
{
33 } __attribute__((packed
));
35 struct literal_numeric
{
37 } __attribute__((packed
));
39 struct literal_double
{
41 } __attribute__((packed
));
43 struct literal_string
{
45 } __attribute__((packed
));
48 BYTECODE_OP_UNKNOWN
= 0,
50 BYTECODE_OP_RETURN
= 1,
57 BYTECODE_OP_MINUS
= 6,
58 BYTECODE_OP_BIT_RSHIFT
= 7,
59 BYTECODE_OP_BIT_LSHIFT
= 8,
60 BYTECODE_OP_BIT_AND
= 9,
61 BYTECODE_OP_BIT_OR
= 10,
62 BYTECODE_OP_BIT_XOR
= 11,
64 /* binary comparators */
72 /* string binary comparator: apply to */
73 BYTECODE_OP_EQ_STRING
= 18,
74 BYTECODE_OP_NE_STRING
= 19,
75 BYTECODE_OP_GT_STRING
= 20,
76 BYTECODE_OP_LT_STRING
= 21,
77 BYTECODE_OP_GE_STRING
= 22,
78 BYTECODE_OP_LE_STRING
= 23,
80 /* s64 binary comparator */
81 BYTECODE_OP_EQ_S64
= 24,
82 BYTECODE_OP_NE_S64
= 25,
83 BYTECODE_OP_GT_S64
= 26,
84 BYTECODE_OP_LT_S64
= 27,
85 BYTECODE_OP_GE_S64
= 28,
86 BYTECODE_OP_LE_S64
= 29,
88 /* double binary comparator */
89 BYTECODE_OP_EQ_DOUBLE
= 30,
90 BYTECODE_OP_NE_DOUBLE
= 31,
91 BYTECODE_OP_GT_DOUBLE
= 32,
92 BYTECODE_OP_LT_DOUBLE
= 33,
93 BYTECODE_OP_GE_DOUBLE
= 34,
94 BYTECODE_OP_LE_DOUBLE
= 35,
96 /* Mixed S64-double binary comparators */
97 BYTECODE_OP_EQ_DOUBLE_S64
= 36,
98 BYTECODE_OP_NE_DOUBLE_S64
= 37,
99 BYTECODE_OP_GT_DOUBLE_S64
= 38,
100 BYTECODE_OP_LT_DOUBLE_S64
= 39,
101 BYTECODE_OP_GE_DOUBLE_S64
= 40,
102 BYTECODE_OP_LE_DOUBLE_S64
= 41,
104 BYTECODE_OP_EQ_S64_DOUBLE
= 42,
105 BYTECODE_OP_NE_S64_DOUBLE
= 43,
106 BYTECODE_OP_GT_S64_DOUBLE
= 44,
107 BYTECODE_OP_LT_S64_DOUBLE
= 45,
108 BYTECODE_OP_GE_S64_DOUBLE
= 46,
109 BYTECODE_OP_LE_S64_DOUBLE
= 47,
112 BYTECODE_OP_UNARY_PLUS
= 48,
113 BYTECODE_OP_UNARY_MINUS
= 49,
114 BYTECODE_OP_UNARY_NOT
= 50,
115 BYTECODE_OP_UNARY_PLUS_S64
= 51,
116 BYTECODE_OP_UNARY_MINUS_S64
= 52,
117 BYTECODE_OP_UNARY_NOT_S64
= 53,
118 BYTECODE_OP_UNARY_PLUS_DOUBLE
= 54,
119 BYTECODE_OP_UNARY_MINUS_DOUBLE
= 55,
120 BYTECODE_OP_UNARY_NOT_DOUBLE
= 56,
123 BYTECODE_OP_AND
= 57,
127 BYTECODE_OP_LOAD_FIELD_REF
= 59,
128 BYTECODE_OP_LOAD_FIELD_REF_STRING
= 60,
129 BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE
= 61,
130 BYTECODE_OP_LOAD_FIELD_REF_S64
= 62,
131 BYTECODE_OP_LOAD_FIELD_REF_DOUBLE
= 63,
133 /* load immediate from operand */
134 BYTECODE_OP_LOAD_STRING
= 64,
135 BYTECODE_OP_LOAD_S64
= 65,
136 BYTECODE_OP_LOAD_DOUBLE
= 66,
139 BYTECODE_OP_CAST_TO_S64
= 67,
140 BYTECODE_OP_CAST_DOUBLE_TO_S64
= 68,
141 BYTECODE_OP_CAST_NOP
= 69,
143 /* get context ref */
144 BYTECODE_OP_GET_CONTEXT_REF
= 70,
145 BYTECODE_OP_GET_CONTEXT_REF_STRING
= 71,
146 BYTECODE_OP_GET_CONTEXT_REF_S64
= 72,
147 BYTECODE_OP_GET_CONTEXT_REF_DOUBLE
= 73,
149 /* load userspace field ref */
150 BYTECODE_OP_LOAD_FIELD_REF_USER_STRING
= 74,
151 BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE
= 75,
154 * load immediate star globbing pattern (literal string)
157 BYTECODE_OP_LOAD_STAR_GLOB_STRING
= 76,
159 /* globbing pattern binary operator: apply to */
160 BYTECODE_OP_EQ_STAR_GLOB_STRING
= 77,
161 BYTECODE_OP_NE_STAR_GLOB_STRING
= 78,
164 * Instructions for recursive traversal through composed types.
166 BYTECODE_OP_GET_CONTEXT_ROOT
= 79,
167 BYTECODE_OP_GET_APP_CONTEXT_ROOT
= 80,
168 BYTECODE_OP_GET_PAYLOAD_ROOT
= 81,
170 BYTECODE_OP_GET_SYMBOL
= 82,
171 BYTECODE_OP_GET_SYMBOL_FIELD
= 83,
172 BYTECODE_OP_GET_INDEX_U16
= 84,
173 BYTECODE_OP_GET_INDEX_U64
= 85,
175 BYTECODE_OP_LOAD_FIELD
= 86,
176 BYTECODE_OP_LOAD_FIELD_S8
= 87,
177 BYTECODE_OP_LOAD_FIELD_S16
= 88,
178 BYTECODE_OP_LOAD_FIELD_S32
= 89,
179 BYTECODE_OP_LOAD_FIELD_S64
= 90,
180 BYTECODE_OP_LOAD_FIELD_U8
= 91,
181 BYTECODE_OP_LOAD_FIELD_U16
= 92,
182 BYTECODE_OP_LOAD_FIELD_U32
= 93,
183 BYTECODE_OP_LOAD_FIELD_U64
= 94,
184 BYTECODE_OP_LOAD_FIELD_STRING
= 95,
185 BYTECODE_OP_LOAD_FIELD_SEQUENCE
= 96,
186 BYTECODE_OP_LOAD_FIELD_DOUBLE
= 97,
188 BYTECODE_OP_UNARY_BIT_NOT
= 98,
190 BYTECODE_OP_RETURN_S64
= 99,
195 typedef uint8_t bytecode_opcode_t
;
198 bytecode_opcode_t op
;
200 * data to load. Size known by enum bytecode_opcode and null-term char.
203 } __attribute__((packed
));
206 bytecode_opcode_t op
;
207 } __attribute__((packed
));
210 bytecode_opcode_t op
;
211 } __attribute__((packed
));
213 /* skip_offset is absolute from start of bytecode */
215 bytecode_opcode_t op
;
216 uint16_t skip_offset
; /* bytecode insn, if skip second test */
217 } __attribute__((packed
));
220 bytecode_opcode_t op
;
221 } __attribute__((packed
));
224 bytecode_opcode_t op
;
225 } __attribute__((packed
));
227 #endif /* _BYTECODE_H */