Files
serenity/Kernel/Devices/Audio/IntelHDA/InterruptHandler.h
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

38 lines
810 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() override;
Controller& m_controller;
};
}