diff options
author | mav <mav@FreeBSD.org> | 2010-07-20 10:58:56 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-07-20 10:58:56 +0000 |
commit | 1021ed9c1fb242e77973084e90e83ad8f307080a (patch) | |
tree | a2ade1a810689c7741fce55a1e8c698c5abacbdc /sys/x86/isa | |
parent | 19bed51cff8dcac07d39993556ad270818a248cd (diff) | |
download | FreeBSD-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/x86/isa')
-rw-r--r-- | sys/x86/isa/atrtc.c | 6 | ||||
-rw-r--r-- | sys/x86/isa/clock.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c index 5a5ba63..b01e933 100644 --- a/sys/x86/isa/atrtc.c +++ b/sys/x86/isa/atrtc.c @@ -276,9 +276,13 @@ atrtc_attach(device_t dev) bus_bind_intr(dev, sc->intr_res, 0); } sc->et.et_name = "RTC"; - sc->et.et_flags = ET_FLAGS_PERIODIC; + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_POW2DIV; sc->et.et_quality = 0; sc->et.et_frequency = 32768; + sc->et.et_min_period.sec = 0; + sc->et.et_min_period.frac = 0x0008LL << 48; + sc->et.et_max_period.sec = 0; + sc->et.et_max_period.frac = 0x8000LL << 48; sc->et.et_start = rtc_start; sc->et.et_stop = rtc_stop; sc->et.et_priv = dev; diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c index 6b5fede..62869a6 100644 --- a/sys/x86/isa/clock.c +++ b/sys/x86/isa/clock.c @@ -665,6 +665,11 @@ attimer_attach(device_t dev) sc->et.et_flags = ET_FLAGS_PERIODIC; sc->et.et_quality = 100; sc->et.et_frequency = i8254_freq; + sc->et.et_min_period.sec = 0; + sc->et.et_min_period.frac = ((1LL << 62) / i8254_freq) << 2; + sc->et.et_max_period.sec = 0xffff / i8254_freq; + sc->et.et_max_period.frac = + ((0xffffLL << 48) / i8254_freq) << 16; sc->et.et_start = attimer_start; sc->et.et_stop = attimer_stop; sc->et.et_priv = dev; |