Merge remote branch 'origin/urcu/ht' into urcu/ht
[urcu.git] / tests / test_urcu_gc.c
index 9897dcaf387c6504b12a65f0ce4c954020dea388..4eaa61b777d0dd6460b4f0ae196bb5ca0d833c28 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Userspace RCU library - test program (with baatch reclamation)
  *
- * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright February 2009 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * 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
 #include <unistd.h>
 #include <stdio.h>
 #include <assert.h>
-#include <sys/syscall.h>
 #include <sched.h>
 #include <errno.h>
 
 #include <urcu/arch.h>
 
+#ifdef __linux__
+#include <syscall.h>
+#endif
+
 /* hardcoded number of CPUs */
 #define NR_CPUS 16384
 
@@ -92,7 +95,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
        while(l-- != 0)
-               cpu_relax();
+               caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -164,7 +167,7 @@ static unsigned long long __thread nr_writes;
 static unsigned long long __thread nr_reads;
 
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 
 static unsigned int nr_readers;
 static unsigned int nr_writers;
@@ -207,7 +210,7 @@ void *thr_reader(void *_count)
        while (!test_go)
        {
        }
-       smp_mb();
+       cmm_smp_mb();
 
        for (;;) {
                rcu_read_lock();
@@ -280,7 +283,7 @@ void *thr_writer(void *data)
        while (!test_go)
        {
        }
-       smp_mb();
+       cmm_smp_mb();
 
        for (;;) {
 #ifndef TEST_LOCAL_GC
@@ -419,9 +422,9 @@ int main(int argc, char **argv)
        tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers);
        pending_reclaims = malloc(sizeof(*pending_reclaims) * nr_writers);
        if (reclaim_batch * sizeof(*pending_reclaims[i].queue)
-                       < CACHE_LINE_SIZE)
+                       < CAA_CACHE_LINE_SIZE)
                for (i = 0; i < nr_writers; i++)
-                       pending_reclaims[i].queue = calloc(1, CACHE_LINE_SIZE);
+                       pending_reclaims[i].queue = calloc(1, CAA_CACHE_LINE_SIZE);
        else
                for (i = 0; i < nr_writers; i++)
                        pending_reclaims[i].queue = calloc(reclaim_batch,
@@ -444,7 +447,7 @@ int main(int argc, char **argv)
                        exit(1);
        }
 
-       smp_mb();
+       cmm_smp_mb();
 
        test_go = 1;
 
This page took 0.023333 seconds and 4 git commands to generate.