Skip to contentSkip to conversation

random.c precise timers on x86-64

PATCH In review Vojtech Pavlik 1 participant 1 message Sep 13, 2001 Random number driver

lore
Share & tools
lore
#0 lore raw

PATCH 10/11 random.c precise timers on x86-64

Hi!

This patch adds precise timing support on x86-64 into random.c.

drivers/char/random.c +4 -0
diff -urN linux-x86_64/drivers/char/random.c linux/drivers/char/random.c
@@ -717,6 +717,10 @@
 	} else {
 		time = jiffies;
 	}
+#elif defined (__x86_64__)
+	__u32 high;
+	rdtsc(time, high);
+	num ^= high;
 #else
 	time = jiffies;
 #endif
Signature · 2 lines
Vojtech Pavlik
SuSE Labs