pub trait CpuOps {
// Required methods
fn read_reg(&self, reg: Register) -> u32;
fn write_reg(&mut self, reg: Register, value: u32);
fn get_ccr(&self) -> u8;
fn set_ccr(&mut self, ccr: u8);
// Provided methods
fn capture_extended_context(&self) -> Option<M68kExtendedContext> { ... }
fn restore_extended_context(&mut self, _context: &M68kExtendedContext) { ... }
}Expand description
Register interface used by the trap dispatcher.
Keeping handlers generic over this subset lets them operate on both the
production M68kCpu backend and test doubles without exposing the full
m68k architectural state.
Required Methods§
Provided Methods§
Sourcefn capture_extended_context(&self) -> Option<M68kExtendedContext>
fn capture_extended_context(&self) -> Option<M68kExtendedContext>
Capture additional architectural task state when this adapter has it. Register-only adapters retain their existing integer/CCR behavior.
Sourcefn restore_extended_context(&mut self, _context: &M68kExtendedContext)
fn restore_extended_context(&mut self, _context: &M68kExtendedContext)
Restore state captured by this adapter before installing A7: restoring
SR can change the selected stack bank. Register-only adapters have no
additional state; backends returning Some must implement this method.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".