|
| 1 | +//! This module contains errors and exception types. |
| 2 | +
|
| 3 | +/// Exception Error Codes |
| 4 | +/// |
| 5 | +/// This structure is defined by the following manual sections: |
| 6 | +/// * AMD Volume 2: 8.2 |
| 7 | +/// * Intel Volume 3A: 6.3.1 |
| 8 | +#[repr(u8)] |
| 9 | +#[non_exhaustive] |
| 10 | +#[derive(Copy, Clone, Debug, PartialEq)] |
| 11 | +pub enum Exception { |
| 12 | + /// Divide-by-zero Error |
| 13 | + DivideByZero = 0x00, |
| 14 | + |
| 15 | + /// Debug |
| 16 | + Debug = 0x01, |
| 17 | + |
| 18 | + /// Non-Maskable Interrupt |
| 19 | + NonMaskableInterrupt = 0x02, |
| 20 | + |
| 21 | + /// Breakpoint |
| 22 | + Breakpoint = 0x03, |
| 23 | + |
| 24 | + /// Overflow |
| 25 | + Overflow = 0x04, |
| 26 | + |
| 27 | + /// Bound Range Exceeded |
| 28 | + BoundRange = 0x05, |
| 29 | + |
| 30 | + /// Invalid Opcode |
| 31 | + InvalidOpcode = 0x06, |
| 32 | + |
| 33 | + /// Device Not Available |
| 34 | + DeviceNotAvailable = 0x07, |
| 35 | + |
| 36 | + /// Double Fault |
| 37 | + DoubleFault = 0x08, |
| 38 | + |
| 39 | + /// Invalid TSS |
| 40 | + InvalidTss = 0x0A, |
| 41 | + |
| 42 | + /// Segment Not Present |
| 43 | + SegmentNotPresent = 0x0B, |
| 44 | + |
| 45 | + /// Stack Fault |
| 46 | + Stack = 0x0C, |
| 47 | + |
| 48 | + /// General Protection Fault |
| 49 | + GeneralProtection = 0x0D, |
| 50 | + |
| 51 | + /// Page Fault |
| 52 | + Page = 0x0E, |
| 53 | + |
| 54 | + /// x87 Floating-Point Exception |
| 55 | + FloatingPoint = 0x10, |
| 56 | + |
| 57 | + /// Alignment Check |
| 58 | + AlignmentCheck = 0x11, |
| 59 | + |
| 60 | + /// Machine Check |
| 61 | + MachineCheck = 0x12, |
| 62 | + |
| 63 | + /// SIMD Floating-Point Exception |
| 64 | + SimdFloatingPoint = 0x13, |
| 65 | + |
| 66 | + /// Virtualization Exception (Intel-only) |
| 67 | + Virtualization = 0x14, |
| 68 | + |
| 69 | + /// Control Protection Exception (AMD-only) |
| 70 | + ControlProtection = 0x15, |
| 71 | + |
| 72 | + /// Hypervisor Injection (AMD-only) |
| 73 | + HypervisorInjection = 0x1C, |
| 74 | + |
| 75 | + /// VMM Communication (AMD-only) |
| 76 | + VmmCommunication = 0x1D, |
| 77 | + |
| 78 | + /// Security Exception |
| 79 | + Security = 0x1E, |
| 80 | +} |
0 commit comments