hello: hello.c
#dynamic version
- gcc -g -I../libmarkers -I../share -I../libtracing -L../libmarkers -lmarkers -L../libtracectl -ltracectl -L../libtracing -ltracing -o hello hello.c marker-control.c serialize.c
+ gcc -g -I../libmarkers -I../share -I../libtracing -L../libmarkers -lmarkers -L../libtracectl -ltracectl -L../libtracing -ltracing -I../../../../urcu -Wl,-rpath ../../../../urcu -o hello hello.c marker-control.c serialize.c
# -Wl,--print-map
-#static version
-# gcc -g -I../libmarkers -I../share -I../libtracing -L../libmarkers -o hello hello.c marker-control.c serialize.c ../libtracing/*.c ../libmarkers/*.c ../libtracectl/*.c ../share/*.c
clean:
rm -rf hello *.o
all: libmarkers.so
libmarkers.so: marker.c *.c *.h
- gcc -g -fPIC -I../share -I../libtracing -I. -shared -o libmarkers.so marker.c ../share/kref.c ../libtracing/channels.c
+ gcc -g -fPIC -I../share -I../libtracing -I. -shared -o libmarkers.so -L../../../../urcu -I../../../../urcu $(CFLAGS) -lurcu marker.c ../share/kref.c ../libtracing/channels.c
.PHONY: libmarkers.so all
/* MEMORY BARRIERS */
-#define smp_rmb() do {} while(0)
-#define smp_wmb() do {} while(0)
-#define smp_mb() do {} while(0)
+//#define smp_rmb() do {} while(0)
+//#define smp_wmb() do {} while(0)
+//#define smp_mb() do {} while(0)
#define smp_mb__after_atomic_inc() do {} while(0)
#define read_barrier_depends() do {} while(0)
-#define smp_read_barrier_depends() do {} while(0)
+//#define smp_read_barrier_depends() do {} while(0)
/* RCU */
-#define rcu_assign_pointer(a, b) do {} while(0)
-#define call_rcu_sched(a,b) do {} while(0)
-#define rcu_barrier_sched() do {} while(0)
-#define rcu_read_lock_sched_notrace() do{} while (0)
-#define rcu_read_unlock_sched_notrace() do{} while (0)
+#include "urcu.h"
+#define call_rcu_sched(a,b) b(a); synchronize_rcu()
+#define rcu_barrier_sched() do {} while(0) /* this nop is ok if call_rcu_sched does a synchronize_rcu() */
+#define rcu_read_lock_sched_notrace() rcu_read_lock()
+#define rcu_read_unlock_sched_notrace() rcu_read_unlock()
/* ATOMICITY */
#include "asm.h"
-#define __xg(x) ((volatile long *)(x))
+//#define __xg(x) ((volatile long *)(x))
#define cmpxchg(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \