1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * MIPS64 and compat userspace implementations of gettimeofday() 4 * and similar. 5 * 6 * Copyright (C) 2015 Imagination Technologies 7 * Copyright (C) 2018 ARM Limited 8 * 9 */ 10 #include <linux/time.h> 11 #include <linux/types.h> 12 #include <vdso/gettime.h> 13 14 #if _MIPS_SIM != _MIPS_SIM_ABI64 15 16 #ifdef CONFIG_COMPAT_32BIT_TIME 17 int __vdso_clock_gettime(clockid_t clock, 18 struct old_timespec32 *ts) 19 { 20 return __cvdso_clock_gettime32(clock, ts); 21 } 22 23 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, 24 struct timezone *tz) 25 { 26 return __cvdso_gettimeofday(tv, tz); 27 } 28 29 int __vdso_clock_getres(clockid_t clock_id, 30 struct old_timespec32 *res) 31 { 32 return __cvdso_clock_getres_time32(clock_id, res); 33 } 34 #endif /* CONFIG_COMPAT_32BIT_TIME */ 35 36 int __vdso_clock_gettime64(clockid_t clock, 37 struct __kernel_timespec *ts) 38 { 39 return __cvdso_clock_gettime(clock, ts); 40 } 41 42 int __vdso_clock_getres_time64(clockid_t clock, struct __kernel_timespec *ts) 43 { 44 return __cvdso_clock_getres(clock, ts); 45 } 46 47 #else 48 49 int __vdso_clock_gettime(clockid_t clock, 50 struct __kernel_timespec *ts) 51 { 52 return __cvdso_clock_gettime(clock, ts); 53 } 54 55 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, 56 struct timezone *tz) 57 { 58 return __cvdso_gettimeofday(tv, tz); 59 } 60 61 int __vdso_clock_getres(clockid_t clock_id, 62 struct __kernel_timespec *res) 63 { 64 return __cvdso_clock_getres(clock_id, res); 65 } 66 67 #endif 68