diff options
author | Roland Grunberg <rgrunber@redhat.com> | 2009-11-06 14:09:06 -0500 |
---|---|---|
committer | Roland Grunberg <rgrunber@redhat.com> | 2009-11-06 14:09:06 -0500 |
commit | 079915a57182ed3e5981190ccf8216c674aa4406 (patch) | |
tree | 50f5da998baded364e7908236a6ce9a18106ddaf /runtime/runtime.h | |
parent | 4be13c03169ded00a0a6b0e7e7ce8d008aaa51d0 (diff) | |
download | systemtap-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/runtime.h')
-rw-r--r-- | runtime/runtime.h | 11 |
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_ */ |