cpuidle.c (c39f2d9db0fd81ea20bb5cce9b3f082ca63753e2) | cpuidle.c (259231a045616c4101d023a8f4dcc8379af265a6) |
---|---|
1/* 2 * cpuidle.c - core cpuidle infrastructure 3 * 4 * (C) 2006-2007 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 5 * Shaohua Li <shaohua.li@intel.com> 6 * Adam Belay <abelay@novell.com> 7 * 8 * This code is licenced under the GPL. --- 348 unchanged lines hidden (view full) --- 357 */ 358void cpuidle_reflect(struct cpuidle_device *dev, int index) 359{ 360 if (cpuidle_curr_governor->reflect && index >= 0) 361 cpuidle_curr_governor->reflect(dev, index); 362} 363 364/** | 1/* 2 * cpuidle.c - core cpuidle infrastructure 3 * 4 * (C) 2006-2007 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 5 * Shaohua Li <shaohua.li@intel.com> 6 * Adam Belay <abelay@novell.com> 7 * 8 * This code is licenced under the GPL. --- 348 unchanged lines hidden (view full) --- 357 */ 358void cpuidle_reflect(struct cpuidle_device *dev, int index) 359{ 360 if (cpuidle_curr_governor->reflect && index >= 0) 361 cpuidle_curr_governor->reflect(dev, index); 362} 363 364/** |
365 * cpuidle_poll_time - return amount of time to poll for, 366 * governors can override dev->poll_limit_ns if necessary 367 * 368 * @drv: the cpuidle driver tied with the cpu 369 * @dev: the cpuidle device 370 * 371 */ 372u64 cpuidle_poll_time(struct cpuidle_driver *drv, 373 struct cpuidle_device *dev) 374{ 375 int i; 376 u64 limit_ns; 377 378 if (dev->poll_limit_ns) 379 return dev->poll_limit_ns; 380 381 limit_ns = TICK_NSEC; 382 for (i = 1; i < drv->state_count; i++) { 383 if (drv->states[i].disabled || dev->states_usage[i].disable) 384 continue; 385 386 limit_ns = (u64)drv->states[i].target_residency * NSEC_PER_USEC; 387 } 388 389 dev->poll_limit_ns = limit_ns; 390 391 return dev->poll_limit_ns; 392} 393 394/** |
|
365 * cpuidle_install_idle_handler - installs the cpuidle idle loop handler 366 */ 367void cpuidle_install_idle_handler(void) 368{ 369 if (enabled_devices) { 370 /* Make sure all changes finished before we switch to new idle */ 371 smp_wmb(); 372 initialized = 1; --- 378 unchanged lines hidden --- | 395 * cpuidle_install_idle_handler - installs the cpuidle idle loop handler 396 */ 397void cpuidle_install_idle_handler(void) 398{ 399 if (enabled_devices) { 400 /* Make sure all changes finished before we switch to new idle */ 401 smp_wmb(); 402 initialized = 1; --- 378 unchanged lines hidden --- |