1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 12:44:59 +00:00
serenity/Kernel/Devices/Audio/IntelHDA/InterruptHandler.cpp
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

29 lines
799 B
C++

/*
* Copyright (c) 2023, Jelle Raaijmakers <jelle@gmta.nl>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Devices/Audio/IntelHDA/Controller.h>
#include <Kernel/Devices/Audio/IntelHDA/InterruptHandler.h>
namespace Kernel::Audio::IntelHDA {
InterruptHandler::InterruptHandler(Controller& controller)
: PCI::IRQHandler(controller, controller.device_identifier().interrupt_line().value())
, m_controller(controller)
{
enable_irq();
}
bool InterruptHandler::handle_irq(RegisterState const&)
{
auto result_or_error = m_controller.handle_interrupt({});
if (result_or_error.is_error()) {
dmesgln("IntelHDA: Error during interrupt handling: {}", result_or_error.release_error());
return false;
}
return result_or_error.release_value();
}
}