diff options
| -rw-r--r-- | StrixKernel/src/interrupts.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/StrixKernel/src/interrupts.rs b/StrixKernel/src/interrupts.rs index ea26f1f..4180c17 100644 --- a/StrixKernel/src/interrupts.rs +++ b/StrixKernel/src/interrupts.rs @@ -49,6 +49,22 @@ pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8; pub static PICS: spin::Mutex<ChainedPics> = spin::Mutex::new(unsafe { ChainedPics::new(PIC_1_OFFSET, PIC_2_OFFSET) }); +#[derive(Debug, Clone, Copy)] +#[repr(u8)] +pub enum InterruptIndex { + Timer = PIC_1_OFFSET, +} + +impl InterruptIndex { + fn as_u8(self) -> u8 { + self as u8 + } + + fn as_usize(self) -> usize { + usize::from(self.as_u8()) + } +} + // TESTS // |
