patch-2.4.10 linux/drivers/char/ftape/lowlevel/ftape-calibr.c

Next file: linux/drivers/char/ftape/lowlevel/ftape-init.c
Previous file: linux/drivers/char/ftape/compressor/zftape-compress.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/char/ftape/lowlevel/ftape-calibr.c linux/drivers/char/ftape/lowlevel/ftape-calibr.c
@@ -31,7 +31,7 @@
 #include <asm/io.h>
 #if defined(__alpha__)
 # include <asm/hwrpb.h>
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 # include <linux/timex.h>
 #endif
 #include <linux/ftape.h>
@@ -41,7 +41,7 @@
 
 #undef DEBUG
 
-#if !defined(__alpha__) && !defined(__i386__)
+#if !defined(__alpha__) && !defined(__i386__) && !defined(__x86_64__)
 # error Ftape is not implemented for this architecture!
 #endif
 
@@ -70,7 +70,7 @@
 
 	asm volatile ("rpcc %0" : "=r" (r));
 	return r;
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	unsigned long flags;
 	__u16 lo;
 	__u16 hi;
@@ -90,7 +90,7 @@
 {
 #if defined(__alpha__)
 	return ftape_timestamp();
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	unsigned int count;
  	unsigned long flags;
  
@@ -108,7 +108,7 @@
 {
 #if defined(__alpha__)
 	return (t1 <= t0) ? t1 + (1UL << 32) - t0 : t1 - t0;
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	/*
 	 * This is tricky: to work for both short and full ftape_timestamps
 	 * we'll have to discriminate between these.
@@ -124,7 +124,7 @@
 {
 #if defined(__alpha__)
 	return (ps_per_cycle * count) / 1000000UL;
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 	return (10000 * count) / ((CLOCK_TICK_RATE + 50) / 100);
 #endif
 }
@@ -164,7 +164,7 @@
 
 static void init_clock(void)
 {
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
 	unsigned int t;
 	int i;
 	TRACE_FUN(ft_t_any);
@@ -214,7 +214,7 @@
 	unsigned int tc = 0;
 	unsigned int count;
 	unsigned int time;
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
 	unsigned int old_tc = 0;
 	unsigned int old_count = 1;
 	unsigned int old_time = 1;
@@ -265,7 +265,7 @@
 		if (time >= 100*1000) {
 			break;
 		}
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
 		/*
 		 * increase the count until the resulting time nears 2/HZ,
 		 * then the tc will drop sharply because we lose LATCH counts.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)