diff --git a/Kernel/Arch/x86/InterruptManagement.h b/Kernel/Arch/x86/InterruptManagement.h index ee70329996..6845118a9c 100644 --- a/Kernel/Arch/x86/InterruptManagement.h +++ b/Kernel/Arch/x86/InterruptManagement.h @@ -60,7 +60,7 @@ public: u8 get_irq_vector(u8 mapped_interrupt_vector); void enumerate_interrupt_handlers(Function); - IRQController& get_interrupt_controller(int index); + IRQController& get_interrupt_controller(size_t index); protected: virtual ~InterruptManagement() = default; diff --git a/Kernel/Arch/x86/common/InterruptManagement.cpp b/Kernel/Arch/x86/common/InterruptManagement.cpp index 95769ad37b..0f6712a613 100644 --- a/Kernel/Arch/x86/common/InterruptManagement.cpp +++ b/Kernel/Arch/x86/common/InterruptManagement.cpp @@ -51,7 +51,7 @@ UNMAP_AFTER_INIT void InterruptManagement::initialize() void InterruptManagement::enumerate_interrupt_handlers(Function callback) { - for (int i = 0; i < GENERIC_INTERRUPT_HANDLERS_COUNT; i++) { + for (size_t i = 0; i < GENERIC_INTERRUPT_HANDLERS_COUNT; i++) { auto& handler = get_interrupt_handler(i); if (handler.type() == HandlerType::SharedIRQHandler) { static_cast(handler).enumerate_handlers(callback); @@ -62,9 +62,8 @@ void InterruptManagement::enumerate_interrupt_handlers(Function= 0); return *m_interrupt_controllers[index]; } diff --git a/Kernel/Arch/x86/common/Interrupts/IOAPIC.cpp b/Kernel/Arch/x86/common/Interrupts/IOAPIC.cpp index 9a9a72f741..367bf630ee 100644 --- a/Kernel/Arch/x86/common/Interrupts/IOAPIC.cpp +++ b/Kernel/Arch/x86/common/Interrupts/IOAPIC.cpp @@ -85,7 +85,7 @@ void IOAPIC::map_interrupt_redirection(u8 interrupt_vector) isa_identity_map(interrupt_vector); } -void IOAPIC::isa_identity_map(int index) +void IOAPIC::isa_identity_map(size_t index) { InterruptDisabler disabler; configure_redirection_entry(index, InterruptManagement::acquire_mapped_interrupt_number(index) + IRQ_VECTOR_BASE, DeliveryMode::Normal, false, false, false, true, 0); @@ -165,16 +165,16 @@ void IOAPIC::hard_disable() IRQController::hard_disable(); } -void IOAPIC::reset_redirection_entry(int index) const +void IOAPIC::reset_redirection_entry(size_t index) const { InterruptDisabler disabler; configure_redirection_entry(index, 0, 0, false, false, false, true, 0); } -void IOAPIC::configure_redirection_entry(int index, u8 interrupt_vector, u8 delivery_mode, bool logical_destination, bool active_low, bool trigger_level_mode, bool masked, u8 destination) const +void IOAPIC::configure_redirection_entry(size_t index, u8 interrupt_vector, u8 delivery_mode, bool logical_destination, bool active_low, bool trigger_level_mode, bool masked, u8 destination) const { InterruptDisabler disabler; - VERIFY((u32)index < m_redirection_entries_count); + VERIFY(index < m_redirection_entries_count); u32 redirection_entry1 = interrupt_vector | (delivery_mode & 0b111) << 8 | logical_destination << 11 | active_low << 13 | trigger_level_mode << 15 | masked << 16; u32 redirection_entry2 = destination << 24; write_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET, redirection_entry1); @@ -197,7 +197,7 @@ void IOAPIC::mask_all_redirection_entries() const void IOAPIC::mask_redirection_entry(u8 index) const { - VERIFY((u32)index < m_redirection_entries_count); + VERIFY(index < m_redirection_entries_count); u32 redirection_entry = read_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET); if (redirection_entry & (1 << 16)) return; @@ -206,13 +206,13 @@ void IOAPIC::mask_redirection_entry(u8 index) const bool IOAPIC::is_redirection_entry_masked(u8 index) const { - VERIFY((u32)index < m_redirection_entries_count); + VERIFY(index < m_redirection_entries_count); return (read_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET) & (1 << 16)) != 0; } void IOAPIC::unmask_redirection_entry(u8 index) const { - VERIFY((u32)index < m_redirection_entries_count); + VERIFY(index < m_redirection_entries_count); u32 redirection_entry = read_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET); if (!(redirection_entry & (1 << 16))) return; @@ -227,7 +227,7 @@ bool IOAPIC::is_vector_enabled(u8 interrupt_vector) const u8 IOAPIC::read_redirection_entry_vector(u8 index) const { - VERIFY((u32)index < m_redirection_entries_count); + VERIFY(index < m_redirection_entries_count); return (read_register((index << 1) + IOAPIC_REDIRECTION_ENTRY_OFFSET) & 0xFF); } diff --git a/Kernel/Arch/x86/common/Interrupts/IOAPIC.h b/Kernel/Arch/x86/common/Interrupts/IOAPIC.h index d2e82f55ef..ef8ff1ac85 100644 --- a/Kernel/Arch/x86/common/Interrupts/IOAPIC.h +++ b/Kernel/Arch/x86/common/Interrupts/IOAPIC.h @@ -55,8 +55,8 @@ public: virtual IRQControllerType type() const override { return IRQControllerType::i82093AA; } private: - void configure_redirection_entry(int index, u8 interrupt_vector, u8 delivery_mode, bool logical_destination, bool active_low, bool trigger_level_mode, bool masked, u8 destination) const; - void reset_redirection_entry(int index) const; + void configure_redirection_entry(size_t index, u8 interrupt_vector, u8 delivery_mode, bool logical_destination, bool active_low, bool trigger_level_mode, bool masked, u8 destination) const; + void reset_redirection_entry(size_t index) const; void map_interrupt_redirection(u8 interrupt_vector); void reset_all_redirection_entries() const; @@ -75,7 +75,7 @@ private: virtual void initialize() override; void map_isa_interrupts(); void map_pci_interrupts(); - void isa_identity_map(int index); + void isa_identity_map(size_t index); PhysicalAddress m_address; mutable Memory::TypedMapping m_regs;