1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * MIPS64 and compat userspace implementations of gettimeofday()
6 * Copyright (C) 2015 Imagination Technologies
7 * Copyright (C) 2018 ARM Limited
10 #include <linux/time.h>
11 #include <linux/types.h>
13 #if _MIPS_SIM != _MIPS_SIM_ABI64
14 int __vdso_clock_gettime(clockid_t clock
,
15 struct old_timespec32
*ts
)
17 return __cvdso_clock_gettime32(clock
, ts
);
20 #ifdef CONFIG_MIPS_CLOCK_VSYSCALL
23 * This is behind the ifdef so that we don't provide the symbol when there's no
24 * possibility of there being a usable clocksource, because there's nothing we
25 * can do without it. When libc fails the symbol lookup it should fall back on
26 * the standard syscall path.
28 int __vdso_gettimeofday(struct __kernel_old_timeval
*tv
,
31 return __cvdso_gettimeofday(tv
, tz
);
34 #endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
36 int __vdso_clock_getres(clockid_t clock_id
,
37 struct old_timespec32
*res
)
39 return __cvdso_clock_getres_time32(clock_id
, res
);
42 int __vdso_clock_gettime64(clockid_t clock
,
43 struct __kernel_timespec
*ts
)
45 return __cvdso_clock_gettime(clock
, ts
);
50 int __vdso_clock_gettime(clockid_t clock
,
51 struct __kernel_timespec
*ts
)
53 return __cvdso_clock_gettime(clock
, ts
);
56 #ifdef CONFIG_MIPS_CLOCK_VSYSCALL
59 * This is behind the ifdef so that we don't provide the symbol when there's no
60 * possibility of there being a usable clocksource, because there's nothing we
61 * can do without it. When libc fails the symbol lookup it should fall back on
62 * the standard syscall path.
64 int __vdso_gettimeofday(struct __kernel_old_timeval
*tv
,
67 return __cvdso_gettimeofday(tv
, tz
);
70 #endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
72 int __vdso_clock_getres(clockid_t clock_id
,
73 struct __kernel_timespec
*res
)
75 return __cvdso_clock_getres(clock_id
, res
);