diff options
author | Stefan Assmann <sassmann@kpanic.de> | 2015-04-22 10:25:56 -0400 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2015-04-25 14:20:42 +0200 |
commit | ea8b7cd797ca0cd30ae94dc15941cf91f93b4529 (patch) | |
tree | 7e59eeb8d2ee40bf895f130149b4f41ddf6837e0 /backport | |
parent | 9f55c4e8b0b0cc4bca00d2c9dd3d5926106fcc6f (diff) |
backports: deal with struct timespec64 changes
In kernel 3.17 struct timespec64 was introduced.
commit 361a3bf00582469877f8d18ff20f1efa6b781274
Author: John Stultz <john.stultz@linaro.org>
Date: Wed Jul 16 21:03:58 2014 +0000
time64: Add time64.h header and define struct timespec64
git describe --contains 361a3bf00582469877f8d18ff20f1efa6b781274
v3.17-rc1~109^2~62
Deal with the required changes via defines.
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
[Moved defines into the same header files as in mailine kernel, removed some ktime_*]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/backport-include/linux/ktime.h | 5 | ||||
-rw-r--r-- | backport/backport-include/linux/time.h | 7 | ||||
-rw-r--r-- | backport/backport-include/linux/time64.h | 24 |
3 files changed, 36 insertions, 0 deletions
diff --git a/backport/backport-include/linux/ktime.h b/backport/backport-include/linux/ktime.h index adefc270..6fbc6c6e 100644 --- a/backport/backport-include/linux/ktime.h +++ b/backport/backport-include/linux/ktime.h @@ -9,4 +9,9 @@ extern ktime_t ktime_get_raw(void); #endif /* < 3.17 */ +#ifndef ktime_to_timespec64 +/* Map the ktime_t to timespec conversion to ns_to_timespec function */ +#define ktime_to_timespec64(kt) ns_to_timespec64((kt).tv64) +#endif + #endif /* __BACKPORT_LINUX_KTIME_H */ diff --git a/backport/backport-include/linux/time.h b/backport/backport-include/linux/time.h new file mode 100644 index 00000000..3191047d --- /dev/null +++ b/backport/backport-include/linux/time.h @@ -0,0 +1,7 @@ +#ifndef __BACKPORT_LINUX_TIME_H +#define __BACKPORT_LINUX_TIME_H +#include_next <linux/time.h> + +#include <linux/time64.h> + +#endif /* __BACKPORT_LINUX_TIME_H */ diff --git a/backport/backport-include/linux/time64.h b/backport/backport-include/linux/time64.h new file mode 100644 index 00000000..31a7f1be --- /dev/null +++ b/backport/backport-include/linux/time64.h @@ -0,0 +1,24 @@ +#ifndef __BACKPORT_LINUX_TIME64_H +#define __BACKPORT_LINUX_TIME64_H +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) +#include_next <linux/time64.h> +#else +#include <linux/time.h> +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) +#define timespec64_equal timespec_equal +#define timespec64_compare timespec_compare +#define set_normalized_timespec64 set_normalized_timespec +#define timespec64_add_safe timespec_add_safe +#define timespec64_add timespec_add +#define timespec64_sub timespec_sub +#define timespec64_valid timespec_valid +#define timespec64_valid_strict timespec_valid_strict +#define timespec64_to_ns timespec_to_ns +#define ns_to_timespec64 ns_to_timespec +#define timespec64_add_ns timespec_add_ns +#define timespec64 timespec +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) */ + +#endif /* __BACKPORT_LINUX_TIME64_H */ |