summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/runtime.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/runtime.h b/runtime/runtime.h
index a95627ae..ba583aeb 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -179,6 +179,17 @@ void cleanup_module(void)
_stp_transport_close();
}
+#define pseudo_atomic_cmpxchg(v, old, new) ({\
+ int ret;\
+ unsigned long flags;\
+ local_irq_save(flags);\
+ ret = atomic_read(v);\
+ if (likely(ret == old))\
+ atomic_set(v, new);\
+ local_irq_restore(flags);\
+ ret; })
+
+
MODULE_LICENSE("GPL");
#endif /* _RUNTIME_H_ */