mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:57:35 +00:00
Kernel/riscv64: Make RISC-V Timer inherit from GenericInterruptHandler
IRQHandler is not the correct class to inherit from, as the timer is not connected to an IRQController. Each hart has one of these Timers directly connected to it.
This commit is contained in:
parent
8c017c3078
commit
8582f0720f
2 changed files with 21 additions and 19 deletions
|
@ -7,7 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Interrupts/IRQHandler.h>
|
||||
#include <Kernel/Interrupts/GenericInterruptHandler.h>
|
||||
#include <Kernel/Library/NonnullLockRefPtr.h>
|
||||
#include <Kernel/Time/HardwareTimer.h>
|
||||
|
||||
|
@ -15,10 +15,8 @@ namespace Kernel::RISCV64 {
|
|||
|
||||
struct TimerRegisters;
|
||||
|
||||
class Timer final : public HardwareTimer<IRQHandler> {
|
||||
class Timer final : public HardwareTimer<GenericInterruptHandler> {
|
||||
public:
|
||||
virtual ~Timer();
|
||||
|
||||
static NonnullLockRefPtr<Timer> initialize();
|
||||
|
||||
virtual HardwareTimerType timer_type() const override { return HardwareTimerType::RISCVTimer; }
|
||||
|
@ -42,15 +40,14 @@ public:
|
|||
u64 microseconds_since_boot();
|
||||
|
||||
void set_interrupt_interval_usec(u32);
|
||||
void enable_interrupt_mode();
|
||||
|
||||
private:
|
||||
Timer();
|
||||
|
||||
void set_compare(u64 compare);
|
||||
|
||||
//^ IRQHandler
|
||||
virtual bool handle_irq(RegisterState const&) override;
|
||||
//^ GenericInterruptHandler
|
||||
virtual bool handle_interrupt(RegisterState const&) override;
|
||||
|
||||
u32 m_interrupt_interval { 0 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue