Skip to content

Commit 14ee2ac

Browse files
fvincenzoKAGA-KOKO
authored andcommitted
linux/clocksource.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 clocksource.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-9-vincenzo.frascino@arm.com
1 parent 17e4665 commit 14ee2ac

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

include/linux/clocksource.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,7 @@ struct module;
2828
#include <asm/clocksource.h>
2929
#endif
3030

31-
enum vdso_clock_mode {
32-
VDSO_CLOCKMODE_NONE,
33-
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
34-
VDSO_ARCH_CLOCKMODES,
35-
#endif
36-
VDSO_CLOCKMODE_MAX,
37-
38-
/* Indicator for time namespace VDSO */
39-
VDSO_CLOCKMODE_TIMENS = INT_MAX
40-
};
31+
#include <vdso/clocksource.h>
4132

4233
/**
4334
* struct clocksource - hardware abstraction for a free running counter

include/vdso/clocksource.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __VDSO_CLOCKSOURCE_H
3+
#define __VDSO_CLOCKSOURCE_H
4+
5+
#include <vdso/limits.h>
6+
7+
#if defined(CONFIG_ARCH_CLOCKSOURCE_DATA) || \
8+
defined(CONFIG_GENERIC_GETTIMEOFDAY)
9+
#include <asm/vdso/clocksource.h>
10+
#endif /* CONFIG_ARCH_CLOCKSOURCE_DATA || CONFIG_GENERIC_GETTIMEOFDAY */
11+
12+
enum vdso_clock_mode {
13+
VDSO_CLOCKMODE_NONE,
14+
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
15+
VDSO_ARCH_CLOCKMODES,
16+
#endif
17+
VDSO_CLOCKMODE_MAX,
18+
19+
/* Indicator for time namespace VDSO */
20+
VDSO_CLOCKMODE_TIMENS = INT_MAX
21+
};
22+
23+
#endif /* __VDSO_CLOCKSOURCE_H */

0 commit comments

Comments
 (0)