Skip to content

Commit

Permalink
fixup! Virtio: Proper MSI-X implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Jun 28, 2019
1 parent f49d40a commit 32af349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions kernel/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Waitable for IRQEvent {
fn register(&self) {
let curproc = scheduler::get_current_thread();
let mut veclock = self.state.waiting_processes.lock();
info!("Registering {:010x} for irq {}", &*curproc as *const _ as usize, self.state.irqnum);
debug!("Registering {:010x} for irq {}", &*curproc as *const _ as usize, self.state.irqnum);
if veclock.iter().find(|v| Arc::ptr_eq(&curproc, v)).is_none() {
veclock.push(scheduler::get_current_thread());
}
Expand Down Expand Up @@ -220,9 +220,11 @@ impl IRQState {
}

/// Global state for all the IRQ handled by the PIC.
static IRQ_STATES: [IRQState; 16] = [
static IRQ_STATES: [IRQState; 24] = [
IRQState::new(0x20), IRQState::new(0x21), IRQState::new(0x22), IRQState::new(0x23),
IRQState::new(0x24), IRQState::new(0x25), IRQState::new(0x26), IRQState::new(0x27),
IRQState::new(0x28), IRQState::new(0x29), IRQState::new(0x2A), IRQState::new(0x2B),
IRQState::new(0x2C), IRQState::new(0x2D), IRQState::new(0x2E), IRQState::new(0x2F),
IRQState::new(0x30), IRQState::new(0x31), IRQState::new(0x32), IRQState::new(0x33),
IRQState::new(0x34), IRQState::new(0x35), IRQState::new(0x36), IRQState::new(0x37),
];
12 changes: 10 additions & 2 deletions kernel/src/interrupts/irq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ macro_rules! irq_handler {

/// Array of interrupt handlers. The position in the array defines the IRQ this
/// handler is targeting. See the module documentation for more information.
pub static IRQ_HANDLERS : [extern "x86-interrupt" fn(stack_frame: &mut ExceptionStackFrame); 16] = [
pub static IRQ_HANDLERS : [extern "x86-interrupt" fn(stack_frame: &mut ExceptionStackFrame); 24] = [
irq_handler!(0, pin0_handler),
irq_handler!(1, keyboard_handler),
irq_handler!(2, timer_handler),
Expand All @@ -39,5 +39,13 @@ pub static IRQ_HANDLERS : [extern "x86-interrupt" fn(stack_frame: &mut Exception
irq_handler!(12, mouse_handler),
irq_handler!(13, irq13_handler),
irq_handler!(14, primary_ata_handler),
irq_handler!(15, secondary_ata_handler),
irq_handler!(15, irq15_handler),
irq_handler!(16, irq16_handler),
irq_handler!(17, irq17_handler),
irq_handler!(18, irq18_handler),
irq_handler!(19, network_handler),
irq_handler!(20, irq20_handler),
irq_handler!(21, irq21_handler),
irq_handler!(22, irq22_handler),
irq_handler!(23, irq23_handler),
];

0 comments on commit 32af349

Please sign in to comment.