[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87muaqqq62.fsf@nanos.tec.linutronix.de>
Date: Tue, 14 Jan 2020 11:37:57 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Vincenzo Frascino <vincenzo.frascino@....com>,
linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
linux-kselftest@...r.kernel.org
Cc: catalin.marinas@....com, will@...nel.org, paul.burton@...s.com,
salyzyn@...roid.com, 0x7f454c46@...il.com, luto@...nel.org
Subject: Re: [PATCH v2 2/8] lib: vdso: Build 32 bit specific functions in the right context
Vincenzo Frascino <vincenzo.frascino@....com> writes:
>
> On 14/01/2020 09:33, Thomas Gleixner wrote:
>> Thomas Gleixner <tglx@...utronix.de> writes:
>>
> [...]
>
>>
>> Bah, it's not fixing it. That's what you get when you compile the wrong
>> tree...
This part is required to cover the BUILD_VDSO32 guard, but then when the
fallback thing is removed it fails again because the 32bit fallbacks are
missing.
The patch below makes it build again.
Thanks,
tglx
8<----------------
--- a/arch/arm/include/asm/vdso/gettimeofday.h
+++ b/arch/arm/include/asm/vdso/gettimeofday.h
@@ -52,6 +52,24 @@ static __always_inline long clock_gettim
return ret;
}
+static __always_inline long clock_gettime32_fallback(
+ clockid_t _clkid,
+ struct old_timespec32 *_ts)
+{
+ register struct old_timespec32 *ts asm("r1") = _ts;
+ register clockid_t clkid asm("r0") = _clkid;
+ register long ret asm ("r0");
+ register long nr asm("r7") = __NR_clock_gettime;
+
+ asm volatile(
+ " swi #0\n"
+ : "=r" (ret)
+ : "r" (clkid), "r" (ts), "r" (nr)
+ : "memory");
+
+ return ret;
+}
+
static __always_inline int clock_getres_fallback(
clockid_t _clkid,
struct __kernel_timespec *_ts)
@@ -63,6 +81,24 @@ static __always_inline int clock_getres_
asm volatile(
" swi #0\n"
+ : "=r" (ret)
+ : "r" (clkid), "r" (ts), "r" (nr)
+ : "memory");
+
+ return ret;
+}
+
+static __always_inline int clock_getres32_fallback(
+ clockid_t _clkid,
+ struct old_timespec32 *_ts)
+{
+ register struct old_timespec32 *ts asm("r1") = _ts;
+ register clockid_t clkid asm("r0") = _clkid;
+ register long ret asm ("r0");
+ register long nr asm("r7") = __NR_clock_getres;
+
+ asm volatile(
+ " swi #0\n"
: "=r" (ret)
: "r" (clkid), "r" (ts), "r" (nr)
: "memory");
Powered by blists - more mailing lists