From 52abe40c8b318d06c350f5b7f3485c09927d2a1f Mon Sep 17 00:00:00 2001 From: Callum Date: Thu, 26 Mar 2026 17:35:42 +1100 Subject: [PATCH] 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 --- tool/microkit/src/sel4.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tool/microkit/src/sel4.rs b/tool/microkit/src/sel4.rs index 4c258e3c9..9646142e8 100644 --- a/tool/microkit/src/sel4.rs +++ b/tool/microkit/src/sel4.rs @@ -573,15 +573,15 @@ impl X86IoapicIrqTrigger { #[repr(u64)] #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum X86IoapicIrqPolarity { - LowTriggered = 0, - HighTriggered = 1, + HighTriggered = 0, + LowTriggered = 1, } impl From for X86IoapicIrqPolarity { fn from(item: u64) -> X86IoapicIrqPolarity { match item { - 0 => X86IoapicIrqPolarity::LowTriggered, - 1 => X86IoapicIrqPolarity::HighTriggered, + 0 => X86IoapicIrqPolarity::HighTriggered, + 1 => X86IoapicIrqPolarity::LowTriggered, _ => panic!("Unknown x86 IOAPIC IRQ polarity {item:x}"), } }