Rv64SystemInstructionHandler

Trait Rv64SystemInstructionHandler 

Source
pub trait Rv64SystemInstructionHandler<Reg, Memory, PC, CustomError>
where Reg: Register<Type = u64>, [(); Reg::N]:, PC: ProgramCounter<Reg::Type, Memory, CustomError>, CustomError: Display,
{ // Required method fn handle_ecall( &mut self, regs: &mut Registers<Reg>, memory: &mut Memory, program_counter: &mut PC, ) -> Result<ControlFlow<()>, ExecutionError<Rv64Instruction<Reg>, CustomError>>; // Provided method fn handle_ebreak( &mut self, _regs: &mut Registers<Reg>, _memory: &mut Memory, _pc: Reg::Type, _instruction: Rv64Instruction<Reg>, ) { ... } }
Expand description

Custom handler for system instructions ecall and ebreak

Required Methods§

Source

fn handle_ecall( &mut self, regs: &mut Registers<Reg>, memory: &mut Memory, program_counter: &mut PC, ) -> Result<ControlFlow<()>, ExecutionError<Rv64Instruction<Reg>, CustomError>>

Handle an ecall instruction.

NOTE: the program counter here is the current value, meaning it is already incremented past the instruction itself.

Provided Methods§

Source

fn handle_ebreak( &mut self, _regs: &mut Registers<Reg>, _memory: &mut Memory, _pc: Reg::Type, _instruction: Rv64Instruction<Reg>, )

Handle an ebreak instruction.

NOTE: the program counter here is the current value, meaning it is already incremented past the instruction itself.

Implementors§

Source§

impl<Reg, Memory, PC, CustomError> Rv64SystemInstructionHandler<Reg, Memory, PC, CustomError> for BasicRv64SystemInstructionHandler<Rv64Instruction<Reg>>
where Reg: Register<Type = u64>, [(); Reg::N]:, Memory: VirtualMemory, PC: ProgramCounter<Reg::Type, Memory, CustomError>, CustomError: Display,