*
* Userspace RCU library - test program
*
- * 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
static inline void loop_sleep(unsigned long l)
{
while(l-- != 0)
- cpu_relax();
+ caa_cpu_relax();
}
static int verbose_mode;
while (!test_go)
{
}
- smp_mb();
+ cmm_smp_mb();
for (;;) {
pthread_rwlock_wrlock(&lock);
show_usage(argc, argv);
return -1;
}
- smp_mb();
+ cmm_smp_mb();
err = sscanf(argv[1], "%u", &nr_readers);
if (err != 1) {
exit(1);
}
- smp_mb();
+ cmm_smp_mb();
test_go = 1;
printf_verbose("total number of reads : %llu, writes %llu\n", tot_reads,
tot_writes);
- printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu "
+ printf("SUMMARY %-25s testdur %4lu nr_readers %3u rdur %6lu wdur %6lu "
"nr_writers %3u "
"wdelay %6lu nr_reads %12llu nr_writes %12llu nr_ops %12llu\n",
- argv[0], duration, nr_readers, rduration,
+ argv[0], duration, nr_readers, rduration, wduration,
nr_writers, wdelay, tot_reads, tot_writes,
tot_reads + tot_writes);