pub trait SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError = CustomErrorPlaceholder>where
Reg: Register,
Regs: RegisterFile<Reg>,{
// Required method
fn handle_ecall(
&mut self,
regs: &mut Regs,
memory: &mut Memory,
program_counter: &mut PC,
) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>;
// Provided methods
fn handle_fence(&mut self, pred: u8, succ: u8) { ... }
fn handle_fence_tso(&mut self) { ... }
fn handle_ebreak(
&mut self,
regs: &mut Regs,
memory: &mut Memory,
pc: Reg::Type,
) { ... }
}Expand description
Custom handler for system instructions ecall and ebreak
Required Methods§
Sourcefn handle_ecall(
&mut self,
regs: &mut Regs,
memory: &mut Memory,
program_counter: &mut PC,
) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
fn handle_ecall( &mut self, regs: &mut Regs, memory: &mut Memory, program_counter: &mut PC, ) -> Result<ControlFlow<()>, ExecutionError<Reg::Type, CustomError>>
Handle an ecall instruction
Provided Methods§
Sourcefn handle_fence(&mut self, pred: u8, succ: u8)
fn handle_fence(&mut self, pred: u8, succ: u8)
Handle a fence instruction
Sourcefn handle_fence_tso(&mut self)
fn handle_fence_tso(&mut self)
Handle a fence.tso instruction
Sourcefn handle_ebreak(&mut self, regs: &mut Regs, memory: &mut Memory, pc: Reg::Type)
fn handle_ebreak(&mut self, regs: &mut Regs, memory: &mut Memory, pc: Reg::Type)
Handle an ebreak instruction.
NOTE: the program counter here is the current value, meaning it is already incremented past the instruction itself.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".