#[repr(C)]pub struct UserRegisters {
pub x: GeneralRegisters,
pub elr: u64,
pub spsr: u64,
pub sp: u64,
}Expand description
Saved registers when a trap (exception) occurs.
Fields§
§x: GeneralRegistersGeneral-purpose registers (X0..X30).
elr: u64Exception Link Register (ELR_EL1).
spsr: u64Saved Process Status Register (SPSR_EL1).
sp: u64Stack pointer at the time of the exception.
Populated by SAVE_REGS as sp_before_sub = sp_after_sub + trapframe_size.
Note: This field is read-only (saved by SAVE_REGS for inspection only).
The actual SP is restored by RESTORE_REGS via add sp, sp, #trapframe_size,
not from this field. Modifying this value will NOT affect the actual SP
after exception return.
Implementations§
Source§impl TrapFrame
impl TrapFrame
Sourcepub fn interrupted_context(&self) -> InterruptedContext
pub fn interrupted_context(&self) -> InterruptedContext
Copies IRQ sampling values from this saved machine image.
Sourcepub const fn origin(&self) -> TrapOrigin
pub const fn origin(&self) -> TrapOrigin
Returns the privilege domain represented by this register image.
Sourcepub const fn set_retval(&mut self, r0: usize)
pub const fn set_retval(&mut self, r0: usize)
Sets the return value register.
Sourcepub fn backtrace_registers(&self) -> BacktraceRegisters
pub fn backtrace_registers(&self) -> BacktraceRegisters
Copies the machine registers needed by a runtime stack unwinder.
Trait Implementations§
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