summaryrefslogtreecommitdiffstats
path: root/sys/ia64/ia64/machdep.c
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2013-02-28 10:46:54 +0000
committerdavide <davide@FreeBSD.org>2013-02-28 10:46:54 +0000
commit2bf12d0c7ceced74a813d6940dd07310a11d6a2a (patch)
tree33c7f3089361e0ab5379fdc8445540c6eeb03ed0 /sys/ia64/ia64/machdep.c
parentf3c985cbe184c9d4c31d0e7140c146768a82833c (diff)
downloadFreeBSD-src-2bf12d0c7ceced74a813d6940dd07310a11d6a2a.zip
FreeBSD-src-2bf12d0c7ceced74a813d6940dd07310a11d6a2a.tar.gz
MFcalloutng:
When CPU becomes idle, cpu_idleclock() calculates time to the next timer event in order to reprogram hw timer. Return that time in sbintime_t to the caller and pass it to acpi_cpu_idle(), where it can be used as one more factor (quite precise) to extimate furter sleep time and choose optimal sleep state. This is a preparatory change for further callout improvements will be committed in the next days. The commmit is not targeted for MFC.
Diffstat (limited to 'sys/ia64/ia64/machdep.c')
-rw-r--r--sys/ia64/ia64/machdep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 98bcf44..ac6a829 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -171,7 +171,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;
@@ -408,10 +408,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();
@@ -420,7 +421,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);
OpenPOWER on IntegriCloud