diff options
author | Marvin Borner | 2020-09-06 23:27:29 +0200 |
---|---|---|
committer | Marvin Borner | 2020-09-06 23:27:29 +0200 |
commit | 97f57cf4da45d268bbea863ae7bf40bb8c749aad (patch) | |
tree | f9804ce5cf22922aab0a425ed8007b03bb0761f6 /kernel/drivers/acpi.c | |
parent | 586d58192b2c576393077c3944338b582c873f45 (diff) |
Some timer thingies
Diffstat (limited to 'kernel/drivers/acpi.c')
-rw-r--r-- | kernel/drivers/acpi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/drivers/acpi.c b/kernel/drivers/acpi.c index 15007d7..4c7a1a8 100644 --- a/kernel/drivers/acpi.c +++ b/kernel/drivers/acpi.c @@ -78,11 +78,12 @@ void hpet_install(int period) { if (hpet && hpet->legacy_replacement && hpet->comparator_count > 0) { struct hpet_registers *r = (struct hpet_registers *)hpet->address.phys; - printf("HPET tick period: %dns\n", r->tick_period / 1000000); + printf("HPET tick period: %dns\n", HPET_MAX_PERIOD / r->tick_period); if ((r->timer0 & hpet_periodic_support) == hpet_periodic_support) { r->config |= hpet_enable; r->config |= hpet_legacy_replacement; r->timer0 |= hpet_periodic | hpet_set_accumulator | hpet_enable_timer; + assert(r->tick_period + period < HPET_MAX_PERIOD); r->timer_comparator0 = r->tick_period + period; r->timer_comparator0 = period; } |