Lines Matching refs:ts

131 	struct timespec64 ts;
133 ts.tv_sec = tk->xtime_sec;
134 ts.tv_nsec = (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift);
135 return ts;
138 static void tk_set_xtime(struct timekeeper *tk, const struct timespec64 *ts)
140 tk->xtime_sec = ts->tv_sec;
141 tk->tkr_mono.xtime_nsec = (u64)ts->tv_nsec << tk->tkr_mono.shift;
144 static void tk_xtime_add(struct timekeeper *tk, const struct timespec64 *ts)
146 tk->xtime_sec += ts->tv_sec;
147 tk->tkr_mono.xtime_nsec += (u64)ts->tv_nsec << tk->tkr_mono.shift;
813 * @ts: pointer to the timespec to be set
817 void ktime_get_real_ts64(struct timespec64 *ts)
828 ts->tv_sec = tk->xtime_sec;
833 ts->tv_nsec = 0;
834 timespec64_add_ns(ts, nsecs);
965 * @ts: pointer to timespec variable
969 * in normalized timespec64 format in the variable pointed to by @ts.
971 void ktime_get_ts64(struct timespec64 *ts)
982 ts->tv_sec = tk->xtime_sec;
988 ts->tv_sec += tomono.tv_sec;
989 ts->tv_nsec = 0;
990 timespec64_add_ns(ts, nsec + tomono.tv_nsec);
1111 * @ts: Cross timestamp that should be adjusted using
1126 struct system_device_crosststamp *ts)
1147 ktime_sub(ts->sys_monoraw, history->raw));
1165 ktime_sub(ts->sys_realtime, history->real));
1174 ts->sys_monoraw = ktime_add_ns(history->raw, corr_raw);
1175 ts->sys_realtime = ktime_add_ns(history->real, corr_real);
1177 ts->sys_monoraw = ktime_sub_ns(ts->sys_monoraw, corr_raw);
1178 ts->sys_realtime = ktime_sub_ns(ts->sys_realtime, corr_real);
1185 * timestamp_in_interval - true if ts is chronologically in [start, end]
1187 * True if ts occurs chronologically at or after start, and before or at end.
1189 static bool timestamp_in_interval(u64 start, u64 end, u64 ts)
1191 if (ts >= start && ts <= end)
1193 if (start > end && (ts >= start || ts <= end))
1311 * @ts: pointer to the timespec64 variable containing the new time
1315 int do_settimeofday64(const struct timespec64 *ts)
1322 if (!timespec64_valid_settod(ts))
1331 ts_delta = timespec64_sub(*ts, xt);
1340 tk_set_xtime(tk, ts);
1352 add_device_randomness(ts, sizeof(*ts));
1361 * @ts: Pointer to the timespec variable containing the offset
1365 static int timekeeping_inject_offset(const struct timespec64 *ts)
1372 if (ts->tv_nsec < 0 || ts->tv_nsec >= NSEC_PER_SEC)
1381 tmp = timespec64_add(tk_xtime(tk), *ts);
1382 if (timespec64_compare(&tk->wall_to_monotonic, ts) > 0 ||
1388 tk_xtime_add(tk, ts);
1389 tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *ts));
1516 * @ts: pointer to the timespec64 to be set
1520 void ktime_get_raw_ts64(struct timespec64 *ts)
1528 ts->tv_sec = tk->raw_sec;
1533 ts->tv_nsec = 0;
1534 timespec64_add_ns(ts, nsecs);
1579 * @ts: Pointer to the storage for the readout value
1587 void __weak read_persistent_clock64(struct timespec64 *ts)
1589 ts->tv_sec = 0;
1590 ts->tv_nsec = 0;
2089 struct timespec64 ts;
2093 ts.tv_sec = leap;
2094 ts.tv_nsec = 0;
2096 timespec64_sub(tk->wall_to_monotonic, ts));
2240 * @ts: pointer to the timespec64 to be set
2249 void getboottime64(struct timespec64 *ts)
2254 *ts = ktime_to_timespec64(t);
2258 void ktime_get_coarse_real_ts64(struct timespec64 *ts)
2266 *ts = tk_xtime(tk);
2271 void ktime_get_coarse_ts64(struct timespec64 *ts)
2284 set_normalized_timespec64(ts, now.tv_sec + mono.tv_sec,
2430 struct timespec64 ts;
2456 ktime_get_real_ts64(&ts);
2457 add_device_randomness(&ts, sizeof(ts));
2463 ret = __do_adjtimex(txc, &ts, &tai, &ad);