Merge tag 'fortglx-3.20-time' of https://git.linaro.org/people/john.stultz/linux into timers/core
Pull time updates from John Stultz for 3.20: * ktime division optimization * Expose a few more y2038-safe timekeeping interfaces * RTC core changes to address y2038
This commit is contained in:
@@ -266,7 +266,7 @@ lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
|
||||
/*
|
||||
* Divide a ktime value by a nanosecond value
|
||||
*/
|
||||
u64 ktime_divns(const ktime_t kt, s64 div)
|
||||
u64 __ktime_divns(const ktime_t kt, s64 div)
|
||||
{
|
||||
u64 dclc;
|
||||
int sft = 0;
|
||||
@@ -282,7 +282,7 @@ u64 ktime_divns(const ktime_t kt, s64 div)
|
||||
|
||||
return dclc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ktime_divns);
|
||||
EXPORT_SYMBOL_GPL(__ktime_divns);
|
||||
#endif /* BITS_PER_LONG >= 64 */
|
||||
|
||||
/*
|
||||
|
@@ -488,13 +488,13 @@ static void sync_cmos_clock(struct work_struct *work)
|
||||
|
||||
getnstimeofday64(&now);
|
||||
if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec * 5) {
|
||||
struct timespec adjust = timespec64_to_timespec(now);
|
||||
struct timespec64 adjust = now;
|
||||
|
||||
fail = -ENODEV;
|
||||
if (persistent_clock_is_local)
|
||||
adjust.tv_sec -= (sys_tz.tz_minuteswest * 60);
|
||||
#ifdef CONFIG_GENERIC_CMOS_UPDATE
|
||||
fail = update_persistent_clock(adjust);
|
||||
fail = update_persistent_clock(timespec64_to_timespec(adjust));
|
||||
#endif
|
||||
#ifdef CONFIG_RTC_SYSTOHC
|
||||
if (fail == -ENODEV)
|
||||
|
@@ -1659,24 +1659,24 @@ out:
|
||||
}
|
||||
|
||||
/**
|
||||
* getboottime - Return the real time of system boot.
|
||||
* @ts: pointer to the timespec to be set
|
||||
* getboottime64 - Return the real time of system boot.
|
||||
* @ts: pointer to the timespec64 to be set
|
||||
*
|
||||
* Returns the wall-time of boot in a timespec.
|
||||
* Returns the wall-time of boot in a timespec64.
|
||||
*
|
||||
* This is based on the wall_to_monotonic offset and the total suspend
|
||||
* time. Calls to settimeofday will affect the value returned (which
|
||||
* basically means that however wrong your real time clock is at boot time,
|
||||
* you get the right time here).
|
||||
*/
|
||||
void getboottime(struct timespec *ts)
|
||||
void getboottime64(struct timespec64 *ts)
|
||||
{
|
||||
struct timekeeper *tk = &tk_core.timekeeper;
|
||||
ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot);
|
||||
|
||||
*ts = ktime_to_timespec(t);
|
||||
*ts = ktime_to_timespec64(t);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(getboottime);
|
||||
EXPORT_SYMBOL_GPL(getboottime64);
|
||||
|
||||
unsigned long get_seconds(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user