Line data Source code
1 : /* Automatically generated nanopb header */
2 : /* Generated by nanopb-0.4.9.1 */
3 :
4 : #ifndef PB_ORG_SOLANA_SEALEVEL_V1_VM_PB_H_INCLUDED
5 : #define PB_ORG_SOLANA_SEALEVEL_V1_VM_PB_H_INCLUDED
6 :
7 : #include "../../../nanopb/pb_firedancer.h"
8 : #include "invoke.pb.h"
9 : #include "context.pb.h"
10 : #include "metadata.pb.h"
11 :
12 : #if PB_PROTO_HEADER_VERSION != 40
13 : #error Regenerate this file with the current version of nanopb generator.
14 : #endif
15 :
16 : /* Enum definitions */
17 : /* We are only concerned with these error kinds as the syscall/VM fuzzers don't
18 : hit higher level error kinds (e.g., transaction errors) */
19 : typedef enum fd_exec_test_err_kind {
20 : FD_EXEC_TEST_ERR_KIND_UNSPECIFIED = 0,
21 : FD_EXEC_TEST_ERR_KIND_EBPF = 1,
22 : FD_EXEC_TEST_ERR_KIND_SYSCALL = 2,
23 : FD_EXEC_TEST_ERR_KIND_INSTRUCTION = 3
24 : } fd_exec_test_err_kind_t;
25 :
26 : /* Struct definitions */
27 : /* Describes an input data region. Agave's memory mapping sets up a series of
28 : memory mapped regions, which combine to make the input data region. */
29 : typedef struct fd_exec_test_input_data_region {
30 : /* Offset from the start of the input data segment (0x400000000) */
31 : uint64_t offset;
32 : /* Content of the memory region */
33 : pb_bytes_array_t *content;
34 : /* If the memory region is writable or not */
35 : bool is_writable;
36 : } fd_exec_test_input_data_region_t;
37 :
38 : typedef PB_BYTES_ARRAY_T(1400) fd_exec_test_syscall_invocation_function_name_t;
39 : /* A single invocation of a syscall */
40 : typedef struct fd_exec_test_syscall_invocation {
41 : /* The sBPF function name of the syscall */
42 : fd_exec_test_syscall_invocation_function_name_t function_name;
43 : /* The initial portion of the heap, for example to store syscall inputs */
44 : pb_bytes_array_t *heap_prefix;
45 : /* The initial portion of the stack, for example to store syscall inputs */
46 : pb_bytes_array_t *stack_prefix;
47 : } fd_exec_test_syscall_invocation_t;
48 :
49 : /* The effects of executing a SyscallContext. */
50 : typedef struct fd_exec_test_syscall_effects {
51 : /* EBPF error code, if the invocation was unsuccessful */
52 : int64_t error;
53 : /* Registers */
54 : uint64_t r0; /* Result of a successful execution */
55 : /* CU's remaining */
56 : uint64_t cu_avail;
57 : /* Memory regions */
58 : pb_bytes_array_t *heap;
59 : pb_bytes_array_t *stack;
60 : pb_bytes_array_t *inputdata; /* deprecated, use input_data_regions */
61 : /* Current number of stack frames pushed */
62 : uint64_t frame_count;
63 : /* Syscall log */
64 : pb_bytes_array_t *log;
65 : pb_bytes_array_t *rodata;
66 : /* VM state */
67 : uint64_t pc;
68 : pb_size_t input_data_regions_count;
69 : struct fd_exec_test_input_data_region *input_data_regions;
70 : /* Error Kind (should be used along with error code) */
71 : fd_exec_test_err_kind_t error_kind;
72 : /* Output registers (to test interpreter) */
73 : uint64_t r1;
74 : uint64_t r2;
75 : uint64_t r3;
76 : uint64_t r4;
77 : uint64_t r5;
78 : uint64_t r6;
79 : uint64_t r7;
80 : uint64_t r8;
81 : uint64_t r9;
82 : uint64_t r10;
83 : } fd_exec_test_syscall_effects_t;
84 :
85 : /* Effects of fd_vm_validate */
86 : typedef struct fd_exec_test_validate_vm_effects {
87 : int32_t result;
88 : /* if result is 0 (success), protobuf will be empty!! */
89 : bool success;
90 : } fd_exec_test_validate_vm_effects_t;
91 :
92 : typedef struct fd_exec_test_return_data {
93 : pb_bytes_array_t *program_id;
94 : pb_bytes_array_t *data;
95 : } fd_exec_test_return_data_t;
96 :
97 : /* Information sufficient to allow the fuzzer to generate a fd_vm_t context for
98 : execution inside the VM (excluding the instruction context).
99 :
100 : TODO: this currently only includes fields necessary for executing syscalls,
101 : executing sBPF code will require the rest of the fields in fd_vm_t to be set. */
102 : typedef struct fd_exec_test_vm_context {
103 : /* Maximum heap size in bytes */
104 : uint64_t heap_max;
105 : /* Program read-only data */
106 : pb_bytes_array_t *rodata;
107 : /* Offset of the text section from the start of the program rodata segment
108 : (0x100000000) */
109 : uint64_t rodata_text_section_offset;
110 : /* Length of the text section in the program rodata region, in bytes. */
111 : uint64_t rodata_text_section_length;
112 : /* The input data regions */
113 : pb_size_t input_data_regions_count;
114 : struct fd_exec_test_input_data_region *input_data_regions;
115 : /* Registers */
116 : uint64_t r0;
117 : uint64_t r1;
118 : uint64_t r2;
119 : uint64_t r3;
120 : uint64_t r4;
121 : uint64_t r5;
122 : uint64_t r6;
123 : uint64_t r7;
124 : uint64_t r8;
125 : uint64_t r9;
126 : uint64_t r10;
127 : uint64_t r11;
128 : bool check_align;
129 : bool check_size;
130 : /* for vm execution */
131 : uint64_t entry_pc;
132 : /* Bitset of valid call destinations (in terms of pc).
133 : This model is used by the Firedancer VM for CALL_IMMs */
134 : pb_bytes_array_t *call_whitelist;
135 : bool tracing_enabled;
136 : bool has_return_data;
137 : fd_exec_test_return_data_t return_data;
138 : /* SBPF version */
139 : uint32_t sbpf_version;
140 : } fd_exec_test_vm_context_t;
141 :
142 : /* Execution context for a VM Syscall execution. */
143 : typedef struct fd_exec_test_syscall_context {
144 : bool has_vm_ctx;
145 : fd_exec_test_vm_context_t vm_ctx;
146 : /* InflightInstruction - contain temporary fields that live for the duration of an instructions execution, and is needed if we have overhanging context from a previous instruction */
147 : bool has_instr_ctx;
148 : fd_exec_test_instr_context_t instr_ctx;
149 : bool has_syscall_invocation;
150 : fd_exec_test_syscall_invocation_t syscall_invocation;
151 : /* For CPI, we want to control the effects of a program invocation */
152 : bool has_exec_effects;
153 : fd_exec_test_instr_effects_t exec_effects;
154 : } fd_exec_test_syscall_context_t;
155 :
156 : /* A syscall processing test fixture. */
157 : typedef struct fd_exec_test_syscall_fixture {
158 : bool has_metadata;
159 : fd_exec_test_fixture_metadata_t metadata;
160 : bool has_input;
161 : fd_exec_test_syscall_context_t input;
162 : bool has_output;
163 : fd_exec_test_syscall_effects_t output;
164 : } fd_exec_test_syscall_fixture_t;
165 :
166 : /* Everything needed to setup a fd_vm_t */
167 : typedef struct fd_exec_test_full_vm_context {
168 : bool has_vm_ctx;
169 : fd_exec_test_vm_context_t vm_ctx;
170 : /* InstrContext instr_ctx = 2; */
171 : bool has_features;
172 : fd_exec_test_feature_set_t features;
173 : } fd_exec_test_full_vm_context_t;
174 :
175 : /* Fixture for fd_vm_validate fuzz harness */
176 : typedef struct fd_exec_test_validate_vm_fixture {
177 : bool has_metadata;
178 : fd_exec_test_fixture_metadata_t metadata;
179 : bool has_input;
180 : fd_exec_test_full_vm_context_t input;
181 : bool has_output;
182 : fd_exec_test_validate_vm_effects_t output;
183 : } fd_exec_test_validate_vm_fixture_t;
184 :
185 :
186 : #ifdef __cplusplus
187 : extern "C" {
188 : #endif
189 :
190 : /* Helper constants for enums */
191 333126 : #define _FD_EXEC_TEST_ERR_KIND_MIN FD_EXEC_TEST_ERR_KIND_UNSPECIFIED
192 : #define _FD_EXEC_TEST_ERR_KIND_MAX FD_EXEC_TEST_ERR_KIND_INSTRUCTION
193 : #define _FD_EXEC_TEST_ERR_KIND_ARRAYSIZE ((fd_exec_test_err_kind_t)(FD_EXEC_TEST_ERR_KIND_INSTRUCTION+1))
194 :
195 :
196 :
197 :
198 :
199 : #define fd_exec_test_syscall_effects_t_error_kind_ENUMTYPE fd_exec_test_err_kind_t
200 :
201 :
202 :
203 :
204 :
205 :
206 :
207 : /* Initializer values for message structs */
208 : #define FD_EXEC_TEST_INPUT_DATA_REGION_INIT_DEFAULT {0, NULL, 0}
209 : #define FD_EXEC_TEST_VM_CONTEXT_INIT_DEFAULT {0, NULL, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, false, FD_EXEC_TEST_RETURN_DATA_INIT_DEFAULT, 0}
210 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_INIT_DEFAULT {{0, {0}}, NULL, NULL}
211 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_INIT_DEFAULT {false, FD_EXEC_TEST_VM_CONTEXT_INIT_DEFAULT, false, FD_EXEC_TEST_INSTR_CONTEXT_INIT_DEFAULT, false, FD_EXEC_TEST_SYSCALL_INVOCATION_INIT_DEFAULT, false, FD_EXEC_TEST_INSTR_EFFECTS_INIT_DEFAULT}
212 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_INIT_DEFAULT {0, 0, 0, NULL, NULL, NULL, 0, NULL, NULL, 0, 0, NULL, _FD_EXEC_TEST_ERR_KIND_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
213 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_INIT_DEFAULT {false, FD_EXEC_TEST_FIXTURE_METADATA_INIT_DEFAULT, false, FD_EXEC_TEST_SYSCALL_CONTEXT_INIT_DEFAULT, false, FD_EXEC_TEST_SYSCALL_EFFECTS_INIT_DEFAULT}
214 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_INIT_DEFAULT {false, FD_EXEC_TEST_VM_CONTEXT_INIT_DEFAULT, false, FD_EXEC_TEST_FEATURE_SET_INIT_DEFAULT}
215 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_INIT_DEFAULT {0, 0}
216 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_INIT_DEFAULT {false, FD_EXEC_TEST_FIXTURE_METADATA_INIT_DEFAULT, false, FD_EXEC_TEST_FULL_VM_CONTEXT_INIT_DEFAULT, false, FD_EXEC_TEST_VALIDATE_VM_EFFECTS_INIT_DEFAULT}
217 : #define FD_EXEC_TEST_RETURN_DATA_INIT_DEFAULT {NULL, NULL}
218 : #define FD_EXEC_TEST_INPUT_DATA_REGION_INIT_ZERO {0, NULL, 0}
219 : #define FD_EXEC_TEST_VM_CONTEXT_INIT_ZERO {0, NULL, 0, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, false, FD_EXEC_TEST_RETURN_DATA_INIT_ZERO, 0}
220 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_INIT_ZERO {{0, {0}}, NULL, NULL}
221 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_INIT_ZERO {false, FD_EXEC_TEST_VM_CONTEXT_INIT_ZERO, false, FD_EXEC_TEST_INSTR_CONTEXT_INIT_ZERO, false, FD_EXEC_TEST_SYSCALL_INVOCATION_INIT_ZERO, false, FD_EXEC_TEST_INSTR_EFFECTS_INIT_ZERO}
222 333126 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_INIT_ZERO {0, 0, 0, NULL, NULL, NULL, 0, NULL, NULL, 0, 0, NULL, _FD_EXEC_TEST_ERR_KIND_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
223 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_INIT_ZERO {false, FD_EXEC_TEST_FIXTURE_METADATA_INIT_ZERO, false, FD_EXEC_TEST_SYSCALL_CONTEXT_INIT_ZERO, false, FD_EXEC_TEST_SYSCALL_EFFECTS_INIT_ZERO}
224 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_INIT_ZERO {false, FD_EXEC_TEST_VM_CONTEXT_INIT_ZERO, false, FD_EXEC_TEST_FEATURE_SET_INIT_ZERO}
225 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_INIT_ZERO {0, 0}
226 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_INIT_ZERO {false, FD_EXEC_TEST_FIXTURE_METADATA_INIT_ZERO, false, FD_EXEC_TEST_FULL_VM_CONTEXT_INIT_ZERO, false, FD_EXEC_TEST_VALIDATE_VM_EFFECTS_INIT_ZERO}
227 : #define FD_EXEC_TEST_RETURN_DATA_INIT_ZERO {NULL, NULL}
228 :
229 : /* Field tags (for use in manual encoding/decoding) */
230 : #define FD_EXEC_TEST_INPUT_DATA_REGION_OFFSET_TAG 1
231 : #define FD_EXEC_TEST_INPUT_DATA_REGION_CONTENT_TAG 2
232 : #define FD_EXEC_TEST_INPUT_DATA_REGION_IS_WRITABLE_TAG 3
233 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_FUNCTION_NAME_TAG 1
234 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_HEAP_PREFIX_TAG 2
235 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_STACK_PREFIX_TAG 3
236 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_ERROR_TAG 1
237 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R0_TAG 2
238 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_CU_AVAIL_TAG 3
239 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_HEAP_TAG 4
240 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_STACK_TAG 5
241 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_INPUTDATA_TAG 6
242 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_FRAME_COUNT_TAG 7
243 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_LOG_TAG 8
244 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_RODATA_TAG 9
245 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_PC_TAG 10
246 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_INPUT_DATA_REGIONS_TAG 11
247 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_ERROR_KIND_TAG 12
248 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R1_TAG 107
249 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R2_TAG 108
250 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R3_TAG 109
251 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R4_TAG 110
252 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R5_TAG 111
253 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R6_TAG 112
254 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R7_TAG 113
255 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R8_TAG 114
256 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R9_TAG 115
257 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_R10_TAG 116
258 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_RESULT_TAG 1
259 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_SUCCESS_TAG 2
260 : #define FD_EXEC_TEST_RETURN_DATA_PROGRAM_ID_TAG 1
261 : #define FD_EXEC_TEST_RETURN_DATA_DATA_TAG 2
262 : #define FD_EXEC_TEST_VM_CONTEXT_HEAP_MAX_TAG 1
263 : #define FD_EXEC_TEST_VM_CONTEXT_RODATA_TAG 2
264 : #define FD_EXEC_TEST_VM_CONTEXT_RODATA_TEXT_SECTION_OFFSET_TAG 3
265 : #define FD_EXEC_TEST_VM_CONTEXT_RODATA_TEXT_SECTION_LENGTH_TAG 4
266 : #define FD_EXEC_TEST_VM_CONTEXT_INPUT_DATA_REGIONS_TAG 5
267 : #define FD_EXEC_TEST_VM_CONTEXT_R0_TAG 6
268 : #define FD_EXEC_TEST_VM_CONTEXT_R1_TAG 7
269 : #define FD_EXEC_TEST_VM_CONTEXT_R2_TAG 8
270 : #define FD_EXEC_TEST_VM_CONTEXT_R3_TAG 9
271 : #define FD_EXEC_TEST_VM_CONTEXT_R4_TAG 10
272 : #define FD_EXEC_TEST_VM_CONTEXT_R5_TAG 11
273 : #define FD_EXEC_TEST_VM_CONTEXT_R6_TAG 12
274 : #define FD_EXEC_TEST_VM_CONTEXT_R7_TAG 13
275 : #define FD_EXEC_TEST_VM_CONTEXT_R8_TAG 14
276 : #define FD_EXEC_TEST_VM_CONTEXT_R9_TAG 15
277 : #define FD_EXEC_TEST_VM_CONTEXT_R10_TAG 16
278 : #define FD_EXEC_TEST_VM_CONTEXT_R11_TAG 17
279 : #define FD_EXEC_TEST_VM_CONTEXT_CHECK_ALIGN_TAG 18
280 : #define FD_EXEC_TEST_VM_CONTEXT_CHECK_SIZE_TAG 19
281 : #define FD_EXEC_TEST_VM_CONTEXT_ENTRY_PC_TAG 20
282 : #define FD_EXEC_TEST_VM_CONTEXT_CALL_WHITELIST_TAG 21
283 : #define FD_EXEC_TEST_VM_CONTEXT_TRACING_ENABLED_TAG 22
284 : #define FD_EXEC_TEST_VM_CONTEXT_RETURN_DATA_TAG 23
285 : #define FD_EXEC_TEST_VM_CONTEXT_SBPF_VERSION_TAG 24
286 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_VM_CTX_TAG 1
287 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_INSTR_CTX_TAG 2
288 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_SYSCALL_INVOCATION_TAG 3
289 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_EXEC_EFFECTS_TAG 4
290 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_METADATA_TAG 1
291 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_INPUT_TAG 2
292 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_OUTPUT_TAG 3
293 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_VM_CTX_TAG 1
294 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_FEATURES_TAG 3
295 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_METADATA_TAG 1
296 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_INPUT_TAG 2
297 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_OUTPUT_TAG 3
298 :
299 : /* Struct field encoding specification for nanopb */
300 : #define FD_EXEC_TEST_INPUT_DATA_REGION_FIELDLIST(X, a) \
301 : X(a, STATIC, SINGULAR, UINT64, offset, 1) \
302 : X(a, POINTER, SINGULAR, BYTES, content, 2) \
303 : X(a, STATIC, SINGULAR, BOOL, is_writable, 3)
304 : #define FD_EXEC_TEST_INPUT_DATA_REGION_CALLBACK NULL
305 : #define FD_EXEC_TEST_INPUT_DATA_REGION_DEFAULT NULL
306 :
307 : #define FD_EXEC_TEST_VM_CONTEXT_FIELDLIST(X, a) \
308 : X(a, STATIC, SINGULAR, UINT64, heap_max, 1) \
309 : X(a, POINTER, SINGULAR, BYTES, rodata, 2) \
310 : X(a, STATIC, SINGULAR, UINT64, rodata_text_section_offset, 3) \
311 : X(a, STATIC, SINGULAR, UINT64, rodata_text_section_length, 4) \
312 : X(a, POINTER, REPEATED, MESSAGE, input_data_regions, 5) \
313 : X(a, STATIC, SINGULAR, UINT64, r0, 6) \
314 : X(a, STATIC, SINGULAR, UINT64, r1, 7) \
315 : X(a, STATIC, SINGULAR, UINT64, r2, 8) \
316 : X(a, STATIC, SINGULAR, UINT64, r3, 9) \
317 : X(a, STATIC, SINGULAR, UINT64, r4, 10) \
318 : X(a, STATIC, SINGULAR, UINT64, r5, 11) \
319 : X(a, STATIC, SINGULAR, UINT64, r6, 12) \
320 : X(a, STATIC, SINGULAR, UINT64, r7, 13) \
321 : X(a, STATIC, SINGULAR, UINT64, r8, 14) \
322 : X(a, STATIC, SINGULAR, UINT64, r9, 15) \
323 : X(a, STATIC, SINGULAR, UINT64, r10, 16) \
324 : X(a, STATIC, SINGULAR, UINT64, r11, 17) \
325 : X(a, STATIC, SINGULAR, BOOL, check_align, 18) \
326 : X(a, STATIC, SINGULAR, BOOL, check_size, 19) \
327 : X(a, STATIC, SINGULAR, UINT64, entry_pc, 20) \
328 : X(a, POINTER, SINGULAR, BYTES, call_whitelist, 21) \
329 : X(a, STATIC, SINGULAR, BOOL, tracing_enabled, 22) \
330 : X(a, STATIC, OPTIONAL, MESSAGE, return_data, 23) \
331 : X(a, STATIC, SINGULAR, UINT32, sbpf_version, 24)
332 : #define FD_EXEC_TEST_VM_CONTEXT_CALLBACK NULL
333 : #define FD_EXEC_TEST_VM_CONTEXT_DEFAULT NULL
334 : #define fd_exec_test_vm_context_t_input_data_regions_MSGTYPE fd_exec_test_input_data_region_t
335 : #define fd_exec_test_vm_context_t_return_data_MSGTYPE fd_exec_test_return_data_t
336 :
337 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_FIELDLIST(X, a) \
338 : X(a, STATIC, SINGULAR, BYTES, function_name, 1) \
339 : X(a, POINTER, SINGULAR, BYTES, heap_prefix, 2) \
340 : X(a, POINTER, SINGULAR, BYTES, stack_prefix, 3)
341 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_CALLBACK NULL
342 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_DEFAULT NULL
343 :
344 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_FIELDLIST(X, a) \
345 : X(a, STATIC, OPTIONAL, MESSAGE, vm_ctx, 1) \
346 : X(a, STATIC, OPTIONAL, MESSAGE, instr_ctx, 2) \
347 : X(a, STATIC, OPTIONAL, MESSAGE, syscall_invocation, 3) \
348 : X(a, STATIC, OPTIONAL, MESSAGE, exec_effects, 4)
349 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_CALLBACK NULL
350 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_DEFAULT NULL
351 : #define fd_exec_test_syscall_context_t_vm_ctx_MSGTYPE fd_exec_test_vm_context_t
352 : #define fd_exec_test_syscall_context_t_instr_ctx_MSGTYPE fd_exec_test_instr_context_t
353 : #define fd_exec_test_syscall_context_t_syscall_invocation_MSGTYPE fd_exec_test_syscall_invocation_t
354 : #define fd_exec_test_syscall_context_t_exec_effects_MSGTYPE fd_exec_test_instr_effects_t
355 :
356 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_FIELDLIST(X, a) \
357 : X(a, STATIC, SINGULAR, INT64, error, 1) \
358 : X(a, STATIC, SINGULAR, UINT64, r0, 2) \
359 : X(a, STATIC, SINGULAR, UINT64, cu_avail, 3) \
360 : X(a, POINTER, SINGULAR, BYTES, heap, 4) \
361 : X(a, POINTER, SINGULAR, BYTES, stack, 5) \
362 : X(a, POINTER, SINGULAR, BYTES, inputdata, 6) \
363 : X(a, STATIC, SINGULAR, UINT64, frame_count, 7) \
364 : X(a, POINTER, SINGULAR, BYTES, log, 8) \
365 : X(a, POINTER, SINGULAR, BYTES, rodata, 9) \
366 : X(a, STATIC, SINGULAR, UINT64, pc, 10) \
367 : X(a, POINTER, REPEATED, MESSAGE, input_data_regions, 11) \
368 : X(a, STATIC, SINGULAR, UENUM, error_kind, 12) \
369 : X(a, STATIC, SINGULAR, UINT64, r1, 107) \
370 : X(a, STATIC, SINGULAR, UINT64, r2, 108) \
371 : X(a, STATIC, SINGULAR, UINT64, r3, 109) \
372 : X(a, STATIC, SINGULAR, UINT64, r4, 110) \
373 : X(a, STATIC, SINGULAR, UINT64, r5, 111) \
374 : X(a, STATIC, SINGULAR, UINT64, r6, 112) \
375 : X(a, STATIC, SINGULAR, UINT64, r7, 113) \
376 : X(a, STATIC, SINGULAR, UINT64, r8, 114) \
377 : X(a, STATIC, SINGULAR, UINT64, r9, 115) \
378 : X(a, STATIC, SINGULAR, UINT64, r10, 116)
379 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_CALLBACK NULL
380 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_DEFAULT NULL
381 : #define fd_exec_test_syscall_effects_t_input_data_regions_MSGTYPE fd_exec_test_input_data_region_t
382 :
383 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_FIELDLIST(X, a) \
384 : X(a, STATIC, OPTIONAL, MESSAGE, metadata, 1) \
385 : X(a, STATIC, OPTIONAL, MESSAGE, input, 2) \
386 : X(a, STATIC, OPTIONAL, MESSAGE, output, 3)
387 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_CALLBACK NULL
388 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_DEFAULT NULL
389 : #define fd_exec_test_syscall_fixture_t_metadata_MSGTYPE fd_exec_test_fixture_metadata_t
390 : #define fd_exec_test_syscall_fixture_t_input_MSGTYPE fd_exec_test_syscall_context_t
391 : #define fd_exec_test_syscall_fixture_t_output_MSGTYPE fd_exec_test_syscall_effects_t
392 :
393 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_FIELDLIST(X, a) \
394 : X(a, STATIC, OPTIONAL, MESSAGE, vm_ctx, 1) \
395 : X(a, STATIC, OPTIONAL, MESSAGE, features, 3)
396 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_CALLBACK NULL
397 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_DEFAULT NULL
398 : #define fd_exec_test_full_vm_context_t_vm_ctx_MSGTYPE fd_exec_test_vm_context_t
399 : #define fd_exec_test_full_vm_context_t_features_MSGTYPE fd_exec_test_feature_set_t
400 :
401 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_FIELDLIST(X, a) \
402 : X(a, STATIC, SINGULAR, INT32, result, 1) \
403 : X(a, STATIC, SINGULAR, BOOL, success, 2)
404 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_CALLBACK NULL
405 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_DEFAULT NULL
406 :
407 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_FIELDLIST(X, a) \
408 : X(a, STATIC, OPTIONAL, MESSAGE, metadata, 1) \
409 : X(a, STATIC, OPTIONAL, MESSAGE, input, 2) \
410 : X(a, STATIC, OPTIONAL, MESSAGE, output, 3)
411 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_CALLBACK NULL
412 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_DEFAULT NULL
413 : #define fd_exec_test_validate_vm_fixture_t_metadata_MSGTYPE fd_exec_test_fixture_metadata_t
414 : #define fd_exec_test_validate_vm_fixture_t_input_MSGTYPE fd_exec_test_full_vm_context_t
415 : #define fd_exec_test_validate_vm_fixture_t_output_MSGTYPE fd_exec_test_validate_vm_effects_t
416 :
417 : #define FD_EXEC_TEST_RETURN_DATA_FIELDLIST(X, a) \
418 : X(a, POINTER, SINGULAR, BYTES, program_id, 1) \
419 : X(a, POINTER, SINGULAR, BYTES, data, 2)
420 : #define FD_EXEC_TEST_RETURN_DATA_CALLBACK NULL
421 : #define FD_EXEC_TEST_RETURN_DATA_DEFAULT NULL
422 :
423 : extern const pb_msgdesc_t fd_exec_test_input_data_region_t_msg;
424 : extern const pb_msgdesc_t fd_exec_test_vm_context_t_msg;
425 : extern const pb_msgdesc_t fd_exec_test_syscall_invocation_t_msg;
426 : extern const pb_msgdesc_t fd_exec_test_syscall_context_t_msg;
427 : extern const pb_msgdesc_t fd_exec_test_syscall_effects_t_msg;
428 : extern const pb_msgdesc_t fd_exec_test_syscall_fixture_t_msg;
429 : extern const pb_msgdesc_t fd_exec_test_full_vm_context_t_msg;
430 : extern const pb_msgdesc_t fd_exec_test_validate_vm_effects_t_msg;
431 : extern const pb_msgdesc_t fd_exec_test_validate_vm_fixture_t_msg;
432 : extern const pb_msgdesc_t fd_exec_test_return_data_t_msg;
433 :
434 : /* Defines for backwards compatibility with code written before nanopb-0.4.0 */
435 : #define FD_EXEC_TEST_INPUT_DATA_REGION_FIELDS &fd_exec_test_input_data_region_t_msg
436 : #define FD_EXEC_TEST_VM_CONTEXT_FIELDS &fd_exec_test_vm_context_t_msg
437 : #define FD_EXEC_TEST_SYSCALL_INVOCATION_FIELDS &fd_exec_test_syscall_invocation_t_msg
438 : #define FD_EXEC_TEST_SYSCALL_CONTEXT_FIELDS &fd_exec_test_syscall_context_t_msg
439 : #define FD_EXEC_TEST_SYSCALL_EFFECTS_FIELDS &fd_exec_test_syscall_effects_t_msg
440 : #define FD_EXEC_TEST_SYSCALL_FIXTURE_FIELDS &fd_exec_test_syscall_fixture_t_msg
441 : #define FD_EXEC_TEST_FULL_VM_CONTEXT_FIELDS &fd_exec_test_full_vm_context_t_msg
442 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_FIELDS &fd_exec_test_validate_vm_effects_t_msg
443 : #define FD_EXEC_TEST_VALIDATE_VM_FIXTURE_FIELDS &fd_exec_test_validate_vm_fixture_t_msg
444 : #define FD_EXEC_TEST_RETURN_DATA_FIELDS &fd_exec_test_return_data_t_msg
445 :
446 : /* Maximum encoded size of messages (where known) */
447 : /* fd_exec_test_InputDataRegion_size depends on runtime parameters */
448 : /* fd_exec_test_VmContext_size depends on runtime parameters */
449 : /* fd_exec_test_SyscallInvocation_size depends on runtime parameters */
450 : /* fd_exec_test_SyscallContext_size depends on runtime parameters */
451 : /* fd_exec_test_SyscallEffects_size depends on runtime parameters */
452 : /* fd_exec_test_SyscallFixture_size depends on runtime parameters */
453 : /* fd_exec_test_FullVmContext_size depends on runtime parameters */
454 : /* fd_exec_test_ValidateVmFixture_size depends on runtime parameters */
455 : /* fd_exec_test_ReturnData_size depends on runtime parameters */
456 : #define FD_EXEC_TEST_VALIDATE_VM_EFFECTS_SIZE 13
457 : #define ORG_SOLANA_SEALEVEL_V1_VM_PB_H_MAX_SIZE FD_EXEC_TEST_VALIDATE_VM_EFFECTS_SIZE
458 :
459 : /* Mapping from canonical names (mangle_names or overridden package name) */
460 : #define org_solana_sealevel_v1_ErrKind fd_exec_test_ErrKind
461 : #define org_solana_sealevel_v1_InputDataRegion fd_exec_test_InputDataRegion
462 : #define org_solana_sealevel_v1_VmContext fd_exec_test_VmContext
463 : #define org_solana_sealevel_v1_SyscallInvocation fd_exec_test_SyscallInvocation
464 : #define org_solana_sealevel_v1_SyscallContext fd_exec_test_SyscallContext
465 : #define org_solana_sealevel_v1_SyscallEffects fd_exec_test_SyscallEffects
466 : #define org_solana_sealevel_v1_SyscallFixture fd_exec_test_SyscallFixture
467 : #define org_solana_sealevel_v1_FullVmContext fd_exec_test_FullVmContext
468 : #define org_solana_sealevel_v1_ValidateVmEffects fd_exec_test_ValidateVmEffects
469 : #define org_solana_sealevel_v1_ValidateVmFixture fd_exec_test_ValidateVmFixture
470 : #define org_solana_sealevel_v1_ReturnData fd_exec_test_ReturnData
471 : #define _ORG_SOLANA_SEALEVEL_V1_ERR_KIND_MIN _FD_EXEC_TEST_ERR_KIND_MIN
472 : #define _ORG_SOLANA_SEALEVEL_V1_ERR_KIND_MAX _FD_EXEC_TEST_ERR_KIND_MAX
473 : #define _ORG_SOLANA_SEALEVEL_V1_ERR_KIND_ARRAYSIZE _FD_EXEC_TEST_ERR_KIND_ARRAYSIZE
474 : #define ORG_SOLANA_SEALEVEL_V1_INPUT_DATA_REGION_INIT_DEFAULT FD_EXEC_TEST_INPUT_DATA_REGION_INIT_DEFAULT
475 : #define ORG_SOLANA_SEALEVEL_V1_VM_CONTEXT_INIT_DEFAULT FD_EXEC_TEST_VM_CONTEXT_INIT_DEFAULT
476 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_INVOCATION_INIT_DEFAULT FD_EXEC_TEST_SYSCALL_INVOCATION_INIT_DEFAULT
477 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_CONTEXT_INIT_DEFAULT FD_EXEC_TEST_SYSCALL_CONTEXT_INIT_DEFAULT
478 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_EFFECTS_INIT_DEFAULT FD_EXEC_TEST_SYSCALL_EFFECTS_INIT_DEFAULT
479 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_FIXTURE_INIT_DEFAULT FD_EXEC_TEST_SYSCALL_FIXTURE_INIT_DEFAULT
480 : #define ORG_SOLANA_SEALEVEL_V1_FULL_VM_CONTEXT_INIT_DEFAULT FD_EXEC_TEST_FULL_VM_CONTEXT_INIT_DEFAULT
481 : #define ORG_SOLANA_SEALEVEL_V1_VALIDATE_VM_EFFECTS_INIT_DEFAULT FD_EXEC_TEST_VALIDATE_VM_EFFECTS_INIT_DEFAULT
482 : #define ORG_SOLANA_SEALEVEL_V1_VALIDATE_VM_FIXTURE_INIT_DEFAULT FD_EXEC_TEST_VALIDATE_VM_FIXTURE_INIT_DEFAULT
483 : #define ORG_SOLANA_SEALEVEL_V1_RETURN_DATA_INIT_DEFAULT FD_EXEC_TEST_RETURN_DATA_INIT_DEFAULT
484 : #define ORG_SOLANA_SEALEVEL_V1_INPUT_DATA_REGION_INIT_ZERO FD_EXEC_TEST_INPUT_DATA_REGION_INIT_ZERO
485 : #define ORG_SOLANA_SEALEVEL_V1_VM_CONTEXT_INIT_ZERO FD_EXEC_TEST_VM_CONTEXT_INIT_ZERO
486 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_INVOCATION_INIT_ZERO FD_EXEC_TEST_SYSCALL_INVOCATION_INIT_ZERO
487 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_CONTEXT_INIT_ZERO FD_EXEC_TEST_SYSCALL_CONTEXT_INIT_ZERO
488 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_EFFECTS_INIT_ZERO FD_EXEC_TEST_SYSCALL_EFFECTS_INIT_ZERO
489 : #define ORG_SOLANA_SEALEVEL_V1_SYSCALL_FIXTURE_INIT_ZERO FD_EXEC_TEST_SYSCALL_FIXTURE_INIT_ZERO
490 : #define ORG_SOLANA_SEALEVEL_V1_FULL_VM_CONTEXT_INIT_ZERO FD_EXEC_TEST_FULL_VM_CONTEXT_INIT_ZERO
491 : #define ORG_SOLANA_SEALEVEL_V1_VALIDATE_VM_EFFECTS_INIT_ZERO FD_EXEC_TEST_VALIDATE_VM_EFFECTS_INIT_ZERO
492 : #define ORG_SOLANA_SEALEVEL_V1_VALIDATE_VM_FIXTURE_INIT_ZERO FD_EXEC_TEST_VALIDATE_VM_FIXTURE_INIT_ZERO
493 : #define ORG_SOLANA_SEALEVEL_V1_RETURN_DATA_INIT_ZERO FD_EXEC_TEST_RETURN_DATA_INIT_ZERO
494 :
495 : #ifdef __cplusplus
496 : } /* extern "C" */
497 : #endif
498 :
499 : #endif
|