aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/i8259.c8
-rw-r--r--include/linux/timer.h9
-rw-r--r--kernel/timer.c8
3 files changed, 15 insertions, 10 deletions
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index b2a238b5a17e..c6c9791d77c1 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -494,7 +494,7 @@ void invalidate_interrupt7(void);
494void thermal_interrupt(void); 494void thermal_interrupt(void);
495void i8254_timer_resume(void); 495void i8254_timer_resume(void);
496 496
497static void setup_timer(void) 497static void setup_timer_hardware(void)
498{ 498{
499 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */ 499 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
500 udelay(10); 500 udelay(10);
@@ -505,13 +505,13 @@ static void setup_timer(void)
505 505
506static int timer_resume(struct sys_device *dev) 506static int timer_resume(struct sys_device *dev)
507{ 507{
508 setup_timer(); 508 setup_timer_hardware();
509 return 0; 509 return 0;
510} 510}
511 511
512void i8254_timer_resume(void) 512void i8254_timer_resume(void)
513{ 513{
514 setup_timer(); 514 setup_timer_hardware();
515} 515}
516 516
517static struct sysdev_class timer_sysclass = { 517static struct sysdev_class timer_sysclass = {
@@ -594,7 +594,7 @@ void __init init_IRQ(void)
594 * Set the clock to HZ Hz, we already have a valid 594 * Set the clock to HZ Hz, we already have a valid
595 * vector now: 595 * vector now:
596 */ 596 */
597 setup_timer(); 597 setup_timer_hardware();
598 598
599 if (!acpi_ioapic) 599 if (!acpi_ioapic)
600 setup_irq(2, &irq2); 600 setup_irq(2, &irq2);
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 3340f3bd135d..ddd5bbe1fc8e 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -38,6 +38,15 @@ extern struct timer_base_s __init_timer_base;
38 38
39void fastcall init_timer(struct timer_list * timer); 39void fastcall init_timer(struct timer_list * timer);
40 40
41static inline void setup_timer(struct timer_list * timer,
42 void (*function)(unsigned long),
43 unsigned long data)
44{
45 timer->function = function;
46 timer->data = data;
47 init_timer(timer);
48}
49
41/*** 50/***
42 * timer_pending - is a timer pending? 51 * timer_pending - is a timer pending?
43 * @timer: the timer in question 52 * @timer: the timer in question
diff --git a/kernel/timer.c b/kernel/timer.c
index 6a2e5f8dc725..6ed1a826e5ce 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1146,12 +1146,8 @@ fastcall signed long __sched schedule_timeout(signed long timeout)
1146 1146
1147 expire = timeout + jiffies; 1147 expire = timeout + jiffies;
1148 1148
1149 init_timer(&timer); 1149 setup_timer(&timer, process_timeout, (unsigned long)current);
1150 timer.expires = expire; 1150 __mod_timer(&timer, expire);
1151 timer.data = (unsigned long) current;
1152 timer.function = process_timeout;
1153
1154 add_timer(&timer);
1155 schedule(); 1151 schedule();
1156 del_singleshot_timer_sync(&timer); 1152 del_singleshot_timer_sync(&timer);
1157 1153