aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpuidle.h
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2014-03-03 02:48:50 -0500
committerIngo Molnar <mingo@kernel.org>2014-03-11 06:52:45 -0400
commit907e30f1bb4a9656d351aa705c1e5931da908701 (patch)
treead5f47cbc477986bb2bc5b0a111053f276d3f82b /include/linux/cpuidle.h
parentd27c8438eeedb6e1367b592c101e3c87cca0b50f (diff)
idle/cpuidle: Split cpuidle_idle_call main function into smaller functions
In order to allow better integration between the cpuidle framework and the scheduler, reducing the distance between these two sub-components will facilitate this integration by moving part of the cpuidle code in the idle task file and, because idle.c is in the sched directory, we have access to the scheduler's private structures. This patch splits the cpuidle_idle_call main entry function into 3 calls to a newly added API: 1. select the idle state 2. enter the idle state 3. reflect the idle state The cpuidle_idle_call calls these three functions to implement the main idle entry function. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: rjw@rjwysocki.net Cc: preeti@linux.vnet.ibm.com Link: http://lkml.kernel.org/r/1393832934-11625-1-git-send-email-daniel.lezcano@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/cpuidle.h')
-rw-r--r--include/linux/cpuidle.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 50fcbb0ac4e7..accc2dd72049 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -119,6 +119,15 @@ struct cpuidle_driver {
119 119
120#ifdef CONFIG_CPU_IDLE 120#ifdef CONFIG_CPU_IDLE
121extern void disable_cpuidle(void); 121extern void disable_cpuidle(void);
122
123extern int cpuidle_enabled(struct cpuidle_driver *drv,
124 struct cpuidle_device *dev);
125extern int cpuidle_select(struct cpuidle_driver *drv,
126 struct cpuidle_device *dev);
127extern int cpuidle_enter(struct cpuidle_driver *drv,
128 struct cpuidle_device *dev, int index);
129extern void cpuidle_reflect(struct cpuidle_device *dev, int index);
130
122extern int cpuidle_idle_call(void); 131extern int cpuidle_idle_call(void);
123extern int cpuidle_register_driver(struct cpuidle_driver *drv); 132extern int cpuidle_register_driver(struct cpuidle_driver *drv);
124extern struct cpuidle_driver *cpuidle_get_driver(void); 133extern struct cpuidle_driver *cpuidle_get_driver(void);
@@ -141,6 +150,16 @@ extern int cpuidle_play_dead(void);
141extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); 150extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
142#else 151#else
143static inline void disable_cpuidle(void) { } 152static inline void disable_cpuidle(void) { }
153static inline int cpuidle_enabled(struct cpuidle_driver *drv,
154 struct cpuidle_device *dev)
155{return -ENODEV; }
156static inline int cpuidle_select(struct cpuidle_driver *drv,
157 struct cpuidle_device *dev)
158{return -ENODEV; }
159static inline int cpuidle_enter(struct cpuidle_driver *drv,
160 struct cpuidle_device *dev, int index)
161{return -ENODEV; }
162static inline void cpuidle_reflect(struct cpuidle_device *dev, int index) { }
144static inline int cpuidle_idle_call(void) { return -ENODEV; } 163static inline int cpuidle_idle_call(void) { return -ENODEV; }
145static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 164static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
146{return -ENODEV; } 165{return -ENODEV; }