aboutsummaryrefslogtreecommitdiff
path: root/sys/ia64/ia64
diff options
context:
space:
mode:
authorDavide Italiano <davide@FreeBSD.org>2013-02-28 10:46:54 +0000
committerDavide Italiano <davide@FreeBSD.org>2013-02-28 10:46:54 +0000
commitacccf7d8b4896ba5a0f622d846bed66125f5c40a (patch)
tree33c7f3089361e0ab5379fdc8445540c6eeb03ed0 /sys/ia64/ia64
parent0f4fc79e2fcc50b027e0fe63887f860cb913a670 (diff)
downloadsrc-acccf7d8b4896ba5a0f622d846bed66125f5c40a.tar.gz
src-acccf7d8b4896ba5a0f622d846bed66125f5c40a.zip
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.
Notes
Notes: svn path=/head/; revision=247454
Diffstat (limited to 'sys/ia64/ia64')
-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 98bcf446d7a0..ac6a8291c92c 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);