提交 dee36654 编写于 作者: D DengChao 提交者: John Stultz

timekeeping: Provide internal function __ktime_get_real_seconds

In order to fix Y2038 issues in the ntp code we will need replace
get_seconds() with ktime_get_real_seconds() but as the ntp code uses
the timekeeping lock which is also used by ktime_get_real_seconds(),
we need a version without locking.
Add a new function __ktime_get_real_seconds() in timekeeping to
do this.
Reviewed-by: NJohn Stultz <john.stultz@linaro.org>
Signed-off-by: NDengChao <chao.deng@linaro.org>
Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
上级 37cf4dc3
...@@ -845,6 +845,19 @@ time64_t ktime_get_real_seconds(void) ...@@ -845,6 +845,19 @@ time64_t ktime_get_real_seconds(void)
} }
EXPORT_SYMBOL_GPL(ktime_get_real_seconds); EXPORT_SYMBOL_GPL(ktime_get_real_seconds);
/**
* __ktime_get_real_seconds - The same as ktime_get_real_seconds
* but without the sequence counter protect. This internal function
* is called just when timekeeping lock is already held.
*/
time64_t __ktime_get_real_seconds(void)
{
struct timekeeper *tk = &tk_core.timekeeper;
return tk->xtime_sec;
}
#ifdef CONFIG_NTP_PPS #ifdef CONFIG_NTP_PPS
/** /**
......
...@@ -26,4 +26,6 @@ static inline cycle_t clocksource_delta(cycle_t now, cycle_t last, cycle_t mask) ...@@ -26,4 +26,6 @@ static inline cycle_t clocksource_delta(cycle_t now, cycle_t last, cycle_t mask)
} }
#endif #endif
extern time64_t __ktime_get_real_seconds(void);
#endif /* _TIMEKEEPING_INTERNAL_H */ #endif /* _TIMEKEEPING_INTERNAL_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册