kernel: tick-sched: Add API to get the next wakeup for a CPU

Add get_next_event_cpu to get the next wakeup time for the CPU. This
is used by the sleep driver if it has to query the next wakeup for a
CPU other than the thread that its running on.

Change-Id: I889de90928b9b1e51a51b2f9205d7865facfcc20
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
This commit is contained in:
Mahesh Sivasubramanian 2017-01-26 16:37:08 -07:00 • committed by Gerrit - the friendly Code Review server
commit 930e2352bf
2 changed files with 6 additions and 0 deletions

View file

@ -304,4 +304,5 @@ static inline void tick_nohz_task_switch(void)
__tick_nohz_task_switch();
}
ktime_t *get_next_event_cpu(unsigned int cpu);
#endif

View file

@ -1342,3 +1342,8 @@ int tick_check_oneshot_change(int allow_nohz)
tick_nohz_switch_to_nohz();
return 0;
}
ktime_t *get_next_event_cpu(unsigned int cpu)
{
return &(per_cpu(tick_cpu_device, cpu).evtdev->next_event);
}