Skip to content

Commit ce30c16

Browse files
cazb2Ivan-Velickovic
authored andcommitted
Fix IOAPIC Polarity
The IOAPIC polarity for an interrupt pin is 0=High and 1=Low based on how the tool eventually makes the kernel system call, which casts the enum value to a word and then passes it to the kernel. The kernel then ors in the value passed at the corresponding bit position in the ioredtbl_state. Signed-off-by: Callum <c.berry@student.unsw.edu.au>
1 parent fa13e1b commit ce30c16

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tool/microkit/src/sel4.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,15 +560,15 @@ impl X86IoapicIrqTrigger {
560560
#[repr(u64)]
561561
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
562562
pub enum X86IoapicIrqPolarity {
563-
LowTriggered = 0,
564-
HighTriggered = 1,
563+
HighTriggered = 0,
564+
LowTriggered = 1,
565565
}
566566

567567
impl From<u64> for X86IoapicIrqPolarity {
568568
fn from(item: u64) -> X86IoapicIrqPolarity {
569569
match item {
570-
0 => X86IoapicIrqPolarity::LowTriggered,
571-
1 => X86IoapicIrqPolarity::HighTriggered,
570+
0 => X86IoapicIrqPolarity::HighTriggered,
571+
1 => X86IoapicIrqPolarity::LowTriggered,
572572
_ => panic!("Unknown x86 IOAPIC IRQ polarity {item:x}"),
573573
}
574574
}

0 commit comments

Comments
 (0)