aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-07-10 07:45:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 16:24:23 -0400
commit872aaa65a6ef30edef05a89977f7021f9840b215 (patch)
treed6402a26830dc2c5f48d6f9ec48069e3c0e784a7
parente64bd134085451fe3f751025c5d5a70729164b7c (diff)
[PATCH] uml: timer handler tidying
Get rid of a user of timer_irq_inited (and first_tick) by observing that prev_ticks can be used to decide if this is the first call. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/um/kernel/time_kern.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c
index 8e56c58320ba..552ca1cb9847 100644
--- a/arch/um/kernel/time_kern.c
+++ b/arch/um/kernel/time_kern.c
@@ -38,7 +38,6 @@ unsigned long long sched_clock(void)
38/* Changed at early boot */ 38/* Changed at early boot */
39int timer_irq_inited = 0; 39int timer_irq_inited = 0;
40 40
41static int first_tick;
42static unsigned long long prev_nsecs; 41static unsigned long long prev_nsecs;
43#ifdef CONFIG_UML_REAL_TIME_CLOCK 42#ifdef CONFIG_UML_REAL_TIME_CLOCK
44static long long delta; /* Deviation per interval */ 43static long long delta; /* Deviation per interval */
@@ -48,15 +47,8 @@ void timer_irq(union uml_pt_regs *regs)
48{ 47{
49 unsigned long long ticks = 0; 48 unsigned long long ticks = 0;
50 49
51 if(!timer_irq_inited){
52 /* This is to ensure that ticks don't pile up when
53 * the timer handler is suspended */
54 first_tick = 0;
55 return;
56 }
57
58 if(first_tick){
59#ifdef CONFIG_UML_REAL_TIME_CLOCK 50#ifdef CONFIG_UML_REAL_TIME_CLOCK
51 if(prev_nsecs){
60 /* We've had 1 tick */ 52 /* We've had 1 tick */
61 unsigned long long nsecs = os_nsecs(); 53 unsigned long long nsecs = os_nsecs();
62 54
@@ -69,15 +61,11 @@ void timer_irq(union uml_pt_regs *regs)
69 61
70 ticks += (delta * HZ) / BILLION; 62 ticks += (delta * HZ) / BILLION;
71 delta -= (ticks * BILLION) / HZ; 63 delta -= (ticks * BILLION) / HZ;
64 }
65 else prev_nsecs = os_nsecs();
72#else 66#else
73 ticks = 1; 67 ticks = 1;
74#endif 68#endif
75 }
76 else {
77 prev_nsecs = os_nsecs();
78 first_tick = 1;
79 }
80
81 while(ticks > 0){ 69 while(ticks > 0){
82 do_IRQ(TIMER_IRQ, regs); 70 do_IRQ(TIMER_IRQ, regs);
83 ticks--; 71 ticks--;