mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-14 19:06:55 +02:00
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.
38 lines
810 B
C++
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;
|
|
};
|
|
|
|
}
|