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/ia64 | |
parent | bcc31f462ba76b89e3789cb24393126466e3775d (diff) | |
parent | 5d33901b24a0ca4496b12ca2299df4b62dfdfd35 (diff) | |
download | FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.zip FreeBSD-src-e98f58faf63a90d85e0e2ad78353915f9615a4eb.tar.gz |
MFC
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/clock.c | 22 | ||||
-rw-r--r-- | sys/ia64/ia64/machdep.c | 7 |
2 files changed, 11 insertions, 18 deletions
diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c index 24623c5..37a99a1 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -105,17 +105,14 @@ ia64_ih_clock(struct thread *td, u_int xiv, struct trapframe *tf) * Event timer start method. */ static int -ia64_clock_start(struct eventtimer *et, struct bintime *first, - struct bintime *period) +ia64_clock_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { u_long itc, load; register_t is; - if (period != NULL) { + if (period != 0) { PCPU_SET(md.clock_mode, CLOCK_ET_PERIODIC); - load = (et->et_frequency * (period->frac >> 32)) >> 32; - if (period->sec > 0) - load += et->et_frequency * period->sec; + load = (et->et_frequency * period) >> 32; } else { PCPU_SET(md.clock_mode, CLOCK_ET_ONESHOT); load = 0; @@ -123,11 +120,8 @@ ia64_clock_start(struct eventtimer *et, struct bintime *first, PCPU_SET(md.clock_load, load); - if (first != NULL) { - load = (et->et_frequency * (first->frac >> 32)) >> 32; - if (first->sec > 0) - load += et->et_frequency * first->sec; - } + if (first != 0) + load = (et->et_frequency * first) >> 32; is = intr_disable(); itc = ia64_get_itc(); @@ -185,10 +179,8 @@ clock_configure(void *dummy) et->et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; et->et_quality = 1000; et->et_frequency = itc_freq; - et->et_min_period.sec = 0; - et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1; - et->et_max_period.sec = 0xffffffff; - et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; + et->et_min_period = SBT_1S / (10 * hz); + et->et_max_period = (0xfffffffeul << 32) / itc_freq; et->et_start = ia64_clock_start; et->et_stop = ia64_clock_stop; et->et_priv = NULL; diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 2bc4a65..5373151 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -172,7 +172,7 @@ extern vm_offset_t ksym_start, ksym_end; struct msgbuf *msgbufp = NULL; /* Other subsystems (e.g., ACPI) can hook this later. */ -void (*cpu_idle_hook)(void) = NULL; +void (*cpu_idle_hook)(sbintime_t) = NULL; struct kva_md_info kmi; @@ -409,10 +409,11 @@ void cpu_idle(int busy) { register_t ie; + sbintime_t sbt = -1; if (!busy) { critical_enter(); - cpu_idleclock(); + sbt = cpu_idleclock(); } ie = intr_disable(); @@ -421,7 +422,7 @@ cpu_idle(int busy) if (sched_runnable()) ia64_enable_intr(); else if (cpu_idle_hook != NULL) { - (*cpu_idle_hook)(); + (*cpu_idle_hook)(sbt); /* The hook must enable interrupts! */ } else { ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0); |