aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ktime.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-02-23 22:05:47 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-23 22:05:47 -0500
commita00428f5b149e36b8225b2a0812742a6dfb07b8c (patch)
treea78869cd67cf78a0eb091fb0ea5d397734bd6738 /include/linux/ktime.h
parent774fee58c465ea1c7e9775e347ec307bcf2deeb3 (diff)
parentfb5c594c2acc441f0d2d8f457484a0e0e9285db3 (diff)
Merge ../powerpc-merge
Diffstat (limited to 'include/linux/ktime.h')
-rw-r--r--include/linux/ktime.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 6aca67a569a2..f3dec45ef874 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -96,10 +96,16 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
96 ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; }) 96 ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
97 97
98/* convert a timespec to ktime_t format: */ 98/* convert a timespec to ktime_t format: */
99#define timespec_to_ktime(ts) ktime_set((ts).tv_sec, (ts).tv_nsec) 99static inline ktime_t timespec_to_ktime(struct timespec ts)
100{
101 return ktime_set(ts.tv_sec, ts.tv_nsec);
102}
100 103
101/* convert a timeval to ktime_t format: */ 104/* convert a timeval to ktime_t format: */
102#define timeval_to_ktime(tv) ktime_set((tv).tv_sec, (tv).tv_usec * 1000) 105static inline ktime_t timeval_to_ktime(struct timeval tv)
106{
107 return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC);
108}
103 109
104/* Map the ktime_t to timespec conversion to ns_to_timespec function */ 110/* Map the ktime_t to timespec conversion to ns_to_timespec function */
105#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) 111#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64)