Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: vdso: Enable arm to use common headers

Enable arm to use only the common headers in the implementation
of the vDSO library.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <linux@armlinux.org.uk>
Link: https://lkml.kernel.org/r/20200320145351.32292-25-vincenzo.frascino@arm.com

authored by

Vincenzo Frascino and committed by
Thomas Gleixner
78c85161 abc22418

+64 -31
+1 -19
arch/arm/include/asm/cp15.h
··· 50 50 51 51 #ifdef CONFIG_CPU_CP15 52 52 53 - #define __ACCESS_CP15(CRn, Op1, CRm, Op2) \ 54 - "mrc", "mcr", __stringify(p15, Op1, %0, CRn, CRm, Op2), u32 55 - #define __ACCESS_CP15_64(Op1, CRm) \ 56 - "mrrc", "mcrr", __stringify(p15, Op1, %Q0, %R0, CRm), u64 57 - 58 - #define __read_sysreg(r, w, c, t) ({ \ 59 - t __val; \ 60 - asm volatile(r " " c : "=r" (__val)); \ 61 - __val; \ 62 - }) 63 - #define read_sysreg(...) __read_sysreg(__VA_ARGS__) 64 - 65 - #define __write_sysreg(v, r, w, c, t) asm volatile(w " " c : : "r" ((t)(v))) 66 - #define write_sysreg(v, ...) __write_sysreg(v, __VA_ARGS__) 67 - 68 - #define BPIALL __ACCESS_CP15(c7, 0, c5, 6) 69 - #define ICIALLU __ACCESS_CP15(c7, 0, c5, 0) 70 - 71 - #define CNTVCT __ACCESS_CP15_64(1, c14) 53 + #include <asm/vdso/cp15.h> 72 54 73 55 extern unsigned long cr_alignment; /* defined in entry-armv.S */ 74 56
+1 -10
arch/arm/include/asm/processor.h
··· 14 14 #include <asm/ptrace.h> 15 15 #include <asm/types.h> 16 16 #include <asm/unified.h> 17 + #include <asm/vdso/processor.h> 17 18 18 19 #ifdef __KERNEL__ 19 20 #define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \ ··· 85 84 extern void release_thread(struct task_struct *); 86 85 87 86 unsigned long get_wchan(struct task_struct *p); 88 - 89 - #if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327) 90 - #define cpu_relax() \ 91 - do { \ 92 - smp_mb(); \ 93 - __asm__ __volatile__("nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;"); \ 94 - } while (0) 95 - #else 96 - #define cpu_relax() barrier() 97 - #endif 98 87 99 88 #define task_pt_regs(p) \ 100 89 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
+38
arch/arm/include/asm/vdso/cp15.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Copyright (C) 2020 ARM Ltd. 4 + */ 5 + #ifndef __ASM_VDSO_CP15_H 6 + #define __ASM_VDSO_CP15_H 7 + 8 + #ifndef __ASSEMBLY__ 9 + 10 + #ifdef CONFIG_CPU_CP15 11 + 12 + #include <linux/stringify.h> 13 + 14 + #define __ACCESS_CP15(CRn, Op1, CRm, Op2) \ 15 + "mrc", "mcr", __stringify(p15, Op1, %0, CRn, CRm, Op2), u32 16 + #define __ACCESS_CP15_64(Op1, CRm) \ 17 + "mrrc", "mcrr", __stringify(p15, Op1, %Q0, %R0, CRm), u64 18 + 19 + #define __read_sysreg(r, w, c, t) ({ \ 20 + t __val; \ 21 + asm volatile(r " " c : "=r" (__val)); \ 22 + __val; \ 23 + }) 24 + #define read_sysreg(...) __read_sysreg(__VA_ARGS__) 25 + 26 + #define __write_sysreg(v, r, w, c, t) asm volatile(w " " c : : "r" ((t)(v))) 27 + #define write_sysreg(v, ...) __write_sysreg(v, __VA_ARGS__) 28 + 29 + #define BPIALL __ACCESS_CP15(c7, 0, c5, 6) 30 + #define ICIALLU __ACCESS_CP15(c7, 0, c5, 0) 31 + 32 + #define CNTVCT __ACCESS_CP15_64(1, c14) 33 + 34 + #endif /* CONFIG_CPU_CP15 */ 35 + 36 + #endif /* __ASSEMBLY__ */ 37 + 38 + #endif /* __ASM_VDSO_CP15_H */
+2 -2
arch/arm/include/asm/vdso/gettimeofday.h
··· 7 7 8 8 #ifndef __ASSEMBLY__ 9 9 10 - #include <asm/barrier.h> 11 - #include <asm/cp15.h> 10 + #include <asm/errno.h> 12 11 #include <asm/unistd.h> 12 + #include <asm/vdso/cp15.h> 13 13 #include <uapi/linux/time.h> 14 14 15 15 #define VDSO_HAS_CLOCK_GETRES 1
+22
arch/arm/include/asm/vdso/processor.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Copyright (C) 2020 ARM Ltd. 4 + */ 5 + #ifndef __ASM_VDSO_PROCESSOR_H 6 + #define __ASM_VDSO_PROCESSOR_H 7 + 8 + #ifndef __ASSEMBLY__ 9 + 10 + #if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327) 11 + #define cpu_relax() \ 12 + do { \ 13 + smp_mb(); \ 14 + __asm__ __volatile__("nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;"); \ 15 + } while (0) 16 + #else 17 + #define cpu_relax() barrier() 18 + #endif 19 + 20 + #endif /* __ASSEMBLY__ */ 21 + 22 + #endif /* __ASM_VDSO_PROCESSOR_H */