MSIHandler.h 880 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Types.h>
  8. #include <Kernel/Interrupts/GenericInterruptHandler.h>
  9. #include <Kernel/PCI/Definitions.h>
  10. namespace Kernel {
  11. class MSIHandler final : public GenericInterruptHandler {
  12. public:
  13. virtual ~MSIHandler();
  14. virtual void handle_interrupt(RegisterState&) override { }
  15. void enable_irq();
  16. void disable_irq();
  17. virtual bool eoi() override;
  18. virtual size_t sharing_devices_count() const override { return 0; }
  19. virtual bool is_shared_handler() const override { return false; }
  20. virtual bool is_sharing_with_others() const override { return m_shared_with_others; }
  21. protected:
  22. void change_irq_number(u8 irq);
  23. explicit MSIHandler(PCI::Address);
  24. private:
  25. bool m_shared_with_others;
  26. bool m_enabled;
  27. };
  28. }