hash table test: don't redefine CACHE_LINE_SIZE
[urcu.git] / tests / test_urcu_hash.h
index 4af34f7a3499cb9fdec2d9681f33edfde35d93fa..cd064e62b76e6821c311fa9e9588330d134f503f 100644 (file)
 #include <unistd.h>
 #include <stdio.h>
 #include <assert.h>
-#include <sched.h>
 #include <errno.h>
 #include <signal.h>
 
 #include <urcu/tls-compat.h>
-
-#ifdef __linux__
-#include <syscall.h>
-#endif
+#include "cpuset.h"
+#include "thread-id.h"
 
 #define DEFAULT_HASH_SIZE      32
 #define DEFAULT_MIN_ALLOC_SIZE 1
@@ -55,9 +52,6 @@
  */
 #define TEST_HASH_SEED 0x42UL
 
-/* 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
 
 #define poison_free(ptr)       free(ptr)
 #endif
 
-
-
-#if defined(_syscall0)
-_syscall0(pid_t, gettid)
-#elif defined(__NR_gettid)
-static inline pid_t gettid(void)
-{
-       return syscall(__NR_gettid);
-}
-#else
-#warning "use pid as tid"
-static inline pid_t gettid(void)
-{
-       return getpid();
-}
-#endif
-
 #ifndef DYNAMIC_LINK_TEST
 #define _LGPL_SOURCE
 #else
@@ -195,12 +172,6 @@ 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);
 
 /*
This page took 0.022528 seconds and 4 git commands to generate.