diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-03-10 12:41:30 +0100 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-03-10 12:43:42 +0100 |
| commit | e3aa1fc629ba0d5ba3c7607d11abf2b7504ef969 (patch) | |
| tree | d96ae4f8c16d1ea8038133964d6715b58735ba7b | |
| parent | 4f1d980f74dbe38f0b3adb50f1f3d9d75e3caca9 (diff) | |
Added an InterruptIndex enum to handle hardware exceptions sent by the PICs to the CPU in src/interrupts.rs
| -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 // |
