diff options
author | mav <mav@FreeBSD.org> | 2013-02-28 13:46:03 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-02-28 13:46:03 +0000 |
commit | 6cf7cc6e4d8da1cf9aba1c481b914e4ca5e9f38f (patch) | |
tree | c8556591f85961643a9b4ddfaaa7c1008bb03d81 /sys/x86/isa/clock.c | |
parent | 240074414d4919ebd889f27087c72783a7ed9b19 (diff) | |
download | FreeBSD-src-6cf7cc6e4d8da1cf9aba1c481b914e4ca5e9f38f.zip FreeBSD-src-6cf7cc6e4d8da1cf9aba1c481b914e4ca5e9f38f.tar.gz |
MFcalloutng:
Switch eventtimers(9) from using struct bintime to sbintime_t.
Even before this not a single driver really supported full dynamic range of
struct bintime even in theory, not speaking about practical inexpediency.
This change legitimates the status quo and cleans up the code.
Diffstat (limited to 'sys/x86/isa/clock.c')
-rw-r--r-- | sys/x86/isa/clock.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/x86/isa/clock.c b/sys/x86/isa/clock.c index 232c913..29ec02d 100644 --- a/sys/x86/isa/clock.c +++ b/sys/x86/isa/clock.c @@ -589,18 +589,17 @@ i8254_get_timecount(struct timecounter *tc) } static int -attimer_start(struct eventtimer *et, - struct bintime *first, struct bintime *period) +attimer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { device_t dev = (device_t)et->et_priv; struct attimer_softc *sc = device_get_softc(dev); - if (period != NULL) { + if (period != 0) { sc->mode = MODE_PERIODIC; - sc->period = period->frac >> 32; + sc->period = period; } else { sc->mode = MODE_ONESHOT; - sc->period = first->frac >> 32; + sc->period = first; } if (!sc->intr_en) { i8254_intsrc->is_pic->pic_enable_source(i8254_intsrc); @@ -755,12 +754,8 @@ attimer_attach(device_t dev) sc->et.et_flags |= ET_FLAGS_ONESHOT; sc->et.et_quality = 100; sc->et.et_frequency = i8254_freq; - sc->et.et_min_period.sec = 0; - sc->et.et_min_period.frac = - ((0x0002LLU << 48) / i8254_freq) << 16; - sc->et.et_max_period.sec = 0xffff / i8254_freq; - sc->et.et_max_period.frac = - ((0xfffeLLU << 48) / i8254_freq) << 16; + sc->et.et_min_period = (0x0002LLU << 32) / i8254_freq; + sc->et.et_max_period = (0xfffeLLU << 32) / i8254_freq; sc->et.et_start = attimer_start; sc->et.et_stop = attimer_stop; sc->et.et_priv = dev; |