sp1_core_executor/events/
syscall.rs

1use serde::{Deserialize, Serialize};
2
3use crate::syscalls::SyscallCode;
4
5use super::MemoryWriteRecord;
6
7/// Syscall Event.
8///
9/// This object encapsulated the information needed to prove a syscall invocation from the CPU
10/// table. This includes its shard, clk, syscall id, arguments, other relevant information.
11#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
12#[repr(C)]
13pub struct SyscallEvent {
14    /// The program counter.
15    pub pc: u32,
16    /// The next program counter.
17    pub next_pc: u32,
18    /// The shard number.
19    pub shard: u32,
20    /// The clock cycle.
21    pub clk: u32,
22    /// The `op_a` memory write record.
23    pub a_record: MemoryWriteRecord,
24    /// Whether the `op_a` memory write record is real.
25    pub a_record_is_real: bool,
26    /// Whether the first operand is register 0.
27    pub op_a_0: bool,
28    /// The syscall code.
29    pub syscall_code: SyscallCode,
30    /// The syscall id.
31    pub syscall_id: u32,
32    /// The first operand value (`op_b`).
33    pub arg1: u32,
34    /// The second operand value (`op_c`).
35    pub arg2: u32,
36}