Messages in this thread Patch in this message | | | Subject | Re: MIPS: bug: gettimeofday syscall broken on CI20 board | From | Vincenzo Frascino <> | Date | Fri, 29 Nov 2019 10:53:24 +0000 |
| |
Hi Nikolaus,
On 11/29/19 8:57 AM, Vincenzo Frascino wrote: > On 11/28/19 4:47 PM, H. Nikolaus Schaller wrote: >> Well, it does not immediately compile because CONFIG_MIPS_CLOCK_VSYSCALL is not >> set and can not be configured by normal means: >> >> Error: >> >> /Volumes/CaseSensitive/master/lib/vdso/gettimeofday.c: In function '__cvdso_gettimeofday': >> /Volumes/CaseSensitive/master/lib/vdso/gettimeofday.c:152:4: error: implicit declaration of function 'gettimeofday_fallback' [-Werror=implicit-function-declaration] >> return gettimeofday_fallback(tv, tz); > > Oops, I just realized that I had other changes not committed that's why it does > not build for you directly. Sometimes I get so excited for fixing a problem that > I forget bits and peaces :) Sorry about that. > > I am happy to hear that this sorts out the issue though. I will send out a new > series to test. >
Could you please try the patch in attachment? It should be all this time.
Thanks!
-- Regards, Vincenzo From 6ee7d583444f7edb1b5b8e834253b34efe4ff257 Mon Sep 17 00:00:00 2001 From: Vincenzo Frascino <vinfra01@e120585-lin.cambridge.arm.com> Date: Fri, 29 Nov 2019 10:01:18 +0000 Subject: [PATCH] mips32 gettimeofday fix
Signed-off-by: Vincenzo Frascino <vinfra01@e120585-lin.cambridge.arm.com> --- arch/mips/include/asm/vdso/gettimeofday.h | 13 ------------- arch/mips/vdso/vgettimeofday.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/arch/mips/include/asm/vdso/gettimeofday.h b/arch/mips/include/asm/vdso/gettimeofday.h index b08825531e9f..0ae9b4cbc153 100644 --- a/arch/mips/include/asm/vdso/gettimeofday.h +++ b/arch/mips/include/asm/vdso/gettimeofday.h @@ -26,8 +26,6 @@ #define __VDSO_USE_SYSCALL ULLONG_MAX -#ifdef CONFIG_MIPS_CLOCK_VSYSCALL - static __always_inline long gettimeofday_fallback( struct __kernel_old_timeval *_tv, struct timezone *_tz) @@ -48,17 +46,6 @@ static __always_inline long gettimeofday_fallback( return error ? -ret : ret; } -#else - -static __always_inline long gettimeofday_fallback( - struct __kernel_old_timeval *_tv, - struct timezone *_tz) -{ - return -1; -} - -#endif - static __always_inline long clock_gettime_fallback( clockid_t _clkid, struct __kernel_timespec *_ts) diff --git a/arch/mips/vdso/vgettimeofday.c b/arch/mips/vdso/vgettimeofday.c index 6ebdc37c89fc..6b83b6376a4b 100644 --- a/arch/mips/vdso/vgettimeofday.c +++ b/arch/mips/vdso/vgettimeofday.c @@ -17,12 +17,22 @@ int __vdso_clock_gettime(clockid_t clock, return __cvdso_clock_gettime32(clock, ts); } +#ifdef CONFIG_MIPS_CLOCK_VSYSCALL + +/* + * This is behind the ifdef so that we don't provide the symbol when there's no + * possibility of there being a usable clocksource, because there's nothing we + * can do without it. When libc fails the symbol lookup it should fall back on + * the standard syscall path. + */ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { return __cvdso_gettimeofday(tv, tz); } +#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ + int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res) { @@ -43,12 +53,22 @@ int __vdso_clock_gettime(clockid_t clock, return __cvdso_clock_gettime(clock, ts); } +#ifdef CONFIG_MIPS_CLOCK_VSYSCALL + +/* + * This is behind the ifdef so that we don't provide the symbol when there's no + * possibility of there being a usable clocksource, because there's nothing we + * can do without it. When libc fails the symbol lookup it should fall back on + * the standard syscall path. + */ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { return __cvdso_gettimeofday(tv, tz); } +#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ + int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res) { -- 2.24.0
| |