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/i386/xen | |
parent | bcc31f462ba76b89e3789cb24393126466e3775d (diff) | |
parent | 5d33901b24a0ca4496b12ca2299df4b62dfdfd35 (diff) | |
download | FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.zip FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.tar.gz |
MFC
Diffstat (limited to 'sys/i386/xen')
-rw-r--r-- | sys/i386/xen/clock.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/sys/i386/xen/clock.c b/sys/i386/xen/clock.c index 4e43a12..a10b546 100644 --- a/sys/i386/xen/clock.c +++ b/sys/i386/xen/clock.c @@ -768,8 +768,7 @@ resettodr() #endif static int -xen_et_start(struct eventtimer *et, - struct bintime *first, struct bintime *period) +xen_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { struct xen_et_state *state = DPCPU_PTR(et_state); struct shadow_time_info *shadow; @@ -777,21 +776,16 @@ xen_et_start(struct eventtimer *et, __get_time_values_from_xen(); - if (period != NULL) { + if (period != 0) { state->mode = MODE_PERIODIC; - state->period = (1000000000LL * - (uint32_t)(period->frac >> 32)) >> 32; - if (period->sec != 0) - state->period += 1000000000LL * period->sec; + state->period = (1000000000LLU * period) >> 32; } else { state->mode = MODE_ONESHOT; state->period = 0; } - if (first != NULL) { - fperiod = (1000000000LL * (uint32_t)(first->frac >> 32)) >> 32; - if (first->sec != 0) - fperiod += 1000000000LL * first->sec; - } else + if (first != 0) + fperiod = (1000000000LLU * first) >> 32; + else fperiod = state->period; shadow = &per_cpu(shadow_time, smp_processor_id()); @@ -832,11 +826,9 @@ cpu_initclocks(void) xen_et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; xen_et.et_quality = 600; - xen_et.et_frequency = 0; - xen_et.et_min_period.sec = 0; - xen_et.et_min_period.frac = 0x00400000LL << 32; - xen_et.et_max_period.sec = 2; - xen_et.et_max_period.frac = 0; + xen_et.et_frequency = 1000000000; + xen_et.et_min_period = 0x00400000LL; + xen_et.et_max_period = (0xfffffffeLLU << 32) / xen_et.et_frequency; xen_et.et_start = xen_et_start; xen_et.et_stop = xen_et_stop; xen_et.et_priv = NULL; |