1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 05:24:58 +00:00
serenity/Kernel/Devices/Audio/IntelHDA/InterruptHandler.h
Liav A 68c3f9aa5a Kernel/Interrupts: Move PCIIRQHandler => PCI::IRQHandler
This class is part of the PCI code so let's move it to the PCI namespace
like other handling code parts of the PCI bus.
2023-09-16 14:04:17 -06:00

37 lines
830 B
C++

/*
* Copyright (c) 2023, Jelle Raaijmakers <jelle@gmta.nl>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullRefPtr.h>
#include <Kernel/Interrupts/PCIIRQHandler.h>
namespace Kernel::Audio::IntelHDA {
class Controller;
class InterruptHandler
: public PCI::IRQHandler
, public RefCounted<InterruptHandler> {
public:
static ErrorOr<NonnullRefPtr<InterruptHandler>> create(Controller& controller)
{
return adopt_nonnull_ref_or_enomem(new (nothrow) InterruptHandler(controller));
}
// ^PCI::IRQHandler
virtual StringView purpose() const override { return "IntelHDA IRQ Handler"sv; }
private:
InterruptHandler(Controller& controller);
// ^PCI::IRQHandler
virtual bool handle_irq(RegisterState const&) override;
Controller& m_controller;
};
}