Skip to main content

SystemInstructionHandler

Trait SystemInstructionHandler 

Source
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§

Source

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§

Source

fn handle_fence(&mut self, pred: u8, succ: u8)

Handle a fence instruction

Source

fn handle_fence_tso(&mut self)

Handle a fence.tso instruction

Source

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".

Implementors§

Source§

impl<Reg, Regs, Memory, PC, CustomError> SystemInstructionHandler<Reg, Regs, Memory, PC, CustomError> for IllegalEcallSystemInstructionHandler
where Reg: Register, Regs: RegisterFile<Reg>, PC: ProgramCounter<Reg::Type, Memory, CustomError>,