aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/posix-timers.c')
-rw-r--r--kernel/time/posix-timers.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index f215ef792772..68170642c77c 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -204,9 +204,9 @@ static inline void unlock_timer(struct k_itimer *timr, unsigned long flags)
204} 204}
205 205
206/* Get clock_realtime */ 206/* Get clock_realtime */
207static int posix_clock_realtime_get(clockid_t which_clock, struct timespec *tp) 207static int posix_clock_realtime_get(clockid_t which_clock, struct timespec64 *tp)
208{ 208{
209 ktime_get_real_ts(tp); 209 ktime_get_real_ts64(tp);
210 return 0; 210 return 0;
211} 211}
212 212
@@ -229,32 +229,32 @@ static int posix_clock_realtime_adj(const clockid_t which_clock,
229/* 229/*
230 * Get monotonic time for posix timers 230 * Get monotonic time for posix timers
231 */ 231 */
232static int posix_ktime_get_ts(clockid_t which_clock, struct timespec *tp) 232static int posix_ktime_get_ts(clockid_t which_clock, struct timespec64 *tp)
233{ 233{
234 ktime_get_ts(tp); 234 ktime_get_ts64(tp);
235 return 0; 235 return 0;
236} 236}
237 237
238/* 238/*
239 * Get monotonic-raw time for posix timers 239 * Get monotonic-raw time for posix timers
240 */ 240 */
241static int posix_get_monotonic_raw(clockid_t which_clock, struct timespec *tp) 241static int posix_get_monotonic_raw(clockid_t which_clock, struct timespec64 *tp)
242{ 242{
243 getrawmonotonic(tp); 243 getrawmonotonic64(tp);
244 return 0; 244 return 0;
245} 245}
246 246
247 247
248static int posix_get_realtime_coarse(clockid_t which_clock, struct timespec *tp) 248static int posix_get_realtime_coarse(clockid_t which_clock, struct timespec64 *tp)
249{ 249{
250 *tp = current_kernel_time(); 250 *tp = current_kernel_time64();
251 return 0; 251 return 0;
252} 252}
253 253
254static int posix_get_monotonic_coarse(clockid_t which_clock, 254static int posix_get_monotonic_coarse(clockid_t which_clock,
255 struct timespec *tp) 255 struct timespec64 *tp)
256{ 256{
257 *tp = get_monotonic_coarse(); 257 *tp = get_monotonic_coarse64();
258 return 0; 258 return 0;
259} 259}
260 260
@@ -264,15 +264,15 @@ static int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp
264 return 0; 264 return 0;
265} 265}
266 266
267static int posix_get_boottime(const clockid_t which_clock, struct timespec *tp) 267static int posix_get_boottime(const clockid_t which_clock, struct timespec64 *tp)
268{ 268{
269 get_monotonic_boottime(tp); 269 get_monotonic_boottime64(tp);
270 return 0; 270 return 0;
271} 271}
272 272
273static int posix_get_tai(clockid_t which_clock, struct timespec *tp) 273static int posix_get_tai(clockid_t which_clock, struct timespec64 *tp)
274{ 274{
275 timekeeping_clocktai(tp); 275 timekeeping_clocktai64(tp);
276 return 0; 276 return 0;
277} 277}
278 278
@@ -1032,13 +1032,15 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
1032 struct timespec __user *,tp) 1032 struct timespec __user *,tp)
1033{ 1033{
1034 struct k_clock *kc = clockid_to_kclock(which_clock); 1034 struct k_clock *kc = clockid_to_kclock(which_clock);
1035 struct timespec64 kernel_tp64;
1035 struct timespec kernel_tp; 1036 struct timespec kernel_tp;
1036 int error; 1037 int error;
1037 1038
1038 if (!kc) 1039 if (!kc)
1039 return -EINVAL; 1040 return -EINVAL;
1040 1041
1041 error = kc->clock_get(which_clock, &kernel_tp); 1042 error = kc->clock_get(which_clock, &kernel_tp64);
1043 kernel_tp = timespec64_to_timespec(kernel_tp64);
1042 1044
1043 if (!error && copy_to_user(tp, &kernel_tp, sizeof (kernel_tp))) 1045 if (!error && copy_to_user(tp, &kernel_tp, sizeof (kernel_tp)))
1044 error = -EFAULT; 1046 error = -EFAULT;