aboutsummaryrefslogtreecommitdiff
path: root/kernel/drivers/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/timer.c')
-rw-r--r--kernel/drivers/timer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/drivers/timer.c b/kernel/drivers/timer.c
index 79e3cd8..788e286 100644
--- a/kernel/drivers/timer.c
+++ b/kernel/drivers/timer.c
@@ -1,5 +1,6 @@
// MIT License, Copyright (c) 2020 Marvin Borner
+#include <acpi.h>
#include <cpu.h>
#include <def.h>
#include <interrupts.h>
@@ -19,7 +20,6 @@ u32 timer_get()
return timer_ticks;
}
-// Executed 1000 times per second
void timer_handler()
{
timer_ticks++;
@@ -39,6 +39,8 @@ void timer_wait(u32 ticks)
// Install timer handler into IRQ0
void timer_install()
{
- timer_phase(1000);
+ hpet_install(10000); // TODO: Find optimal femtosecond period
+ if (!hpet)
+ timer_phase(1000);
irq_install_handler(0, timer_handler);
}