aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/xen
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2013-02-28 13:46:03 +0000
committerAlexander Motin <mav@FreeBSD.org>2013-02-28 13:46:03 +0000
commitfdc5dd2d2fedb812958cf7c835a5dce2dcd874c5 (patch)
treec8556591f85961643a9b4ddfaaa7c1008bb03d81 /sys/i386/xen
parentd9ddf0c057f436df4eb9ac8b8a60640a84394f08 (diff)
downloadsrc-fdc5dd2d2fedb812958cf7c835a5dce2dcd874c5.tar.gz
src-fdc5dd2d2fedb812958cf7c835a5dce2dcd874c5.zip
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.
Notes
Notes: svn path=/head/; revision=247463
Diffstat (limited to 'sys/i386/xen')
-rw-r--r--sys/i386/xen/clock.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/sys/i386/xen/clock.c b/sys/i386/xen/clock.c
index 4e43a12c03e3..a10b5462b7a1 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;