diff --git a/src/arch/x86_64/hpet.c b/src/arch/x86_64/hpet.c index 2f8eafde..0e12cf0e 100644 --- a/src/arch/x86_64/hpet.c +++ b/src/arch/x86_64/hpet.c @@ -44,6 +44,14 @@ static void wait_ticks(size_t ticks){ while(readfromreg(REGISTER_COUNTER) < end) asm("pause"); } +time_t hpet_get_ticksperus(){ + return ticksper100ns*10; +} + +time_t hpet_get_counter(){ + return readfromreg(REGISTER_COUNTER); +} + void hpet_wait_us(size_t us){ size_t usticks = ticksper100ns*10; diff --git a/src/arch/x86_64/include/arch/hpet.h b/src/arch/x86_64/include/arch/hpet.h index 3d116a7d..ae09a90d 100644 --- a/src/arch/x86_64/include/arch/hpet.h +++ b/src/arch/x86_64/include/arch/hpet.h @@ -2,11 +2,14 @@ #define _HPET_H_INCLUDE #include +#include void hpet_init(); void hpet_wait_us(size_t us); void hpet_wait_ms(size_t ms); void hpet_wait_s(size_t s); +time_t hpet_get_counter(); +time_t hpet_get_ticksperus(); #endif