Loading...
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
13#if _MIPS_SIM != _MIPS_SIM_ABI64
14int __vdso_clock_gettime(clockid_t clock,
15 struct old_timespec32 *ts)
16{
17 return __cvdso_clock_gettime32(clock, ts);
18}
19
20#ifdef CONFIG_MIPS_CLOCK_VSYSCALL
21
22/*
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.
27 */
28int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
29 struct timezone *tz)
30{
31 return __cvdso_gettimeofday(tv, tz);
32}
33
34#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
35
36int __vdso_clock_getres(clockid_t clock_id,
37 struct old_timespec32 *res)
38{
39 return __cvdso_clock_getres_time32(clock_id, res);
40}
41
42int __vdso_clock_gettime64(clockid_t clock,
43 struct __kernel_timespec *ts)
44{
45 return __cvdso_clock_gettime(clock, ts);
46}
47
48#else
49
50int __vdso_clock_gettime(clockid_t clock,
51 struct __kernel_timespec *ts)
52{
53 return __cvdso_clock_gettime(clock, ts);
54}
55
56#ifdef CONFIG_MIPS_CLOCK_VSYSCALL
57
58/*
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.
63 */
64int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
65 struct timezone *tz)
66{
67 return __cvdso_gettimeofday(tv, tz);
68}
69
70#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
71
72int __vdso_clock_getres(clockid_t clock_id,
73 struct __kernel_timespec *res)
74{
75 return __cvdso_clock_getres(clock_id, res);
76}
77
78#endif
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
15int __vdso_clock_gettime(clockid_t clock,
16 struct old_timespec32 *ts)
17{
18 return __cvdso_clock_gettime32(clock, ts);
19}
20
21#ifdef CONFIG_MIPS_CLOCK_VSYSCALL
22
23/*
24 * This is behind the ifdef so that we don't provide the symbol when there's no
25 * possibility of there being a usable clocksource, because there's nothing we
26 * can do without it. When libc fails the symbol lookup it should fall back on
27 * the standard syscall path.
28 */
29int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
30 struct timezone *tz)
31{
32 return __cvdso_gettimeofday(tv, tz);
33}
34
35#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
36
37int __vdso_clock_getres(clockid_t clock_id,
38 struct old_timespec32 *res)
39{
40 return __cvdso_clock_getres_time32(clock_id, res);
41}
42
43int __vdso_clock_gettime64(clockid_t clock,
44 struct __kernel_timespec *ts)
45{
46 return __cvdso_clock_gettime(clock, ts);
47}
48
49#else
50
51int __vdso_clock_gettime(clockid_t clock,
52 struct __kernel_timespec *ts)
53{
54 return __cvdso_clock_gettime(clock, ts);
55}
56
57#ifdef CONFIG_MIPS_CLOCK_VSYSCALL
58
59/*
60 * This is behind the ifdef so that we don't provide the symbol when there's no
61 * possibility of there being a usable clocksource, because there's nothing we
62 * can do without it. When libc fails the symbol lookup it should fall back on
63 * the standard syscall path.
64 */
65int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
66 struct timezone *tz)
67{
68 return __cvdso_gettimeofday(tv, tz);
69}
70
71#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
72
73int __vdso_clock_getres(clockid_t clock_id,
74 struct __kernel_timespec *res)
75{
76 return __cvdso_clock_getres(clock_id, res);
77}
78
79#endif