sp1_core_executor/events/syscall.rs
1use deepsize2::DeepSizeOf;
2use serde::{Deserialize, Serialize};
3
4use crate::SyscallCode;
5
6/// Syscall Event.
7///
8/// This object encapsulated the information needed to prove a syscall invocation from the CPU
9/// table. This includes its shard, clk, syscall id, arguments, other relevant information.
10#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, DeepSizeOf)]
11#[repr(C)]
12pub struct SyscallEvent {
13 /// The program counter.
14 pub pc: u64,
15 /// The next program counter.
16 pub next_pc: u64,
17 /// The clock cycle.
18 pub clk: u64,
19 /// Whether the first operand is register 0.
20 pub op_a_0: bool,
21 /// Whether this syscall should be sent.
22 pub should_send: bool,
23 /// The syscall code.
24 pub syscall_code: SyscallCode,
25 /// The syscall id.
26 pub syscall_id: u32,
27 /// The first operand value (`op_b`).
28 pub arg1: u64,
29 /// The second operand value (`op_c`).
30 pub arg2: u64,
31 /// The exit code.
32 pub exit_code: u32,
33}