diff options
author | attilio <attilio@FreeBSD.org> | 2013-03-02 14:48:41 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-03-02 14:48:41 +0000 |
commit | e98f58faf63a90d85e0e2ad78353915f9615a4eb (patch) | |
tree | b9feaa4bea034f2e9d11c7eb34aa95c672a3a86b /sys/powerpc/aim | |
parent | bcc31f462ba76b89e3789cb24393126466e3775d (diff) | |
parent | 5d33901b24a0ca4496b12ca2299df4b62dfdfd35 (diff) | |
download | FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.zip FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.tar.gz |
MFC
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r-- | sys/powerpc/aim/clock.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/sys/powerpc/aim/clock.c b/sys/powerpc/aim/clock.c index 0bf7cfa..ae98d26 100644 --- a/sys/powerpc/aim/clock.c +++ b/sys/powerpc/aim/clock.c @@ -85,7 +85,7 @@ static u_long ticks_per_sec = 12500000; static u_long *decr_counts[MAXCPU]; static int decr_et_start(struct eventtimer *et, - struct bintime *first, struct bintime *period); + sbintime_t first, sbintime_t period); static int decr_et_stop(struct eventtimer *et); static timecounter_get_t decr_get_timecount; @@ -195,12 +195,8 @@ decr_tc_init(void) ET_FLAGS_PERCPU; decr_et.et_quality = 1000; decr_et.et_frequency = ticks_per_sec; - decr_et.et_min_period.sec = 0; - decr_et.et_min_period.frac = - ((0x00000002LLU << 32) / ticks_per_sec) << 32; - decr_et.et_max_period.sec = 0x7fffffffLLU / ticks_per_sec; - decr_et.et_max_period.frac = - ((0x7fffffffLLU << 32) / ticks_per_sec) << 32; + decr_et.et_min_period = (0x00000002LLU << 32) / ticks_per_sec; + decr_et.et_max_period = (0x7fffffffLLU << 32) / ticks_per_sec; decr_et.et_start = decr_et_start; decr_et.et_stop = decr_et_stop; decr_et.et_priv = NULL; @@ -212,24 +208,20 @@ decr_tc_init(void) */ static int decr_et_start(struct eventtimer *et, - struct bintime *first, struct bintime *period) + sbintime_t first, sbintime_t period) { struct decr_state *s = DPCPU_PTR(decr_state); uint32_t fdiv; - if (period != NULL) { + if (period != 0) { s->mode = 1; - s->div = (decr_et.et_frequency * (period->frac >> 32)) >> 32; - if (period->sec != 0) - s->div += decr_et.et_frequency * period->sec; + s->div = (decr_et.et_frequency * period) >> 32; } else { s->mode = 2; - s->div = 0x7fffffff; + s->div = 0; } - if (first != NULL) { - fdiv = (decr_et.et_frequency * (first->frac >> 32)) >> 32; - if (first->sec != 0) - fdiv += decr_et.et_frequency * first->sec; + if (first != 0) { + fdiv = (decr_et.et_frequency * first) >> 32; } else fdiv = s->div; |