Skip to content

Commit b72a9c5

Browse files
thule-vincenzoKAGA-KOKO
authored andcommitted
linux/time64.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 time64.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-13-vincenzo.frascino@arm.com
1 parent 9a41623 commit b72a9c5

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

‎include/linux/time64.h‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define _LINUX_TIME64_H
44

55
#include <linux/math64.h>
6+
#include <vdso/time64.h>
67

78
typedef __s64 time64_t;
89
typedef __u64 timeu64_t;
@@ -19,15 +20,6 @@ struct itimerspec64 {
1920
struct timespec64 it_value;
2021
};
2122

22-
/* Parameters used to convert the timespec values: */
23-
#define MSEC_PER_SEC 1000L
24-
#define USEC_PER_MSEC 1000L
25-
#define NSEC_PER_USEC 1000L
26-
#define NSEC_PER_MSEC 1000000L
27-
#define USEC_PER_SEC 1000000L
28-
#define NSEC_PER_SEC 1000000000L
29-
#define FSEC_PER_SEC 1000000000000000LL
30-
3123
/* Located here for timespec[64]_valid_strict */
3224
#define TIME64_MAX ((s64)~((u64)1 << 63))
3325
#define TIME64_MIN (-TIME64_MAX - 1)

‎include/vdso/time64.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __VDSO_TIME64_H
3+
#define __VDSO_TIME64_H
4+
5+
/* Parameters used to convert the timespec values: */
6+
#define MSEC_PER_SEC 1000L
7+
#define USEC_PER_MSEC 1000L
8+
#define NSEC_PER_USEC 1000L
9+
#define NSEC_PER_MSEC 1000000L
10+
#define USEC_PER_SEC 1000000L
11+
#define NSEC_PER_SEC 1000000000L
12+
#define FSEC_PER_SEC 1000000000000000LL
13+
14+
#endif /* __VDSO_TIME64_H */

0 commit comments

Comments
 (0)