lkml.org 
[lkml]   [2004]   [Apr]   [12]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
DateMon, 12 Apr 2004 07:57:30 +0000
FromThorsten Kranzkowski <>
SubjectRe: [PATCH][RFC] sort out CLOCK_TICK_RATE usage [2/3]
diff -ur linux-2.6.5-1/drivers/char/vt_ioctl.c linux-2.6.5-2/drivers/char/vt_ioctl.c
--- linux-2.6.5-1/drivers/char/vt_ioctl.c	Sat Apr 10 11:10:27 2004
+++ linux-2.6.5-2/drivers/char/vt_ioctl.c	Sun Apr 11 14:42:08 2004
@@ -26,6 +26,7 @@
 #include <linux/console.h>
 
 #include <asm/io.h>
+#include <asm/timex.h>
 #include <asm/uaccess.h>
 
 #include <linux/kbd_kern.h>
@@ -391,7 +392,7 @@
 		if (!perm)
 			return -EPERM;
 		if (arg)
-			arg = 1193182 / arg;
+			arg = PIC_TICK_RATE / arg;
 		kd_mksound(arg, 0);
 		return 0;
 
@@ -408,7 +409,7 @@
 		ticks = HZ * ((arg >> 16) & 0xffff) / 1000;
 		count = ticks ? (arg & 0xffff) : 0;
 		if (count)
-			count = 1193182 / count;
+			count = PIC_TICK_RATE / count;
 		kd_mksound(count, ticks);
 		return 0;
 	}
diff -ur linux-2.6.5-1/drivers/input/misc/98spkr.c linux-2.6.5-2/drivers/input/misc/98spkr.c
--- linux-2.6.5-1/drivers/input/misc/98spkr.c	Thu Dec 18 02:58:17 2003
+++ linux-2.6.5-2/drivers/input/misc/98spkr.c	Sun Apr 11 14:42:59 2004
@@ -44,7 +44,7 @@
 	} 
 
 	if (value > 20 && value < 32767)
-		count = CLOCK_TICK_RATE / value;
+		count = PIC_TICK_RATE / value;
 	
 	spin_lock_irqsave(&i8253_beep_lock, flags);
 
diff -ur linux-2.6.5-1/drivers/input/misc/m68kspkr.c linux-2.6.5-2/drivers/input/misc/m68kspkr.c
--- linux-2.6.5-1/drivers/input/misc/m68kspkr.c	Thu Dec 18 02:58:15 2003
+++ linux-2.6.5-2/drivers/input/misc/m68kspkr.c	Sun Apr 11 14:43:34 2004
@@ -42,7 +42,7 @@
 	}
 
 	if (value > 20 && value < 32767)
-		count = 1193182 / value;
+		count = PIC_TICK_RATE / value;
 
 	mach_beep(count, -1);
 
diff -ur linux-2.6.5-1/drivers/input/misc/pcspkr.c linux-2.6.5-2/drivers/input/misc/pcspkr.c
--- linux-2.6.5-1/drivers/input/misc/pcspkr.c	Thu Dec 18 02:58:57 2003
+++ linux-2.6.5-2/drivers/input/misc/pcspkr.c	Sun Apr 11 14:43:56 2004
@@ -43,7 +43,7 @@
 	} 
 
 	if (value > 20 && value < 32767)
-		count = CLOCK_TICK_RATE / value;
+		count = PIC_TICK_RATE / value;
 	
 	spin_lock_irqsave(&i8253_beep_lock, flags);
 
diff -ur linux-2.6.5-2/arch/x86_64/kernel/time.c linux-2.6.5-3/arch/x86_64/kernel/time.c
--- linux-2.6.5-2/arch/x86_64/kernel/time.c	Sat Apr 10 11:10:26 2004
+++ linux-2.6.5-3/arch/x86_64/kernel/time.c	Sun Apr 11 15:26:49 2004
@@ -54,7 +54,7 @@
 unsigned int cpu_khz;					/* TSC clocks / usec, not used here */
 unsigned long hpet_period;				/* fsecs / HPET clock */
 unsigned long hpet_tick;				/* HPET clocks / interrupt */
-unsigned long vxtime_hz = 1193182;
+unsigned long vxtime_hz = PIC_TICK_RATE;
 int report_lost_ticks;				/* command line option */
 unsigned long long monotonic_base;
 
@@ -600,8 +600,8 @@
 	outb((inb(0x61) & ~0x02) | 0x01, 0x61);
 
 	outb(0xb0, 0x43);
-	outb((1193182 / (1000 / 50)) & 0xff, 0x42);
-	outb((1193182 / (1000 / 50)) >> 8, 0x42);
+	outb((PIC_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
+	outb((PIC_TICK_RATE / (1000 / 50)) >> 8, 0x42);
 	rdtscll(start);
 	sync_core();
 	while ((inb(0x61) & 0x20) == 0);
diff -ur linux-2.6.5-2/drivers/input/gameport/gameport.c linux-2.6.5-3/drivers/input/gameport/gameport.c
--- linux-2.6.5-2/drivers/input/gameport/gameport.c	Thu Dec 18 02:58:49 2003
+++ linux-2.6.5-3/drivers/input/gameport/gameport.c	Sun Apr 11 15:23:35 2004
@@ -37,7 +37,7 @@
 
 #ifdef __i386__
 
-#define DELTA(x,y)      ((y)-(x)+((y)<(x)?1193182/HZ:0))
+#define DELTA(x,y)      ((y)-(x)+((y)<(x)?PIC_TICK_RATE/HZ:0))
 #define GET_TIME(x)     do { x = get_time_pit(); } while (0)
 
 static unsigned int get_time_pit(void)
-- 
| Thorsten Kranzkowski        Internet: dl8bcu@dl8bcu.de                      |
| Mobile: ++49 170 1876134       Snail: Kiebitzstr. 14, 49324 Melle, Germany  |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:02    [from the cache]
©2003-2008