From 808baf43a580596f1677663bafd6844118680c5a Mon Sep 17 00:00:00 2001 From: sigsegv7 Date: Wed, 20 Sep 2023 02:28:15 -0400 Subject: kernel: dev: Setup timer descriptor for HPET Signed-off-by: sigsegv7 --- sys/dev/timer/hpet.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/dev/timer') diff --git a/sys/dev/timer/hpet.c b/sys/dev/timer/hpet.c index 9e9180f..f5b1621 100644 --- a/sys/dev/timer/hpet.c +++ b/sys/dev/timer/hpet.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -62,6 +63,7 @@ __KERNEL_META("$Vega$: hpet.c, Ian Marco Moffett, " #define spinwait_hint() __nothing #endif /* defined(__x86_64__) */ +static struct timer timer = { 0 }; static struct hpet *acpi_hpet = NULL; static void *hpet_base = NULL; static bool is_faulty = false; @@ -177,6 +179,12 @@ hpet_init(void) hpet_write(HPET_REG_MAIN_COUNTER, 0); hpet_write(HPET_GENERAL_CONFIG, 1); + /* Setup the timer descriptor */ + timer.name = "HIGH_PRECISION_EVENT_TIMER"; + timer.msleep = hpet_msleep; + timer.usleep = hpet_usleep; + timer.nsleep = hpet_nsleep; + /* Not faulty */ is_faulty = false; return 0; -- cgit v1.2.3