Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / include / linux / cpuidle.h
index 07b83d3..bb31373 100644 (file)
@@ -252,4 +252,22 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
 #define CPUIDLE_DRIVER_STATE_START     0
 #endif
 
+#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx)       \
+({                                                             \
+       int __ret;                                              \
+                                                               \
+       if (!idx) {                                             \
+               cpu_do_idle();                                  \
+               return idx;                                     \
+       }                                                       \
+                                                               \
+       __ret = cpu_pm_enter();                                 \
+       if (!__ret) {                                           \
+               __ret = low_level_idle_enter(idx);              \
+               cpu_pm_exit();                                  \
+       }                                                       \
+                                                               \
+       __ret ? -1 : idx;                                       \
+})
+
 #endif /* _LINUX_CPUIDLE_H */