Expand description
EcallHandler trait: how the execution engine dispatches ecalls
to the integration layer.
Per architecture: the engine knows there are ecalls and that each
carries a kind (PVM ecall opcode 3 with no immediate, vs PVM
ecalli opcode 10 with a u32 immediate). It doesn’t know what the
kind means. The caller supplies an EcallHandler that
interprets ecalls as MGMT operations, host-call selectors, CALL /
HALT / yield transfers, etc.
The handler may either:
-
Return
Continue— engine continues at the current PC (already advanced past the ecall instruction before the handler runs). Used for purely-stateful ecalls (MGMT_COPY, MGMT_MOVE, etc.) that just mutateregs/memand resume. -
Return
Exit(reason)— engine returns thisExitReasonfromexecute(). Used for control-flow ecalls (HALT, yield, CALL into another Instance) that require the integration layer.
Structs§
- Panicking
Handler - A no-op handler: every ecall exits with
Panic. Useful as a default for tests where the engine isn’t supposed to encounter ecalls.
Enums§
- Ecall
Kind - Which PVM ecall opcode triggered this invocation.
- Ecall
Result - Result of handling one ecall.
Traits§
- Ecall
Handler - Trait the integration layer implements to interpret ecalls.