mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
Kernel/riscv64: Read the timebase-frequency from the device tree
This commit is contained in:
parent
3941277940
commit
53dd04e219
1 changed files with 2 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/Format.h>
|
||||
#include <AK/NeverDestroyed.h>
|
||||
#include <Kernel/Arch/riscv64/CPU.h>
|
||||
#include <Kernel/Arch/riscv64/SBI.h>
|
||||
#include <Kernel/Arch/riscv64/Timer.h>
|
||||
|
||||
|
@ -14,10 +15,7 @@ namespace Kernel::RISCV64 {
|
|||
Timer::Timer()
|
||||
: HardwareTimer(to_underlying(CSR::SCAUSE::SupervisorTimerInterrupt) & ~CSR::SCAUSE_INTERRUPT_MASK)
|
||||
{
|
||||
// FIXME: Actually query the frequency of the timer from the device tree.
|
||||
|
||||
// Based on the "/cpus/timebase-frequency" device tree node for the QEMU virt machine
|
||||
m_frequency = 10'000'000; // in Hz
|
||||
m_frequency = DeviceTree::get().resolve_property("/cpus/timebase-frequency"sv).value().as<u32>();
|
||||
|
||||
m_interrupt_interval = m_frequency / OPTIMAL_TICKS_PER_SECOND_RATE;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue