@@ -211,6 +211,7 @@ static inline void cpuidle_use_deepest_state(bool enable)
/* kernel/sched/idle.c */
extern void sched_idle_set_state(struct cpuidle_state *idle_state);
+extern struct cpuidle_state *sched_idle_get_state(int cpu);
extern void default_idle_call(void);
#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
@@ -21,6 +21,17 @@ void sched_idle_set_state(struct cpuidle_state *idle_state)
idle_set_state(this_rq(), idle_state);
}
+/**
+ * sched_idle_get_state - Get idle state for the specified CPU.
+ * @index: CPU index.
+ */
+
+struct cpuidle_state *sched_idle_get_state(int cpu)
+{
+ return idle_get_state(cpu_rq(cpu));
+}
+
+
static int __read_mostly cpu_idle_force_poll;
void cpu_idle_poll_ctrl(bool enable)
This helper is useful in order to get the idle state of a specific cpu. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> --- include/linux/cpuidle.h | 1 + kernel/sched/idle.c | 11 +++++++++++ 2 files changed, 12 insertions(+)