Couple of items for 3.20
* ktime division optimization * Expose a few more y2038-safe timekeeping interfaces * RTC core changes to address y2038 Signed-off-by: John Stultz <john.stultz@linaro.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJUwvXJAAoJEK8vClot3jMxTAoH/1DMT3fuVx6RFjKJ/P1abIB+ +w3cfEgEWgkSwYmuS0XHq1WppnQ0p0n1GOJcWUPiP9tTGrKcTdp5uG5qMprcga3q XoeR8wefkyEKyH4ukStdGKQKot2Vj117TauDtVNPf2eOOBS5pqOw1dYUlwjlMtOj 45poW5ORNKmBMn90e22k8nlNSI9PebvMh9w6nzeYJWEibdyk96z2TOk1puPTvws/ ppyNzlhnKckpNb49JVxE8B4DNRpXsUV+aUxRNyRPN4OdqCGzHwIJCyEKi6+nbRyb 4HMUhfl8eRB2Iu7zHF2a2XEOqJdOjl8i1DsTwr3Vwd3crf4XkXD6WtTtGl2YKkU= =YhDu -----END PGP SIGNATURE----- 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:
commit
fe31fca35d
10 changed files with 63 additions and 46 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue