Skip to content

Commit

Permalink
add description to the timer interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed May 14, 2023
1 parent 300a16e commit 56c090d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/arch/aarch64/kernel/interrupts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn disable() {
pub fn irq_install_handler(irq_number: u8, handler: fn(state: &State)) {
debug!("Install handler for interrupt {}", irq_number);
unsafe {
INTERRUPT_HANDLERS[irq_number as usize] = Some(handler);
INTERRUPT_HANDLERS[irq_number as usize + 16] = Some(handler);
}
}

Expand Down Expand Up @@ -281,7 +281,8 @@ pub fn init() {
}

debug!("Timer interrupt: {}", irq);
irq_install_handler((irq + 16).try_into().unwrap(), timer_handler);
irq_install_handler(irq.try_into().unwrap(), timer_handler);
add_irq_name(irq.try_into().unwrap(), "Timer");

// enable timer interrupt
let timer_irqid = IntId::ppi(irq);
Expand All @@ -301,7 +302,7 @@ static IRQ_NAMES: InterruptTicketMutex<HashMap<u8, &'static str, RandomState>> =

pub fn add_irq_name(irq_number: u8, name: &'static str) {
debug!("Register name \"{}\" for interrupt {}", name, irq_number);
IRQ_NAMES.lock().insert(32 + irq_number, name);
IRQ_NAMES.lock().insert(16 + irq_number, name);
}

fn get_irq_name(irq_number: u8) -> Option<&'static str> {
Expand Down

0 comments on commit 56c090d

Please sign in to comment.