diff --git a/Kernel/Arch/riscv64/CSR.h b/Kernel/Arch/riscv64/CSR.h index 5f423886eb0..7b05bdff790 100644 --- a/Kernel/Arch/riscv64/CSR.h +++ b/Kernel/Arch/riscv64/CSR.h @@ -30,6 +30,7 @@ enum class Address : u16 { SATP = 0x180, // Unprivileged Counters/Timers + CYCLE = 0xc00, TIME = 0xc01, }; diff --git a/Kernel/Arch/riscv64/Processor.h b/Kernel/Arch/riscv64/Processor.h index 1e0995aea3a..644847a6fa3 100644 --- a/Kernel/Arch/riscv64/Processor.h +++ b/Kernel/Arch/riscv64/Processor.h @@ -211,7 +211,7 @@ ALWAYS_INLINE void ProcessorBase::wait_check() template ALWAYS_INLINE u64 ProcessorBase::read_cpu_counter() { - TODO_RISCV64(); + return RISCV64::CSR::read(RISCV64::CSR::Address::CYCLE); } }