Struct TrapFrame

#[repr(C)]
pub struct TrapFrame {
Show 35 fields pub ra: usize, pub t0: usize, pub t1: usize, pub t2: usize, pub t3: usize, pub t4: usize, pub t5: usize, pub t6: usize, pub a0: usize, pub a1: usize, pub a2: usize, pub a3: usize, pub a4: usize, pub a5: usize, pub a6: usize, pub a7: usize, pub s0: usize, pub s1: usize, pub s2: usize, pub s3: usize, pub s4: usize, pub s5: usize, pub s6: usize, pub s7: usize, pub s8: usize, pub s9: usize, pub s10: usize, pub s11: usize, pub gp: usize, pub tp: usize, pub sp: usize, pub pc: usize, pub mstatus: usize, pub mcause: usize, pub mtval: usize,
}
Available on crate feature unstable only.
Expand description

Registers saved in trap handler

Fields§

§ra: usize

Return address, stores the address to return to after a function call or interrupt.

§t0: usize

Temporary register t0, used for intermediate values.

§t1: usize

Temporary register t1, used for intermediate values.

§t2: usize

Temporary register t2, used for intermediate values.

§t3: usize

Temporary register t3, used for intermediate values.

§t4: usize

Temporary register t4, used for intermediate values.

§t5: usize

Temporary register t5, used for intermediate values.

§t6: usize

Temporary register t6, used for intermediate values.

§a0: usize

Argument register a0, typically used to pass the first argument to a function.

§a1: usize

Argument register a1, typically used to pass the second argument to a function.

§a2: usize

Argument register a2, typically used to pass the third argument to a function.

§a3: usize

Argument register a3, typically used to pass the fourth argument to a function.

§a4: usize

Argument register a4, typically used to pass the fifth argument to a function.

§a5: usize

Argument register a5, typically used to pass the sixth argument to a function.

§a6: usize

Argument register a6, typically used to pass the seventh argument to a function.

§a7: usize

Argument register a7, typically used to pass the eighth argument to a function.

§s0: usize

Saved register s0, used to hold values across function calls.

§s1: usize

Saved register s1, used to hold values across function calls.

§s2: usize

Saved register s2, used to hold values across function calls.

§s3: usize

Saved register s3, used to hold values across function calls.

§s4: usize

Saved register s4, used to hold values across function calls.

§s5: usize

Saved register s5, used to hold values across function calls.

§s6: usize

Saved register s6, used to hold values across function calls.

§s7: usize

Saved register s7, used to hold values across function calls.

§s8: usize

Saved register s8, used to hold values across function calls.

§s9: usize

Saved register s9, used to hold values across function calls.

§s10: usize

Saved register s10, used to hold values across function calls.

§s11: usize

Saved register s11, used to hold values across function calls.

§gp: usize

Global pointer register, holds the address of the global data area.

§tp: usize

Thread pointer register, holds the address of the thread-local storage area.

§sp: usize

Stack pointer register, holds the address of the top of the stack.

§pc: usize

Program counter, stores the address of the next instruction to be executed.

§mstatus: usize

Machine status register, holds the current status of the processor, including interrupt enable bits and privilege mode.

§mcause: usize

Machine cause register, contains the reason for the trap (e.g., exception or interrupt number).

§mtval: usize

Machine trap value register, contains additional information about the trap (e.g., faulting address).

Trait Implementations§

§

impl Clone for TrapFrame

§

fn clone(&self) -> TrapFrame

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TrapFrame

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for TrapFrame

§

fn default() -> TrapFrame

Returns the “default value” for a type. Read more
§

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 UnwindSafe for TrapFrame

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.