diff options
author | Marvin Borner | 2020-09-06 19:37:58 +0200 |
---|---|---|
committer | Marvin Borner | 2020-09-06 19:37:58 +0200 |
commit | 586d58192b2c576393077c3944338b582c873f45 (patch) | |
tree | 7f93d4f5168266118541ffdbcefd32696ce0b281 /kernel/drivers/timer.c | |
parent | 2876d92663be7f1b46d72217e79b9f83d1756fd8 (diff) |
Finished switch to hpet timer
Diffstat (limited to 'kernel/drivers/timer.c')
-rw-r--r-- | kernel/drivers/timer.c | 6 |
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); } |