summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRoland Grunberg <rgrunber@redhat.com>2009-11-06 14:09:06 -0500
committerRoland Grunberg <rgrunber@redhat.com>2009-11-06 14:09:06 -0500
commit079915a57182ed3e5981190ccf8216c674aa4406 (patch)
tree50f5da998baded364e7908236a6ce9a18106ddaf /runtime
parent4be13c03169ded00a0a6b0e7e7ce8d008aaa51d0 (diff)
downloadsystemtap-steved-079915a57182ed3e5981190ccf8216c674aa4406.tar.gz
systemtap-steved-079915a57182ed3e5981190ccf8216c674aa4406.tar.xz
systemtap-steved-079915a57182ed3e5981190ccf8216c674aa4406.zip
PR10849: Support MAXSKIPPED handling on RHEL4 through implementation of atomic_cmpxchg
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_ */