Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * MIPS64 and compat userspace implementations of gettimeofday()
0004  * and similar.
0005  *
0006  * Copyright (C) 2015 Imagination Technologies
0007  * Copyright (C) 2018 ARM Limited
0008  *
0009  */
0010 #include <linux/time.h>
0011 #include <linux/types.h>
0012 
0013 #if _MIPS_SIM != _MIPS_SIM_ABI64
0014 int __vdso_clock_gettime(clockid_t clock,
0015              struct old_timespec32 *ts)
0016 {
0017     return __cvdso_clock_gettime32(clock, ts);
0018 }
0019 
0020 #ifdef CONFIG_MIPS_CLOCK_VSYSCALL
0021 
0022 /*
0023  * This is behind the ifdef so that we don't provide the symbol when there's no
0024  * possibility of there being a usable clocksource, because there's nothing we
0025  * can do without it. When libc fails the symbol lookup it should fall back on
0026  * the standard syscall path.
0027  */
0028 int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
0029             struct timezone *tz)
0030 {
0031     return __cvdso_gettimeofday(tv, tz);
0032 }
0033 
0034 #endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
0035 
0036 int __vdso_clock_getres(clockid_t clock_id,
0037             struct old_timespec32 *res)
0038 {
0039     return __cvdso_clock_getres_time32(clock_id, res);
0040 }
0041 
0042 int __vdso_clock_gettime64(clockid_t clock,
0043                struct __kernel_timespec *ts)
0044 {
0045     return __cvdso_clock_gettime(clock, ts);
0046 }
0047 
0048 #else
0049 
0050 int __vdso_clock_gettime(clockid_t clock,
0051              struct __kernel_timespec *ts)
0052 {
0053     return __cvdso_clock_gettime(clock, ts);
0054 }
0055 
0056 #ifdef CONFIG_MIPS_CLOCK_VSYSCALL
0057 
0058 /*
0059  * This is behind the ifdef so that we don't provide the symbol when there's no
0060  * possibility of there being a usable clocksource, because there's nothing we
0061  * can do without it. When libc fails the symbol lookup it should fall back on
0062  * the standard syscall path.
0063  */
0064 int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
0065             struct timezone *tz)
0066 {
0067     return __cvdso_gettimeofday(tv, tz);
0068 }
0069 
0070 #endif /* CONFIG_MIPS_CLOCK_VSYSCALL */
0071 
0072 int __vdso_clock_getres(clockid_t clock_id,
0073             struct __kernel_timespec *res)
0074 {
0075     return __cvdso_clock_getres(clock_id, res);
0076 }
0077 
0078 #endif