aboutsummaryrefslogtreecommitdiff
path: root/kernel/drivers/acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/acpi.c')
-rw-r--r--kernel/drivers/acpi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/drivers/acpi.c b/kernel/drivers/acpi.c
index e853a6f..0db4522 100644
--- a/kernel/drivers/acpi.c
+++ b/kernel/drivers/acpi.c
@@ -83,12 +83,14 @@ void hpet_install(int period)
struct hpet_registers *r = (struct hpet_registers *)hpet->address.phys;
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;
+ r->config |= hpet_legacy_replacement;
+ r->config |= hpet_enable;
assert(r->tick_period + period < HPET_MAX_PERIOD);
r->timer_comparator0 = r->tick_period + period;
r->timer_comparator0 = period;
+ } else {
+ hpet = NULL;
}
} else {
hpet = NULL;