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

Configure Feed

Select the types of activity you want to include in your feed.

lib/vdso: Enable common headers

The vDSO library should only include the necessary headers required for
a userspace library (UAPI and a minimal set of kernel headers). To make
this possible it is necessary to isolate from the kernel headers the
common parts that are strictly necessary to build the library.

Refactor the unified vdso code to use the common headers.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200320145351.32292-26-vincenzo.frascino@arm.com

authored by

Vincenzo Frascino and committed by
Thomas Gleixner
8c59ab83 78c85161

+30 -25
+30 -3
include/vdso/datapage.h
··· 4 4 5 5 #ifndef __ASSEMBLY__ 6 6 7 - #include <linux/bits.h> 8 - #include <linux/time.h> 9 - #include <linux/types.h> 7 + #include <linux/compiler.h> 8 + #include <uapi/linux/time.h> 9 + #include <uapi/linux/types.h> 10 + #include <uapi/asm-generic/errno-base.h> 11 + 12 + #include <vdso/bits.h> 13 + #include <vdso/clocksource.h> 14 + #include <vdso/ktime.h> 15 + #include <vdso/limits.h> 16 + #include <vdso/math64.h> 17 + #include <vdso/processor.h> 18 + #include <vdso/time.h> 19 + #include <vdso/time32.h> 20 + #include <vdso/time64.h> 10 21 11 22 #define VDSO_BASES (CLOCK_TAI + 1) 12 23 #define VDSO_HRES (BIT(CLOCK_REALTIME) | \ ··· 109 98 * relocation, and this is what we need. 110 99 */ 111 100 extern struct vdso_data _vdso_data[CS_BASES] __attribute__((visibility("hidden"))); 101 + 102 + /* 103 + * The generic vDSO implementation requires that gettimeofday.h 104 + * provides: 105 + * - __arch_get_vdso_data(): to get the vdso datapage. 106 + * - __arch_get_hw_counter(): to get the hw counter based on the 107 + * clock_mode. 108 + * - gettimeofday_fallback(): fallback for gettimeofday. 109 + * - clock_gettime_fallback(): fallback for clock_gettime. 110 + * - clock_getres_fallback(): fallback for clock_getres. 111 + */ 112 + #ifdef ENABLE_COMPAT_VDSO 113 + #include <asm/vdso/compat_gettimeofday.h> 114 + #else 115 + #include <asm/vdso/gettimeofday.h> 116 + #endif /* ENABLE_COMPAT_VDSO */ 112 117 113 118 #endif /* !__ASSEMBLY__ */ 114 119
-22
lib/vdso/gettimeofday.c
··· 2 2 /* 3 3 * Generic userspace implementations of gettimeofday() and similar. 4 4 */ 5 - #include <linux/compiler.h> 6 - #include <linux/math64.h> 7 - #include <linux/time.h> 8 - #include <linux/kernel.h> 9 - #include <linux/hrtimer_defs.h> 10 - #include <linux/clocksource.h> 11 5 #include <vdso/datapage.h> 12 6 #include <vdso/helpers.h> 13 - 14 - /* 15 - * The generic vDSO implementation requires that gettimeofday.h 16 - * provides: 17 - * - __arch_get_vdso_data(): to get the vdso datapage. 18 - * - __arch_get_hw_counter(): to get the hw counter based on the 19 - * clock_mode. 20 - * - gettimeofday_fallback(): fallback for gettimeofday. 21 - * - clock_gettime_fallback(): fallback for clock_gettime. 22 - * - clock_getres_fallback(): fallback for clock_getres. 23 - */ 24 - #ifdef ENABLE_COMPAT_VDSO 25 - #include <asm/vdso/compat_gettimeofday.h> 26 - #else 27 - #include <asm/vdso/gettimeofday.h> 28 - #endif /* ENABLE_COMPAT_VDSO */ 29 7 30 8 #ifndef vdso_calc_delta 31 9 /*