mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
9e50ed7721
The ARM architected system counter has at least 56 usable bits. Add support for counters with more than 32 bits to the generic sched_clock implementation so we can increase the time between wakeups due to dealing with wrap-around on these devices while benefiting from the irqtime accounting and suspend/resume handling that the generic sched_clock code already has. On my system using 56 bits over 32 bits changes the wraparound time from a few minutes to an hour. For faster running counters (GHz range) this is even more important because we may not be able to execute the timer in time to deal with the wraparound if only 32 bits are used. We choose a maxsec value of 3600 seconds because we assume no system will go idle for more than an hour. In the future we may need to increase this value. Note: All users should switch over to the 64-bit read function so we can remove setup_sched_clock() in favor of sched_clock_register(). Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Git-commit: e7e3ff1bfe9c42ee31172e9afdc0383a9e595e29 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Ian Maund <imaund@codeaurora.org>
23 lines
693 B
C
23 lines
693 B
C
/*
|
|
* sched_clock.h: support for extending counters to full 64-bit ns counter
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
#ifndef LINUX_SCHED_CLOCK
|
|
#define LINUX_SCHED_CLOCK
|
|
|
|
#ifdef CONFIG_GENERIC_SCHED_CLOCK
|
|
extern void sched_clock_postinit(void);
|
|
#else
|
|
static inline void sched_clock_postinit(void) { }
|
|
#endif
|
|
|
|
extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
|
|
extern void sched_clock_register(u64 (*read)(void), int bits,
|
|
unsigned long rate);
|
|
|
|
extern unsigned long long (*sched_clock_func)(void);
|
|
|
|
#endif
|