Files
serenity/Kernel/Devices/Audio/IntelHDA/InterruptHandler.cpp
Liav A. 0482f4e117 Kernel: Remove passing of register state to IRQ handlers
Linux did the same thing 18 years ago and their reasons for the change
are similar to ours - https://github.com/torvalds/linux/commit/7d12e78

Most interrupt handlers (i.e. IRQ handlers) never used the register
state reference anywhere so there's simply no need of passing it around.
I didn't measure the performance boost but surely this change can't make
things worse anyway.
2024-09-01 21:00:18 +02:00

30 lines
779 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()
{
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();
}
}