diff options
author | Liav A <liavalb@gmail.com> | 2020-03-05 19:13:55 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-06 11:19:51 +0100 |
commit | 773afefe7c44d8ebf75f9e3909c950214a3540f7 (patch) | |
tree | d304e12bbd03637969419af212ad67c798e38610 /Kernel/Interrupts | |
parent | 52954ccce6a44931d7454846d8730468dfdcb46a (diff) | |
download | serenity-773afefe7c44d8ebf75f9e3909c950214a3540f7.zip |
Kernel: Change HandlerPurpose to HandlerType
Also, GenericInterruptHandler class requires to implement two new
methods.
Diffstat (limited to 'Kernel/Interrupts')
-rw-r--r-- | Kernel/Interrupts/GenericInterruptHandler.h | 6 | ||||
-rw-r--r-- | Kernel/Interrupts/IRQHandler.h | 4 | ||||
-rw-r--r-- | Kernel/Interrupts/SharedIRQHandler.h | 4 | ||||
-rw-r--r-- | Kernel/Interrupts/SpuriousInterruptHandler.h | 4 | ||||
-rw-r--r-- | Kernel/Interrupts/UnhandledInterruptHandler.h | 4 |
5 files changed, 16 insertions, 6 deletions
diff --git a/Kernel/Interrupts/GenericInterruptHandler.h b/Kernel/Interrupts/GenericInterruptHandler.h index 2fec083c67..9c7bfb3c6d 100644 --- a/Kernel/Interrupts/GenericInterruptHandler.h +++ b/Kernel/Interrupts/GenericInterruptHandler.h @@ -33,7 +33,7 @@ namespace Kernel { -enum class HandlerPurpose : u8 { +enum class HandlerType : u8 { IRQHandler = 1, SharedIRQHandler = 2, UnhandledInterruptHandler = 3, @@ -56,7 +56,9 @@ public: virtual bool is_shared_handler() const = 0; virtual bool is_sharing_with_others() const = 0; - virtual HandlerPurpose purpose() const = 0; + virtual HandlerType type() const = 0; + virtual const char* purpose() const = 0; + virtual const char* controller() const = 0; virtual bool eoi() = 0; void increment_invoking_counter(); diff --git a/Kernel/Interrupts/IRQHandler.h b/Kernel/Interrupts/IRQHandler.h index 4505a4327e..d753f5e7e2 100644 --- a/Kernel/Interrupts/IRQHandler.h +++ b/Kernel/Interrupts/IRQHandler.h @@ -47,7 +47,9 @@ public: virtual bool eoi() override; - virtual HandlerPurpose purpose() const override { return HandlerPurpose::IRQHandler; } + virtual HandlerType type() const override { return HandlerType::IRQHandler; } + virtual const char* purpose() const override { return "IRQ Handler"; } + virtual const char* controller() const override { return m_responsible_irq_controller->model(); } virtual size_t sharing_devices_count() const override { return 0; } virtual bool is_shared_handler() const override { return false; } diff --git a/Kernel/Interrupts/SharedIRQHandler.h b/Kernel/Interrupts/SharedIRQHandler.h index 56da1b5f3a..ca82e692db 100644 --- a/Kernel/Interrupts/SharedIRQHandler.h +++ b/Kernel/Interrupts/SharedIRQHandler.h @@ -50,7 +50,9 @@ public: virtual bool is_shared_handler() const override { return true; } virtual bool is_sharing_with_others() const override { return false; } - virtual HandlerPurpose purpose() const override { return HandlerPurpose::SharedIRQHandler; } + virtual HandlerType type() const override { return HandlerType::SharedIRQHandler; } + virtual const char* purpose() const override { return "Shared IRQ Handler"; } + virtual const char* controller() const override { return m_responsible_irq_controller->model(); } private: void enable_interrupt_vector(); diff --git a/Kernel/Interrupts/SpuriousInterruptHandler.h b/Kernel/Interrupts/SpuriousInterruptHandler.h index 92f36bdce0..046e6c8222 100644 --- a/Kernel/Interrupts/SpuriousInterruptHandler.h +++ b/Kernel/Interrupts/SpuriousInterruptHandler.h @@ -50,7 +50,9 @@ public: virtual bool is_shared_handler() const override { return false; } virtual bool is_sharing_with_others() const override { return false; } - virtual HandlerPurpose purpose() const override { return HandlerPurpose::SpuriousInterruptHandler; } + virtual HandlerType type() const override { return HandlerType::SpuriousInterruptHandler; } + virtual const char* purpose() const override { return "Spurious Interrupt Handler"; } + virtual const char* controller() const override { return m_responsible_irq_controller->model(); } private: void enable_interrupt_vector(); diff --git a/Kernel/Interrupts/UnhandledInterruptHandler.h b/Kernel/Interrupts/UnhandledInterruptHandler.h index 10732cdc8f..7155aafa0d 100644 --- a/Kernel/Interrupts/UnhandledInterruptHandler.h +++ b/Kernel/Interrupts/UnhandledInterruptHandler.h @@ -41,7 +41,9 @@ public: virtual bool eoi() override; - virtual HandlerPurpose purpose() const override { return HandlerPurpose::UnhandledInterruptHandler; } + virtual HandlerType type() const override { return HandlerType::UnhandledInterruptHandler; } + virtual const char* purpose() const override { return "Unhandled Interrupt Handler"; } + virtual const char* controller() const override { ASSERT_NOT_REACHED(); } virtual size_t sharing_devices_count() const override { return 0; } virtual bool is_shared_handler() const override { return false; } |