#[repr(C)]
#[derive(Debug)]
pub struct ExceptionType(isize);
impl ExceptionType {
pub const EXCEPT_EBC_UNDEFINED: Self = Self(0);
pub const EXCEPT_EBC_DIVIDE_ERROR: Self = Self(1);
pub const EXCEPT_EBC_DEBUG: Self = Self(2);
pub const EXCEPT_EBC_BREAKPOINT: Self = Self(3);
pub const EXCEPT_EBC_OVERFLOW: Self = Self(4);
pub const EXCEPT_EBC_INVALID_OPCODE: Self = Self(5);
pub const EXCEPT_EBC_STACK_FAULT: Self = Self(6);
pub const EXCEPT_EBC_ALIGNMENT_CHECK: Self = Self(7);
pub const EXCEPT_EBC_INSTRUCTION_ENCODING: Self = Self(8);
pub const EXCEPT_EBC_BAD_BREAK: Self = Self(9);
pub const EXCEPT_EBC_SINGLE_STEP: Self = Self(10);
}
#[cfg(target_arch = "x86")]
impl ExceptionType {
pub const EXCEPT_IA32_DIVIDE_ERROR: Self = Self(0);
pub const EXCEPT_IA32_DEBUG: Self = Self(1);
pub const EXCEPT_IA32_NMI: Self = Self(2);
pub const EXCEPT_IA32_BREAKPOINT: Self = Self(3);
pub const EXCEPT_IA32_OVERFLOW: Self = Self(4);
pub const EXCEPT_IA32_BOUND: Self = Self(5);
pub const EXCEPT_IA32_INVALID_OPCODE: Self = Self(6);
pub const EXCEPT_IA32_DOUBLE_FAULT: Self = Self(8);
pub const EXCEPT_IA32_INVALID_TSS: Self = Self(10);
pub const EXCEPT_IA32_SEG_NOT_PRESENT: Self = Self(11);
pub const EXCEPT_IA32_STACK_FAULT: Self = Self(12);
pub const EXCEPT_IA32_GP_FAULT: Self = Self(13);
pub const EXCEPT_IA32_PAGE_FAULT: Self = Self(14);
pub const EXCEPT_IA32_FP_ERROR: Self = Self(16);
pub const EXCEPT_IA32_ALIGNMENT_CHECK: Self = Self(17);
pub const EXCEPT_IA32_MACHINE_CHECK: Self = Self(18);
pub const EXCEPT_IA32_SIMD: Self = Self(19);
}
#[cfg(target_arch = "x86_64")]
impl ExceptionType {
pub const EXCEPT_X64_DIVIDE_ERROR: Self = Self(0);
pub const EXCEPT_X64_DEBUG: Self = Self(1);
pub const EXCEPT_X64_NMI: Self = Self(2);
pub const EXCEPT_X64_BREAKPOINT: Self = Self(3);
pub const EXCEPT_X64_OVERFLOW: Self = Self(4);
pub const EXCEPT_X64_BOUND: Self = Self(5);
pub const EXCEPT_X64_INVALID_OPCODE: Self = Self(6);
pub const EXCEPT_X64_DOUBLE_FAULT: Self = Self(8);
pub const EXCEPT_X64_INVALID_TSS: Self = Self(10);
pub const EXCEPT_X64_SEG_NOT_PRESENT: Self = Self(11);
pub const EXCEPT_X64_STACK_FAULT: Self = Self(12);
pub const EXCEPT_X64_GP_FAULT: Self = Self(13);
pub const EXCEPT_X64_PAGE_FAULT: Self = Self(14);
pub const EXCEPT_X64_FP_ERROR: Self = Self(16);
pub const EXCEPT_X64_ALIGNMENT_CHECK: Self = Self(17);
pub const EXCEPT_X64_MACHINE_CHECK: Self = Self(18);
pub const EXCEPT_X64_SIMD: Self = Self(19);
}
#[cfg(target_arch = "arm")]
impl ExceptionType {
pub const EXCEPT_ARM_RESET: Self = Self(0);
pub const EXCEPT_ARM_UNDEFINED_INSTRUCTION: Self = Self(1);
pub const EXCEPT_ARM_SOFTWARE_INTERRUPT: Self = Self(2);
pub const EXCEPT_ARM_PREFETCH_ABORT: Self = Self(3);
pub const EXCEPT_ARM_DATA_ABORT: Self = Self(4);
pub const EXCEPT_ARM_RESERVED: Self = Self(5);
pub const EXCEPT_ARM_IRQ: Self = Self(6);
pub const EXCEPT_ARM_FIQ: Self = Self(7);
pub const MAX_ARM_EXCEPTION: Self = Self::EXCEPT_ARM_FIQ;
}
#[cfg(target_arch = "aarch64")]
impl ExceptionType {
pub const EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS: Self = Self(0);
pub const EXCEPT_AARCH64_IRQ: Self = Self(1);
pub const EXCEPT_AARCH64_FIQ: Self = Self(2);
pub const EXCEPT_AARCH64_SERROR: Self = Self(3);
pub const MAX_AARCH64_EXCEPTION: Self = Self::EXCEPT_AARCH64_SERROR;
}
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
impl ExceptionType {
pub const EXCEPT_RISCV_INST_MISALIGNED: Self = Self(0);
pub const EXCEPT_RISCV_INST_ACCESS_FAULT: Self = Self(1);
pub const EXCEPT_RISCV_ILLEGAL_INST: Self = Self(2);
pub const EXCEPT_RISCV_BREAKPOINT: Self = Self(3);
pub const EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED: Self = Self(4);
pub const EXCEPT_RISCV_LOAD_ACCESS_FAULT: Self = Self(5);
pub const EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED: Self = Self(6);
pub const EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT: Self = Self(7);
pub const EXCEPT_RISCV_ENV_CALL_FROM_UMODE: Self = Self(8);
pub const EXCEPT_RISCV_ENV_CALL_FROM_SMODE: Self = Self(9);
pub const EXCEPT_RISCV_ENV_CALL_FROM_MMODE: Self = Self(11);
pub const EXCEPT_RISCV_INST_PAGE_FAULT: Self = Self(12);
pub const EXCEPT_RISCV_LOAD_PAGE_FAULT: Self = Self(13);
pub const EXCEPT_RISCV_STORE_AMO_PAGE_FAULT: Self = Self(15);
pub const EXCEPT_RISCV_SUPERVISOR_SOFTWARE_INT: Self = Self(1);
pub const EXCEPT_RISCV_MACHINE_SOFTWARE_INT: Self = Self(3);
pub const EXCEPT_RISCV_SUPERVISOR_TIMER_INT: Self = Self(5);
pub const EXCEPT_RISCV_MACHINE_TIMER_INT: Self = Self(7);
pub const EXCEPT_RISCV_SUPERVISOR_EXTERNAL_INT: Self = Self(9);
pub const EXCEPT_RISCV_MACHINE_EXTERNAL_INT: Self = Self(11);
}