#[repr(C)]pub struct TrapFrame {
pub regs: GeneralRegisters,
pub prmd: usize,
pub era: usize,
}Expand description
Saved registers when a trap (interrupt or exception) occurs.
Fields§
§regs: GeneralRegistersAll general registers.
prmd: usizePre-exception Mode Information
era: usizeException Return Address
Implementations§
Source§impl TrapFrame
impl TrapFrame
Sourcepub const fn set_retval(&mut self, a0: usize)
pub const fn set_retval(&mut self, a0: usize)
Sets the return value register.
Source§impl TrapFrame
impl TrapFrame
Sourcepub unsafe fn emulate_unaligned(&mut self) -> Result<(), UnalignedError>
pub unsafe fn emulate_unaligned(&mut self) -> Result<(), UnalignedError>
Emulates an unaligned memory access triggered by a trap.
§Safety
This function uses raw pointers and inline assembly to handle unaligned memory accesses, so it must only be called in a valid trap context with a properly initialized TrapFrame.
Trait Implementations§
impl Copy for TrapFrame
Auto Trait Implementations§
impl Freeze for TrapFrame
impl RefUnwindSafe for TrapFrame
impl Send for TrapFrame
impl Sync for TrapFrame
impl Unpin for TrapFrame
impl UnsafeUnpin for TrapFrame
impl UnwindSafe for TrapFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more