mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel/riscv64: Read the timebase-frequency from the device tree
This commit is contained in:
parent
3941277940
commit
53dd04e219
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/53dd04e219 Pull-request: https://github.com/SerenityOS/serenity/pull/22948 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/kleinesfilmroellchen Reviewed-by: https://github.com/spholz
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…
Reference in a new issue