2020-02-22 20:02:38 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-02-22 20:02:38 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Types.h>
|
2021-03-07 21:28:28 +01:00
|
|
|
#include <Kernel/Arch/x86/CPU.h>
|
2020-02-22 20:02:38 +02:00
|
|
|
#include <Kernel/Interrupts/GenericInterruptHandler.h>
|
|
|
|
|
#include <Kernel/PCI/Definitions.h>
|
|
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2020-08-09 13:21:07 -07:00
|
|
|
class MSIHandler final : public GenericInterruptHandler {
|
2020-02-22 20:02:38 +02:00
|
|
|
public:
|
|
|
|
|
virtual ~MSIHandler();
|
|
|
|
|
|
2020-09-18 09:49:51 +02:00
|
|
|
virtual void handle_interrupt(RegisterState&) override { }
|
2020-02-22 20:02:38 +02:00
|
|
|
|
|
|
|
|
void enable_irq();
|
|
|
|
|
void disable_irq();
|
|
|
|
|
|
|
|
|
|
virtual bool eoi() override;
|
|
|
|
|
|
2020-02-23 14:14:01 +02:00
|
|
|
virtual size_t sharing_devices_count() const override { return 0; }
|
2020-02-22 20:02:38 +02:00
|
|
|
virtual bool is_shared_handler() const override { return false; }
|
|
|
|
|
virtual bool is_sharing_with_others() const override { return m_shared_with_others; }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void change_irq_number(u8 irq);
|
|
|
|
|
explicit MSIHandler(PCI::Address);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool m_shared_with_others;
|
|
|
|
|
bool m_enabled;
|
|
|
|
|
};
|
|
|
|
|
}
|