Struct kernel::executor::context::TrapContext
source · #[repr(C)]pub struct TrapContext {
user_register: [usize; 32],
user_sstatus: Sstatus,
user_sepc: usize,
kernel_stack: usize,
kernel_satp: usize,
}
Expand description
The TrapContext
struct is used to save and restore the context of a thread when an exception
or interrupt occurs. It contains the values of all the general-purpose registers of the thread,
the sstatus
register, the sepc
register, the address of the kernel stack, and the satp
register value that refers to the kernel page table.
Fields§
§user_register: [usize; 32]
§user_sstatus: Sstatus
§user_sepc: usize
§kernel_stack: usize
§kernel_satp: usize