-From 583b5fc6daca87fb004d36a296e318332c23cb47 Mon Sep 17 00:00:00 2001
+From 9505e275ee2962e6fe04147a356a087bdd294544 Mon Sep 17 00:00:00 2001
 From: Julien Ridoux <julien@synclab.org>
-Date: Tue, 19 Jan 2010 17:35:52 +1100
+Date: Wed, 20 Jan 2010 12:01:19 +1100
 Subject: [PATCH RADclock 9/9] VDSO get_vcounter
 
 Support for VDSO get_vcounter() for accessing the raw cumulative

+	if (likely(gtod->sysctl_enabled && gtod->clock.vread)) {
+
+		/* One for fun and warmup */
+		rdtscll(tsc1);
+		__asm __volatile("lfence" ::: "memory");
+		rdtscll(tsc1);
+		__asm __volatile("lfence" ::: "memory");
+		rdtscll(tsc2);
+		__asm __volatile("lfence" ::: "memory");
+		vcount = read_vcounter();
+		__asm __volatile("lfence" ::: "memory");
+		rdtscll(tsc3);
+		__asm __volatile("lfence" ::: "memory");
+
+		*vcounter = vcount;

+
+notrace int __vdso_get_vcounter_latency(vcounter_t *vcounter, cycle_t *vcount_lat, cycle_t *tsc_lat)
+{
+/* XEN paravirtualization does not seem to like the rdtscll call, and redefines
+ * it in parvirt.h. It is a bit dodgy but allow compilation ... and not used so
+ * far, it is more a record what should be done.
+ */
+#ifdef CONFIG_PARAVIRT
+#define real_rdtscll(val) (val = __native_read_tsc())
+#else
+#define real_rdtscll(val) rdtscll(val)
+#endif
+	vcounter_t vcount;
+	cycle_t tsc1, tsc2, tsc3;
+
