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

linux/ktime.h: Extract common header for vDSO

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.

Split ktime.h into linux and common headers to make the latter suitable
for inclusion in the vDSO library.

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-15-vincenzo.frascino@arm.com

authored by

Vincenzo Frascino and committed by
Thomas Gleixner
cc56f32f 97b01d2e

+17 -8
+1 -8
include/linux/ktime.h
··· 253 253 } 254 254 } 255 255 256 - /* 257 - * The resolution of the clocks. The resolution value is returned in 258 - * the clock_getres() system call to give application programmers an 259 - * idea of the (in)accuracy of timers. Timer values are rounded up to 260 - * this resolution values. 261 - */ 262 - #define LOW_RES_NSEC TICK_NSEC 263 - #define KTIME_LOW_RES (LOW_RES_NSEC) 256 + #include <vdso/ktime.h> 264 257 265 258 static inline ktime_t ns_to_ktime(u64 ns) 266 259 {
+16
include/vdso/ktime.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __VDSO_KTIME_H 3 + #define __VDSO_KTIME_H 4 + 5 + #include <vdso/jiffies.h> 6 + 7 + /* 8 + * The resolution of the clocks. The resolution value is returned in 9 + * the clock_getres() system call to give application programmers an 10 + * idea of the (in)accuracy of timers. Timer values are rounded up to 11 + * this resolution values. 12 + */ 13 + #define LOW_RES_NSEC TICK_NSEC 14 + #define KTIME_LOW_RES (LOW_RES_NSEC) 15 + 16 + #endif /* __VDSO_KTIME_H */