From 806ad22a8a241a7e9acd4eb3732eb1b705845c6f Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 8 Sep 2010 08:36:02 +0000 Subject: [PATCH] - remove bug - the function timer_set_frequency ignored its parameter git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@150 315a16e6-25f9-4109-90ae-ca3045a26c18 --- arch/x86/kernel/timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/timer.c b/arch/x86/kernel/timer.c index ff6679f5..81abf83c 100644 --- a/arch/x86/kernel/timer.c +++ b/arch/x86/kernel/timer.c @@ -76,7 +76,7 @@ int timer_init(void) return 0; } -#define LATCH ((CLOCK_TICK_RATE + TIMER_FREQ/2) / TIMER_FREQ) +#define LATCH(f) ((CLOCK_TICK_RATE + f/2) / f) int timer_set_frequency(unsigned int freq) { @@ -85,9 +85,9 @@ int timer_set_frequency(unsigned int freq) /* set the timer frequency */ outportb(0x43, 0x34); udelay(10); - outportb(0x40, LATCH & 0xFF); /* low byte */ + outportb(0x40, LATCH(freq) & 0xFF); /* low byte */ udelay(10); - outportb(0x40, LATCH >> 8); /* high byte */ + outportb(0x40, LATCH(freq) >> 8); /* high byte */ curr_timer_freq = freq;