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