From 8d016ef1380a2a9a5ca5742ede04334199868f82 Mon Sep 17 00:00:00 2001 From: john stultz Date: Mon, 26 Jun 2006 00:25:09 -0700 Subject: [PATCH] Time: i386 Conversion - part 1: Move timer_pit.c to i8253.c A simple cleanup for the i386 arch in preparation of moving to the generic timeofday infrastructure. It simply moves the PIT initialization code, locks, and other code we want to keep from some code from timer_pit.c (which will be removed) to i8253.c. Signed-off-by: John Stultz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/i386/kernel/i8253.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 arch/i386/kernel/i8253.c (limited to 'arch/i386/kernel/i8253.c') diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c new file mode 100644 index 000000000000..29cb2eb34363 --- /dev/null +++ b/arch/i386/kernel/i8253.c @@ -0,0 +1,32 @@ +/* + * i8253.c 8253/PIT functions + * + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "io_ports.h" + +DEFINE_SPINLOCK(i8253_lock); +EXPORT_SYMBOL(i8253_lock); + +void setup_pit_timer(void) +{ + unsigned long flags; + + spin_lock_irqsave(&i8253_lock, flags); + outb_p(0x34,PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */ + udelay(10); + outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ + udelay(10); + outb(LATCH >> 8 , PIT_CH0); /* MSB */ + spin_unlock_irqrestore(&i8253_lock, flags); +} -- cgit v1.2.3