diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/kernel/time_kern.c | 20 |
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 */ |
39 | int timer_irq_inited = 0; | 39 | int timer_irq_inited = 0; |
40 | 40 | ||
41 | static int first_tick; | ||
42 | static unsigned long long prev_nsecs; | 41 | static unsigned long long prev_nsecs; |
43 | #ifdef CONFIG_UML_REAL_TIME_CLOCK | 42 | #ifdef CONFIG_UML_REAL_TIME_CLOCK |
44 | static long long delta; /* Deviation per interval */ | 43 | static 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--; |