aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-12-16 17:43:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-16 17:43:57 -0500
commit48ea753075aa15699bd5fac26faa08431aaa697b (patch)
tree4ce1b1890dc687cb1cf77f98e7a95b94c7ef3a93 /arch/ia64/kernel/time.c
parent7c3dbbe982ac85837f1da150ea9539a9e9a12557 (diff)
parentdc86e88c2bb8a7603ee175fbb6a9e92cf3293dd8 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Diffstat (limited to 'arch/ia64/kernel/time.c')
-rw-r--r--arch/ia64/kernel/time.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 5b7e736f3b49..028a2b95936c 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -249,3 +249,32 @@ time_init (void)
249 */ 249 */
250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); 250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
251} 251}
252
253#define SMALLUSECS 100
254
255void
256udelay (unsigned long usecs)
257{
258 unsigned long start;
259 unsigned long cycles;
260 unsigned long smallusecs;
261
262 /*
263 * Execute the non-preemptible delay loop (because the ITC might
264 * not be synchronized between CPUS) in relatively short time
265 * chunks, allowing preemption between the chunks.
266 */
267 while (usecs > 0) {
268 smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs;
269 preempt_disable();
270 cycles = smallusecs*local_cpu_data->cyc_per_usec;
271 start = ia64_get_itc();
272
273 while (ia64_get_itc() - start < cycles)
274 cpu_relax();
275
276 preempt_enable();
277 usecs -= smallusecs;
278 }
279}
280EXPORT_SYMBOL(udelay);