aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2007-02-16 04:27:49 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-16 11:13:58 -0500
commitc9cb2e3d7c9178ab75d0942f96abb3abe0369906 (patch)
tree2d4a5470ece5efe82463653678c491c2f249d560 /kernel/hrtimer.c
parentfd064b9b7770d5c7705bf9542950c7bd81c30f98 (diff)
[PATCH] hrtimers: namespace and enum cleanup
- hrtimers did not use the hrtimer_restart enum and relied on the implict int representation. Fix the prototypes and the functions using the enums. - Use seperate name spaces for the enumerations - Convert hrtimer_restart macro to inline function - Add comments No functional changes. [akpm@osdl.org: fix input driver] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: john stultz <johnstul@us.ibm.com> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index bd57ef403049..83fc50416b1d 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -444,7 +444,7 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
444 /* Switch the timer base, if necessary: */ 444 /* Switch the timer base, if necessary: */
445 new_base = switch_hrtimer_base(timer, base); 445 new_base = switch_hrtimer_base(timer, base);
446 446
447 if (mode == HRTIMER_REL) { 447 if (mode == HRTIMER_MODE_REL) {
448 tim = ktime_add(tim, new_base->get_time()); 448 tim = ktime_add(tim, new_base->get_time());
449 /* 449 /*
450 * CONFIG_TIME_LOW_RES is a temporary way for architectures 450 * CONFIG_TIME_LOW_RES is a temporary way for architectures
@@ -583,7 +583,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
583 583
584 bases = __raw_get_cpu_var(hrtimer_bases); 584 bases = __raw_get_cpu_var(hrtimer_bases);
585 585
586 if (clock_id == CLOCK_REALTIME && mode != HRTIMER_ABS) 586 if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS)
587 clock_id = CLOCK_MONOTONIC; 587 clock_id = CLOCK_MONOTONIC;
588 588
589 timer->base = &bases[clock_id]; 589 timer->base = &bases[clock_id];
@@ -627,7 +627,7 @@ static inline void run_hrtimer_queue(struct hrtimer_base *base)
627 627
628 while ((node = base->first)) { 628 while ((node = base->first)) {
629 struct hrtimer *timer; 629 struct hrtimer *timer;
630 int (*fn)(struct hrtimer *); 630 enum hrtimer_restart (*fn)(struct hrtimer *);
631 int restart; 631 int restart;
632 632
633 timer = rb_entry(node, struct hrtimer, node); 633 timer = rb_entry(node, struct hrtimer, node);
@@ -669,7 +669,7 @@ void hrtimer_run_queues(void)
669/* 669/*
670 * Sleep related functions: 670 * Sleep related functions:
671 */ 671 */
672static int hrtimer_wakeup(struct hrtimer *timer) 672static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
673{ 673{
674 struct hrtimer_sleeper *t = 674 struct hrtimer_sleeper *t =
675 container_of(timer, struct hrtimer_sleeper, timer); 675 container_of(timer, struct hrtimer_sleeper, timer);
@@ -699,7 +699,7 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod
699 schedule(); 699 schedule();
700 700
701 hrtimer_cancel(&t->timer); 701 hrtimer_cancel(&t->timer);
702 mode = HRTIMER_ABS; 702 mode = HRTIMER_MODE_ABS;
703 703
704 } while (t->task && !signal_pending(current)); 704 } while (t->task && !signal_pending(current));
705 705
@@ -715,10 +715,10 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
715 715
716 restart->fn = do_no_restart_syscall; 716 restart->fn = do_no_restart_syscall;
717 717
718 hrtimer_init(&t.timer, restart->arg0, HRTIMER_ABS); 718 hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS);
719 t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2; 719 t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2;
720 720
721 if (do_nanosleep(&t, HRTIMER_ABS)) 721 if (do_nanosleep(&t, HRTIMER_MODE_ABS))
722 return 0; 722 return 0;
723 723
724 rmtp = (struct timespec __user *) restart->arg1; 724 rmtp = (struct timespec __user *) restart->arg1;
@@ -751,7 +751,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
751 return 0; 751 return 0;
752 752
753 /* Absolute timers do not update the rmtp value and restart: */ 753 /* Absolute timers do not update the rmtp value and restart: */
754 if (mode == HRTIMER_ABS) 754 if (mode == HRTIMER_MODE_ABS)
755 return -ERESTARTNOHAND; 755 return -ERESTARTNOHAND;
756 756
757 if (rmtp) { 757 if (rmtp) {
@@ -784,7 +784,7 @@ sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
784 if (!timespec_valid(&tu)) 784 if (!timespec_valid(&tu))
785 return -EINVAL; 785 return -EINVAL;
786 786
787 return hrtimer_nanosleep(&tu, rmtp, HRTIMER_REL, CLOCK_MONOTONIC); 787 return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
788} 788}
789 789
790/* 790/*