pub struct TrapCtx {
pub x: [usize; 32],
pub sstatus: usize,
pub sepc: usize,
pub kernel_satp: usize,
pub kernel_virt_sp: usize,
pub kernel_virt_trap_handler: usize,
}Expand description
陷入上下文
用于保存和恢复陷入处理程序的上下文。
Fields§
§x: [usize; 32]通用寄存器
sstatus: usizeSupervisor 状态寄存器
sepc: usizeSupervisor 异常程序计数器
kernel_satp: usize内核页表基址 (Supervisor Address Translation and Protection)
kernel_virt_sp: usize内核虚拟栈指针
kernel_virt_trap_handler: usize内核虚拟陷入处理程序入口地址
Implementations§
Trait Implementations§
Source§impl Riscv64RegAlias for TrapCtx
impl Riscv64RegAlias for TrapCtx
Auto Trait Implementations§
impl Freeze for TrapCtx
impl RefUnwindSafe for TrapCtx
impl Send for TrapCtx
impl Sync for TrapCtx
impl Unpin for TrapCtx
impl UnwindSafe for TrapCtx
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