xref: /linux/arch/mips/vdso/vgettimeofday.c (revision bba2c3615bd6cfee7456d1130f2e6b01b3f4e9ba)
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 int __vdso_clock_gettime(clockid_t clock,
16 			 struct old_timespec32 *ts)
17 {
18 	return __cvdso_clock_gettime32(clock, ts);
19 }
20 
21 int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
22 			struct timezone *tz)
23 {
24 	return __cvdso_gettimeofday(tv, tz);
25 }
26 
27 int __vdso_clock_getres(clockid_t clock_id,
28 			struct old_timespec32 *res)
29 {
30 	return __cvdso_clock_getres_time32(clock_id, res);
31 }
32 
33 int __vdso_clock_gettime64(clockid_t clock,
34 			   struct __kernel_timespec *ts)
35 {
36 	return __cvdso_clock_gettime(clock, ts);
37 }
38 
39 int __vdso_clock_getres_time64(clockid_t clock, struct __kernel_timespec *ts)
40 {
41 	return __cvdso_clock_getres(clock, ts);
42 }
43 
44 #else
45 
46 int __vdso_clock_gettime(clockid_t clock,
47 			 struct __kernel_timespec *ts)
48 {
49 	return __cvdso_clock_gettime(clock, ts);
50 }
51 
52 int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
53 			struct timezone *tz)
54 {
55 	return __cvdso_gettimeofday(tv, tz);
56 }
57 
58 int __vdso_clock_getres(clockid_t clock_id,
59 			struct __kernel_timespec *res)
60 {
61 	return __cvdso_clock_getres(clock_id, res);
62 }
63 
64 #endif
65