#[repr(u32)]pub enum Trap {
None = 4_294_967_295,
ExcInsnMisaligned = 0,
ExcInsnAccessFault = 1,
ExcIllegalInsn = 2,
ExcBreakpoint = 3,
ExcLoadAccessFault = 5,
ExcStoreAccessFault = 7,
ExcEcallU = 8,
ExcEcallM = 11,
IntTimer = 2_147_483_655,
}Expand description
Trap cause codes, as defined by the RISC-V privileged specification.
Trap::None is an internal sentinel meaning “no trap is pending”; it is
never written to mcause. Interrupt causes have bit 31 set (e.g.
Trap::IntTimer = 0x8000_0007).
Variants§
None = 4_294_967_295
Sentinel — no trap pending.
ExcInsnMisaligned = 0
Instruction address misaligned.
ExcInsnAccessFault = 1
Instruction access fault (PC outside RAM).
ExcIllegalInsn = 2
Illegal instruction encoding.
ExcBreakpoint = 3
ebreak breakpoint.
ExcLoadAccessFault = 5
Load access fault (address outside RAM and not MMIO).
ExcStoreAccessFault = 7
Store/AMO access fault.
ExcEcallU = 8
ecall from U-mode.
ExcEcallM = 11
ecall from M-mode.
IntTimer = 2_147_483_655
Machine timer interrupt (MTIP — bit 7 of mip/mie).
Implementations§
Trait Implementations§
impl Copy for Trap
impl Eq for Trap
impl StructuralPartialEq for Trap
Auto Trait Implementations§
impl Freeze for Trap
impl RefUnwindSafe for Trap
impl Send for Trap
impl Sync for Trap
impl Unpin for Trap
impl UnsafeUnpin for Trap
impl UnwindSafe for Trap
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