From 773afefe7c44d8ebf75f9e3909c950214a3540f7 Mon Sep 17 00:00:00 2001 From: Liav A Date: Thu, 5 Mar 2020 19:13:55 +0200 Subject: Kernel: Change HandlerPurpose to HandlerType Also, GenericInterruptHandler class requires to implement two new methods. --- Kernel/Arch/i386/CPU.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Kernel/Arch/i386') diff --git a/Kernel/Arch/i386/CPU.cpp b/Kernel/Arch/i386/CPU.cpp index b399f12d0c..cfe1888f9a 100644 --- a/Kernel/Arch/i386/CPU.cpp +++ b/Kernel/Arch/i386/CPU.cpp @@ -410,17 +410,17 @@ static void revert_to_unused_handler(u8 interrupt_number) void register_generic_interrupt_handler(u8 interrupt_number, GenericInterruptHandler& handler) { if (s_interrupt_handler[interrupt_number] != nullptr) { - if (s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::UnhandledInterruptHandler) { + if (s_interrupt_handler[interrupt_number]->type() == HandlerType::UnhandledInterruptHandler) { s_interrupt_handler[interrupt_number] = &handler; return; } if (s_interrupt_handler[interrupt_number]->is_shared_handler() && !s_interrupt_handler[interrupt_number]->is_sharing_with_others()) { - ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::SharedIRQHandler); + ASSERT(s_interrupt_handler[interrupt_number]->type() == HandlerType::SharedIRQHandler); static_cast(s_interrupt_handler[interrupt_number])->register_handler(handler); return; } if (!s_interrupt_handler[interrupt_number]->is_shared_handler()) { - ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::IRQHandler); + ASSERT(s_interrupt_handler[interrupt_number]->type() == HandlerType::IRQHandler); auto& previous_handler = *s_interrupt_handler[interrupt_number]; s_interrupt_handler[interrupt_number] = nullptr; SharedIRQHandler::initialize(interrupt_number); @@ -437,12 +437,12 @@ void register_generic_interrupt_handler(u8 interrupt_number, GenericInterruptHan void unregister_generic_interrupt_handler(u8 interrupt_number, GenericInterruptHandler& handler) { ASSERT(s_interrupt_handler[interrupt_number] != nullptr); - if (s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::UnhandledInterruptHandler) { + if (s_interrupt_handler[interrupt_number]->type() == HandlerType::UnhandledInterruptHandler) { dbg() << "Trying to unregister unused handler (?)"; return; } if (s_interrupt_handler[interrupt_number]->is_shared_handler() && !s_interrupt_handler[interrupt_number]->is_sharing_with_others()) { - ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::SharedIRQHandler); + ASSERT(s_interrupt_handler[interrupt_number]->type() == HandlerType::SharedIRQHandler); static_cast(s_interrupt_handler[interrupt_number])->unregister_handler(handler); if (!static_cast(s_interrupt_handler[interrupt_number])->sharing_devices_count()) { revert_to_unused_handler(interrupt_number); @@ -450,7 +450,7 @@ void unregister_generic_interrupt_handler(u8 interrupt_number, GenericInterruptH return; } if (!s_interrupt_handler[interrupt_number]->is_shared_handler()) { - ASSERT(s_interrupt_handler[interrupt_number]->purpose() == HandlerPurpose::IRQHandler); + ASSERT(s_interrupt_handler[interrupt_number]->type() == HandlerType::IRQHandler); revert_to_unused_handler(interrupt_number); return; } -- cgit v1.2.3