X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=test_rwlock_timing.c;h=2c456581bea256c0b7b6cd8e6356260e9bf0a990;hp=065c2d34038498b90152fa1d6377d4cf36006f38;hb=2dc5fa0f7cfbfb0a64a7a67b39626650e863f16a;hpb=20bf310ac72677961e55867dd64d058f77e0d7e6 diff --git a/test_rwlock_timing.c b/test_rwlock_timing.c index 065c2d3..2c45658 100644 --- a/test_rwlock_timing.c +++ b/test_rwlock_timing.c @@ -5,7 +5,19 @@ * * Copyright February 2009 - Mathieu Desnoyers * - * 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 @@ -19,6 +31,7 @@ #include #include #include +#include #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 {