diff options
author | Vincenzo Frascino <vincenzo.frascino@arm.com> | 2019-06-21 10:52:46 +0100 |
---|---|---|
committer | Paul Burton <paul.burton@mips.com> | 2019-07-25 21:45:05 -0700 |
commit | 24640f233b466051ad3a5d2786d2951e43026c9d (patch) | |
tree | ca9acaf821110f4d249dd4a250d7a9b740675261 /arch/mips/vdso/vgettimeofday.c | |
parent | c2aeaaea175652af6610f97a0de6d7cd07311e18 (diff) |
mips: Add support for generic vDSO
The mips vDSO library requires some adaptations to take advantage of the
newly introduced generic vDSO library.
Introduce the following changes:
- Modification of vdso.c to be compliant with the common vdso datapage
- Use of lib/vdso for gettimeofday
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
[paul.burton@mips.com: Prepend $(src) to config-n32-o32-env.c path.]
Signed-off-by: Paul Burton <paul.burton@mips.com>
Diffstat (limited to 'arch/mips/vdso/vgettimeofday.c')
-rw-r--r-- | arch/mips/vdso/vgettimeofday.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/mips/vdso/vgettimeofday.c b/arch/mips/vdso/vgettimeofday.c new file mode 100644 index 000000000000..1c46dace041e --- /dev/null +++ b/arch/mips/vdso/vgettimeofday.c @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * MIPS64 and compat userspace implementations of gettimeofday() + * and similar. + * + * Copyright (C) 2015 Imagination Technologies + * Copyright (C) 2018 ARM Limited + * + */ +#include <linux/time.h> +#include <linux/types.h> + +#if _MIPS_SIM != _MIPS_SIM_ABI64 +int __vdso_clock_gettime(clockid_t clock, + struct old_timespec32 *ts) +{ + return __cvdso_clock_gettime32(clock, ts); +} + +int __vdso_gettimeofday(struct __kernel_old_timeval *tv, + struct timezone *tz) +{ + return __cvdso_gettimeofday(tv, tz); +} + +#else + +int __vdso_clock_gettime(clockid_t clock, + struct __kernel_timespec *ts) +{ + return __cvdso_clock_gettime(clock, ts); +} + +int __vdso_gettimeofday(struct __kernel_old_timeval *tv, + struct timezone *tz) +{ + return __cvdso_gettimeofday(tv, tz); +} + +#endif |