aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-07-07 07:00:31 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-07-07 07:00:31 -0400
commita40f262cc21fbfd781bbddcc40b16b83a75f5f34 (patch)
tree1600f58173be05f561bcad045bca4014ab635d6f /kernel/hrtimer.c
parent951ed4d36b77ba9fe1ea08fc3c59d8bb6c9bda32 (diff)
timekeeping: Move ktime_get() functions to timekeeping.c
The ktime_get() functions for GENERIC_TIME=n are still located in hrtimer.c. Move them to time/timekeeping.c where they belong. LKML-Reference: <new-submission> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 829e0664b72e..43d151f185b6 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -48,39 +48,6 @@
48 48
49#include <asm/uaccess.h> 49#include <asm/uaccess.h>
50 50
51#ifndef CONFIG_GENERIC_TIME
52/**
53 * ktime_get - get the monotonic time in ktime_t format
54 *
55 * returns the time in ktime_t format
56 */
57ktime_t ktime_get(void)
58{
59 struct timespec now;
60
61 ktime_get_ts(&now);
62
63 return timespec_to_ktime(now);
64}
65EXPORT_SYMBOL_GPL(ktime_get);
66#endif
67
68/**
69 * ktime_get_real - get the real (wall-) time in ktime_t format
70 *
71 * returns the time in ktime_t format
72 */
73ktime_t ktime_get_real(void)
74{
75 struct timespec now;
76
77 getnstimeofday(&now);
78
79 return timespec_to_ktime(now);
80}
81
82EXPORT_SYMBOL_GPL(ktime_get_real);
83
84/* 51/*
85 * The timer bases: 52 * The timer bases:
86 * 53 *
@@ -108,33 +75,6 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
108 } 75 }
109}; 76};
110 77
111#ifndef CONFIG_GENERIC_TIME
112/**
113 * ktime_get_ts - get the monotonic clock in timespec format
114 * @ts: pointer to timespec variable
115 *
116 * The function calculates the monotonic clock from the realtime
117 * clock and the wall_to_monotonic offset and stores the result
118 * in normalized timespec format in the variable pointed to by @ts.
119 */
120void ktime_get_ts(struct timespec *ts)
121{
122 struct timespec tomono;
123 unsigned long seq;
124
125 do {
126 seq = read_seqbegin(&xtime_lock);
127 getnstimeofday(ts);
128 tomono = wall_to_monotonic;
129
130 } while (read_seqretry(&xtime_lock, seq));
131
132 set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec,
133 ts->tv_nsec + tomono.tv_nsec);
134}
135EXPORT_SYMBOL_GPL(ktime_get_ts);
136#endif
137
138/* 78/*
139 * Get the coarse grained time at the softirq based on xtime and 79 * Get the coarse grained time at the softirq based on xtime and
140 * wall_to_monotonic. 80 * wall_to_monotonic.