Implementation of xchg primitives derived from MIT license
[urcu.git] / test_rwlock_timing.c
index 065c2d34038498b90152fa1d6377d4cf36006f38..2c456581bea256c0b7b6cd8e6356260e9bf0a990 100644 (file)
@@ -5,7 +5,19 @@
  *
  * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
  *
- * Distributed under GPLv2
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdio.h>
@@ -19,6 +31,7 @@
 #include <assert.h>
 #include <sys/syscall.h>
 #include <pthread.h>
+#include <arch.h>
 
 #if defined(_syscall0)
 _syscall0(pid_t, gettid)
@@ -35,22 +48,6 @@ static inline pid_t gettid(void)
 }
 #endif
 
-#define rdtscll(val) do { \
-     unsigned int __a,__d; \
-     asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
-     (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
-} while(0)
-
-typedef unsigned long long cycles_t;
-
-static inline cycles_t get_cycles (void)
-{
-        unsigned long long ret = 0;
-
-        rdtscll(ret);
-        return ret;
-}
-
 #include "urcu.h"
 
 struct test_array {
This page took 0.022663 seconds and 4 git commands to generate.