X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_urcu_ja_range.h;fp=tests%2Ftest_urcu_ja_range.h;h=0000000000000000000000000000000000000000;hb=169e1020838cc5b9f3df503d160ce1bf0c939b2f;hp=1f8c2a2f046d48a5aea3ece45cec14412e53f2f0;hpb=5bcf8326b6e13ca93429925bc38fb81c73155c54;p=urcu.git diff --git a/tests/test_urcu_ja_range.h b/tests/test_urcu_ja_range.h deleted file mode 100644 index 1f8c2a2..0000000 --- a/tests/test_urcu_ja_range.h +++ /dev/null @@ -1,157 +0,0 @@ -#ifndef _TEST_URCU_JA_RANGE_H -#define _TEST_URCU_JA_RANGE_H - -/* - * test_urcu_ja.h - * - * Userspace RCU library - test program - * - * Copyright 2009-2012 - Mathieu Desnoyers - * - * 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 "../config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "thread-id.h" - -#define DEFAULT_RAND_POOL 1000000 - -/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ -#define CACHE_LINE_SIZE 4096 - -/* hardcoded number of CPUs */ -#define NR_CPUS 16384 - -#ifdef POISON_FREE -#define poison_free(ptr) \ - do { \ - memset(ptr, 0x42, sizeof(*(ptr))); \ - free(ptr); \ - } while (0) -#else -#define poison_free(ptr) free(ptr) -#endif - -#ifndef DYNAMIC_LINK_TEST -#define _LGPL_SOURCE -#else -#define debug_yield_read() -#endif -#include -#include -#include - -struct wr_count { - unsigned long update_ops; - unsigned long add; - unsigned long add_exist; - unsigned long remove; -}; - -extern DECLARE_URCU_TLS(unsigned int, rand_lookup); -extern DECLARE_URCU_TLS(unsigned long, nr_add); -extern DECLARE_URCU_TLS(unsigned long, nr_addexist); -extern DECLARE_URCU_TLS(unsigned long, nr_del); -extern DECLARE_URCU_TLS(unsigned long, nr_delnoent); -extern DECLARE_URCU_TLS(unsigned long, lookup_fail); -extern DECLARE_URCU_TLS(unsigned long, lookup_ok); - -extern struct cds_ja *test_ja; - -extern volatile int test_go, test_stop; - -extern unsigned long wdelay; - -extern unsigned long duration; - -/* read-side C.S. duration, in loops */ -extern unsigned long rduration; - -extern unsigned long init_populate; -extern int add_only; - -extern unsigned long init_pool_offset, lookup_pool_offset, write_pool_offset; -extern unsigned long init_pool_size, - lookup_pool_size, - write_pool_size; -extern int validate_lookup; - -extern int count_pipe[2]; - -static inline void loop_sleep(unsigned long l) -{ - while(l-- != 0) - caa_cpu_relax(); -} - -extern int verbose_mode; - -#define printf_verbose(fmt, args...) \ - do { \ - if (verbose_mode) \ - printf(fmt, ## args); \ - } while (0) - -extern unsigned int cpu_affinities[NR_CPUS]; -extern unsigned int next_aff; -extern int use_affinity; - -extern pthread_mutex_t affinity_mutex; - -#ifndef HAVE_CPU_SET_T -typedef unsigned long cpu_set_t; -# define CPU_ZERO(cpuset) do { *(cpuset) = 0; } while(0) -# define CPU_SET(cpu, cpuset) do { *(cpuset) |= (1UL << (cpu)); } while(0) -#endif - -void set_affinity(void); - -/* - * returns 0 if test should end. - */ -static inline int test_duration_write(void) -{ - return !test_stop; -} - -static inline int test_duration_read(void) -{ - return !test_stop; -} - -extern DECLARE_URCU_TLS(unsigned long long, nr_writes); -extern DECLARE_URCU_TLS(unsigned long long, nr_reads); - -extern unsigned int nr_readers; -extern unsigned int nr_writers; - -void rcu_copy_mutex_lock(void); -void rcu_copy_mutex_unlock(void); - -#endif /* _TEST_URCU_JA_RANGE_H */