aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-01-24 22:34:12 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2026-01-24 22:34:12 +0200
commit1eaac15cdb220df7536c74774a1ce7d1f0519c63 (patch)
tree71f23ded40498e429a37bc64c48aa0d8eb5b0802 /arch/riscv64/kernel
parent9d735045e0b73b46443f9dacd1b42f5ac3e734de (diff)
downloadkmi-1eaac15cdb220df7536c74774a1ce7d1f0519c63.tar.gz
kmi-1eaac15cdb220df7536c74774a1ce7d1f0519c63.zip
improve timer handling
+ Previous code assumed a timer would only trigger when requested, but didn't explicitly disable timers during init. Newer versions of qemu (>= 10?) seem to have some kind of timer set, unsure if that's via OpenSBI or what exactly but some slower tests were failing because of it.
Diffstat (limited to 'arch/riscv64/kernel')
-rw-r--r--arch/riscv64/kernel/timer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/timer.c b/arch/riscv64/kernel/timer.c
index c7752f8..e9e509d 100644
--- a/arch/riscv64/kernel/timer.c
+++ b/arch/riscv64/kernel/timer.c
@@ -24,6 +24,11 @@ void set_timer(ticks_t ticks)
sbi_set_timer(ticks);
}
+void clear_timer()
+{
+ sbi_set_timer(-1);
+}
+
/**
* Get current ticks.
*