#[repr(C)]pub struct UserRegisters {
pub x: [u64; 31],
pub elr: u64,
pub spsr: u64,
pub sp: u64,
}Expand description
Saved registers when a trap (exception) occurs.
Fields§
§x: [u64; 31]General-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 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.
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