summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-02-28 13:46:03 +0000
committermav <mav@FreeBSD.org>2013-02-28 13:46:03 +0000
commit6cf7cc6e4d8da1cf9aba1c481b914e4ca5e9f38f (patch)
treec8556591f85961643a9b4ddfaaa7c1008bb03d81 /sys/powerpc/aim
parent240074414d4919ebd889f27087c72783a7ed9b19 (diff)
downloadFreeBSD-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/powerpc/aim')
-rw-r--r--sys/powerpc/aim/clock.c26
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;
OpenPOWER on IntegriCloud