From 079915a57182ed3e5981190ccf8216c674aa4406 Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Fri, 6 Nov 2009 14:09:06 -0500 Subject: PR10849: Support MAXSKIPPED handling on RHEL4 through implementation of atomic_cmpxchg --- runtime/runtime.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runtime/runtime.h') 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_ */ -- cgit