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§
Sourcefn handle_ecall(
&mut self,
regs: &mut Registers<Reg>,
memory: &mut Memory,
program_counter: &mut PC,
) -> Result<ControlFlow<()>, ExecutionError<Rv64Instruction<Reg>, CustomError>>
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§
Sourcefn handle_ebreak(
&mut self,
_regs: &mut Registers<Reg>,
_memory: &mut Memory,
_pc: Reg::Type,
_instruction: Rv64Instruction<Reg>,
)
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.