From c657b302c9688d2dfb9667021b426db451ea28c4 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 7 Dec 2022 14:31:40 +0100 Subject: [PATCH] Timer: add raw_ticks --- kernel/src/arch/Timer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/src/arch/Timer.cpp b/kernel/src/arch/Timer.cpp index 42667e1c..4ed1b780 100644 --- a/kernel/src/arch/Timer.cpp +++ b/kernel/src/arch/Timer.cpp @@ -58,6 +58,11 @@ namespace Timer timer_ticks++; } + usize raw_ticks() + { + return timer_ticks; + } + usize ticks() { return ticks_ms() / 1000; @@ -130,5 +135,6 @@ namespace Timer bool should_invoke_scheduler() { + // FIXME: Modulo is SLOW. We're calling this every tick. return (timer_ticks % ARCH_TIMER_FREQ) == 0; } \ No newline at end of file