Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions
cpuidle.c File Reference
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/notifier.h>
#include <linux/pm_qos.h>
#include <linux/cpu.h>
#include <linux/cpuidle.h>
#include <linux/ktime.h>
#include <linux/hrtimer.h>
#include <linux/module.h>
#include <trace/events/power.h>
#include "cpuidle.h"

Go to the source code of this file.

Macros

#define latency_notifier_init(x)   do { } while (0)
 

Typedefs

typedef int(* cpuidle_enter_t )(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)
 

Functions

 DEFINE_PER_CPU (struct cpuidle_device *, cpuidle_devices)
 
 DEFINE_MUTEX (cpuidle_lock)
 
 LIST_HEAD (cpuidle_detected_devices)
 
int cpuidle_disabled (void)
 
void disable_cpuidle (void)
 
int cpuidle_play_dead (void)
 
int cpuidle_enter_state (struct cpuidle_device *dev, struct cpuidle_driver *drv, int next_state)
 
int cpuidle_idle_call (void)
 
void cpuidle_install_idle_handler (void)
 
void cpuidle_uninstall_idle_handler (void)
 
void cpuidle_pause_and_lock (void)
 
 EXPORT_SYMBOL_GPL (cpuidle_pause_and_lock)
 
void cpuidle_resume_and_unlock (void)
 
 EXPORT_SYMBOL_GPL (cpuidle_resume_and_unlock)
 
void cpuidle_pause (void)
 
void cpuidle_resume (void)
 
int cpuidle_wrap_enter (struct cpuidle_device *dev, struct cpuidle_driver *drv, int index, int(*enter)(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index))
 
int cpuidle_enable_device (struct cpuidle_device *dev)
 
 EXPORT_SYMBOL_GPL (cpuidle_enable_device)
 
void cpuidle_disable_device (struct cpuidle_device *dev)
 
 EXPORT_SYMBOL_GPL (cpuidle_disable_device)
 
int cpuidle_register_device (struct cpuidle_device *dev)
 
 EXPORT_SYMBOL_GPL (cpuidle_register_device)
 
void cpuidle_unregister_device (struct cpuidle_device *dev)
 
 EXPORT_SYMBOL_GPL (cpuidle_unregister_device)
 
 module_param (off, int, 0444)
 
 core_initcall (cpuidle_init)
 

Macro Definition Documentation

#define latency_notifier_init (   x)    do { } while (0)

Definition at line 518 of file cpuidle.c.

Typedef Documentation

typedef int(* cpuidle_enter_t)(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index)

Definition at line 58 of file cpuidle.c.

Function Documentation

core_initcall ( cpuidle_init  )
void cpuidle_disable_device ( struct cpuidle_device dev)

cpuidle_disable_device - disables idle PM for a CPU : the CPU

This function must be called between cpuidle_pause_and_lock and cpuidle_resume_and_unlock when used externally.

Definition at line 369 of file cpuidle.c.

int cpuidle_disabled ( void  )

Definition at line 34 of file cpuidle.c.

int cpuidle_enable_device ( struct cpuidle_device dev)

cpuidle_enable_device - enables idle PM for a CPU : the CPU

This function must be called between cpuidle_pause_and_lock and cpuidle_resume_and_unlock when used externally.

Definition at line 308 of file cpuidle.c.

int cpuidle_enter_state ( struct cpuidle_device dev,
struct cpuidle_driver drv,
int  next_state 
)

cpuidle_enter_state - enter the state and update stats : cpuidle device for this cpu : cpuidle driver for this cpu : index into drv->states of the state to enter

Definition at line 100 of file cpuidle.c.

int cpuidle_idle_call ( void  )

cpuidle_idle_call - the main idle loop

NOTE: no locks or semaphores should be used here return non-zero on failure

Definition at line 128 of file cpuidle.c.

void cpuidle_install_idle_handler ( void  )

cpuidle_install_idle_handler - installs the cpuidle idle loop handler

Definition at line 173 of file cpuidle.c.

void cpuidle_pause ( void  )

Definition at line 216 of file cpuidle.c.

void cpuidle_pause_and_lock ( void  )

cpuidle_pause_and_lock - temporarily disables CPUIDLE

Definition at line 196 of file cpuidle.c.

int cpuidle_play_dead ( void  )

cpuidle_play_dead - cpu off-lining

Returns in case of an error or no driver

Definition at line 68 of file cpuidle.c.

int cpuidle_register_device ( struct cpuidle_device dev)

cpuidle_register_device - registers a CPU's idle PM feature : the cpu

Definition at line 432 of file cpuidle.c.

void cpuidle_resume ( void  )

Definition at line 224 of file cpuidle.c.

void cpuidle_resume_and_unlock ( void  )

cpuidle_resume_and_unlock - resumes CPUIDLE operation

Definition at line 207 of file cpuidle.c.

void cpuidle_uninstall_idle_handler ( void  )

cpuidle_uninstall_idle_handler - uninstalls the cpuidle idle loop handler

Definition at line 185 of file cpuidle.c.

void cpuidle_unregister_device ( struct cpuidle_device dev)

cpuidle_unregister_device - unregisters a CPU's idle PM feature : the cpu

Definition at line 461 of file cpuidle.c.

int cpuidle_wrap_enter ( struct cpuidle_device dev,
struct cpuidle_driver drv,
int  index,
int(*)(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index enter 
)

cpuidle_wrap_enter - performs timekeeping and irqen around enter function : pointer to a valid cpuidle_device object : pointer to a valid cpuidle_driver object : index of the target cpuidle state.

Definition at line 237 of file cpuidle.c.

DEFINE_MUTEX ( cpuidle_lock  )
DEFINE_PER_CPU ( struct cpuidle_device ,
cpuidle_devices   
)
void disable_cpuidle ( void  )

Definition at line 38 of file cpuidle.c.

EXPORT_SYMBOL_GPL ( cpuidle_pause_and_lock  )
EXPORT_SYMBOL_GPL ( cpuidle_resume_and_unlock  )
EXPORT_SYMBOL_GPL ( cpuidle_enable_device  )
EXPORT_SYMBOL_GPL ( cpuidle_disable_device  )
EXPORT_SYMBOL_GPL ( cpuidle_register_device  )
EXPORT_SYMBOL_GPL ( cpuidle_unregister_device  )
LIST_HEAD ( cpuidle_detected_devices  )
module_param ( off  ,
int  ,
0444   
)