blob: bc313b832e8bad70fe220a622880f43551d4e2ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
pub mod apic;
pub mod exceptions;
pub mod gdt;
pub mod idt;
pub mod interrupts;
const INT_OFFSET: u8 = 32;
#[repr(u8)]
#[derive(PartialEq, Clone, Copy)]
pub enum Interrupts {
None,
PageFault,
DoubleFault,
NotPresent,
Breakpoint,
GeneralProtectionFault,
Timer = INT_OFFSET,
Keyboard = INT_OFFSET + 1,
}
impl Interrupts {
fn as_u8(self) -> u8 {
self as u8
}
fn as_usize(self) -> usize {
usize::from(self.as_u8())
}
}
|