Skip to contentSkip to conversation

tsc-cleanup_A0

PATCH New john stultz 1 participant 1 message Jun 21, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tsc-cleanup_A0

Marcelo
Poking around w/ the tsc-disable patch, I figured I should send out
this trivial cleanup as well. I got these changes from a post Brian Gerst originally released for 2.5.

thanks
-john

drivers/char/joystick/analog.c +3 -4
diff -Nru a/drivers/char/joystick/analog.c b/drivers/char/joystick/analog.c
@@ -137,10 +137,9 @@
  */
 
 #ifdef __i386__
-#define TSC_PRESENT	(test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability))
-#define GET_TIME(x)	do { if (TSC_PRESENT) rdtscl(x); else { outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } } while (0)
-#define DELTA(x,y)	(TSC_PRESENT?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
-#define TIME_NAME	(TSC_PRESENT?"TSC":"PIT")
+#define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else { outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } } while (0)
+#define DELTA(x,y)	(cpu_has_tsc?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
+#define TIME_NAME	(cpu_has_tsc?"TSC":"PIT")
 #elif __x86_64__
 #define GET_TIME(x)	rdtscl(x)
 #define DELTA(x,y)	((y)-(x))
drivers/char/random.c +1 -1
diff -Nru a/drivers/char/random.c b/drivers/char/random.c
@@ -735,7 +735,7 @@
 	int		entropy = 0;
 
 #if defined (__i386__)
-	if ( test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability) ) {
+	if (cpu_has_tsc) {
 		__u32 high;
 		rdtsc(time, high);
 		num ^= high;