1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 23:45:06 +00:00
serenity/Kernel/Arch/riscv64/InterruptManagement.cpp
Sönke Holz 0a4ef6f3b7 Kernel/riscv64: Stub out InterruptManagement::find_controllers
We don't support any IRQControllers for RISC-V (like the PLIC) yet,
so just do nothing here for now.
2024-01-23 13:13:18 -07:00

60 lines
1.3 KiB
C++

/*
* Copyright (c) 2023, Sönke Holz <sholz8530@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/Interrupts.h>
#include <Kernel/Arch/riscv64/IRQController.h>
#include <Kernel/Arch/riscv64/InterruptManagement.h>
#include <Kernel/Interrupts/SharedIRQHandler.h>
namespace Kernel {
static InterruptManagement* s_interrupt_management;
bool InterruptManagement::initialized()
{
return s_interrupt_management != nullptr;
}
InterruptManagement& InterruptManagement::the()
{
VERIFY(InterruptManagement::initialized());
return *s_interrupt_management;
}
void InterruptManagement::initialize()
{
VERIFY(!InterruptManagement::initialized());
s_interrupt_management = new InterruptManagement;
the().find_controllers();
}
void InterruptManagement::find_controllers()
{
// TODO: Once device tree support is in place, find interrupt controllers using that.
}
u8 InterruptManagement::acquire_mapped_interrupt_number(u8 original_irq)
{
return original_irq;
}
Vector<NonnullLockRefPtr<IRQController>> const& InterruptManagement::controllers()
{
return m_interrupt_controllers;
}
NonnullLockRefPtr<IRQController> InterruptManagement::get_responsible_irq_controller(size_t)
{
TODO_RISCV64();
}
void InterruptManagement::enumerate_interrupt_handlers(Function<void(GenericInterruptHandler&)>)
{
TODO_RISCV64();
}
}