extern void tick_nohz_idle_exit(void);
extern void tick_nohz_irq_exit(void);
extern ktime_t tick_nohz_get_sleep_length(void);
+extern ktime_t tick_nohz_get_sleep_length_cpu(int cpu);
extern unsigned long tick_nohz_get_idle_calls(void);
extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu);
extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
{
return NSEC_PER_SEC / HZ;
}
+static inline ktime_t tick_nohz_get_sleep_length_cpu(int cpu)
+{
+ return NSEC_PER_SEC / HZ;
+}
static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
#endif /* !CONFIG_NO_HZ_COMMON */
return ts->sleep_length;
}
+/**
+ * tick_nohz_get_sleep_length_cpu - return the length of the current sleep
+ * for a particular CPU.
+ *
+ * Called from power state control code with interrupts disabled
+ */
+ktime_t tick_nohz_get_sleep_length_cpu(int cpu)
+{
+ struct tick_sched *ts = tick_get_tick_sched(cpu);
+
+ return ts->sleep_length;
+}
+
/**
* tick_nohz_get_idle_calls_cpu - return the current idle calls counter value
* for a particular CPU.