aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpuidle.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cpuidle.h')
-rw-r--r--include/linux/cpuidle.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 8f7788d23b57..871f9e21810c 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -257,22 +257,30 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
257{return 0;} 257{return 0;}
258#endif 258#endif
259 259
260#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx) \ 260#define __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, is_retention) \
261({ \ 261({ \
262 int __ret; \ 262 int __ret = 0; \
263 \ 263 \
264 if (!idx) { \ 264 if (!idx) { \
265 cpu_do_idle(); \ 265 cpu_do_idle(); \
266 return idx; \ 266 return idx; \
267 } \ 267 } \
268 \ 268 \
269 __ret = cpu_pm_enter(); \ 269 if (!is_retention) \
270 if (!__ret) { \ 270 __ret = cpu_pm_enter(); \
271 __ret = low_level_idle_enter(idx); \ 271 if (!__ret) { \
272 cpu_pm_exit(); \ 272 __ret = low_level_idle_enter(idx); \
273 } \ 273 if (!is_retention) \
274 \ 274 cpu_pm_exit(); \
275 __ret ? -1 : idx; \ 275 } \
276 \
277 __ret ? -1 : idx; \
276}) 278})
277 279
280#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx) \
281 __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, 0)
282
283#define CPU_PM_CPU_IDLE_ENTER_RETENTION(low_level_idle_enter, idx) \
284 __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, 1)
285
278#endif /* _LINUX_CPUIDLE_H */ 286#endif /* _LINUX_CPUIDLE_H */