]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ARM: vdso: Set BUILD_VDSO32 and provide 32bit fallbacks
authorThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jan 2020 08:41:09 +0000 (09:41 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jan 2020 11:20:43 +0000 (12:20 +0100)
Setting BUILD_VDSO32 is required to expose the legacy 32bit interfaces in
the generic VDSO code which are going to be hidden behind an #ifdef
BUILD_VDSO32.

The 32bit fallbacks are necessary to remove the existing
VDSO_HAS_32BIT_FALLBACK hackery.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/87tv4zq9dc.fsf@nanos.tec.linutronix.de
arch/arm/include/asm/vdso/gettimeofday.h
arch/arm/vdso/Makefile

index 0ad2429c324f6f9387c5350a1b9e93a963e8abec..fe6e1f65932d5fb363629a206d5e6cf18220f5b4 100644 (file)
@@ -52,6 +52,24 @@ static __always_inline long clock_gettime_fallback(
        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)
@@ -70,6 +88,24 @@ static __always_inline int clock_getres_fallback(
        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");
+
+       return ret;
+}
+
 static __always_inline u64 __arch_get_hw_counter(int clock_mode)
 {
 #ifdef CONFIG_ARM_ARCH_TIMER
index 0fda344beb0bf7802125313ebd56120863a78e9d..1babb392e70a40624b479556535c6d9eeb8001a8 100644 (file)
@@ -14,7 +14,7 @@ targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.so.raw vdso.lds
 obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
 
 ccflags-y := -fPIC -fno-common -fno-builtin -fno-stack-protector
-ccflags-y += -DDISABLE_BRANCH_PROFILING
+ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO32
 
 ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8
 ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \