summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-07-20 10:58:56 +0000
committermav <mav@FreeBSD.org>2010-07-20 10:58:56 +0000
commit1021ed9c1fb242e77973084e90e83ad8f307080a (patch)
treea2ade1a810689c7741fce55a1e8c698c5abacbdc /sys/dev
parent19bed51cff8dcac07d39993556ad270818a248cd (diff)
downloadFreeBSD-src-1021ed9c1fb242e77973084e90e83ad8f307080a.zip
FreeBSD-src-1021ed9c1fb242e77973084e90e83ad8f307080a.tar.gz
Extend timer driver API to report also minimal and maximal supported period
lengths. Make MI wrapper code to validate periods in request. Make kernel clock management code to honor these hardware limitations while choosing hz, stathz and profhz values.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi_hpet.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c
index 95f2b32..a789418 100644
--- a/sys/dev/acpica/acpi_hpet.c
+++ b/sys/dev/acpica/acpi_hpet.c
@@ -154,15 +154,16 @@ hpet_start(struct eventtimer *et,
t->div = (sc->freq * (period->frac >> 32)) >> 32;
if (period->sec != 0)
t->div += sc->freq * period->sec;
- if (first == NULL)
- first = period;
} else {
t->mode = 2;
t->div = 0;
}
- fdiv = (sc->freq * (first->frac >> 32)) >> 32;
- if (first->sec != 0)
- fdiv += sc->freq * first->sec;
+ if (first != NULL) {
+ fdiv = (sc->freq * (first->frac >> 32)) >> 32;
+ if (first->sec != 0)
+ fdiv += sc->freq * first->sec;
+ } else
+ fdiv = t->div;
t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER);
if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) {
t->caps |= HPET_TCNF_TYPE;
@@ -583,6 +584,11 @@ hpet_attach(device_t dev)
if ((t->caps & HPET_TCAP_PER_INT) == 0)
t->et.et_quality -= 10;
t->et.et_frequency = sc->freq;
+ t->et.et_min_period.sec = 0;
+ t->et.et_min_period.frac = 0x00004000LL << 32;
+ t->et.et_max_period.sec = 0xffffffff / sc->freq;
+ t->et.et_max_period.frac =
+ ((0xffffffffLL << 32) / sc->freq) << 32;
t->et.et_start = hpet_start;
t->et.et_stop = hpet_stop;
t->et.et_priv = &sc->t[i];
OpenPOWER on IntegriCloud