[PATCH 04/29] tsx: Add generic linux/elide.h macros

Andi Kleen
2013-03-23T01:25:50Z

For lock elision we (mostly) use generic elide() macros that
can be added to the lock code with minimal intrusion. Add a generic
version that does nothing and is used when RTM is not available.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
include/linux/elide.h | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
create mode 100644 include/linux/elide.h

diff --git a/include/linux/elide.h b/include/linux/elide.h
new file mode 100644
index 0000000..95b3ec2
--- /dev/null
+++ b/include/linux/elide.h
@@ -0,0 +1,18 @@
+#ifndef _LINUX_ELIDE_H
+#define _LINUX_ELIDE_H 1
+
+#include <linux/rtm.h>
+
+#ifdef CONFIG_RTM_LOCKS
+#include <asm/elide.h>
+#else
+#define elide_lock(l, f) 0
+#define elide_lock_adapt(f, l, a, ac) 0
+#define elide_unlock(l) 0
+#define elide_abort() do {} while (0)
+struct elision_config {};
+#define DEFAULT_ELISION_CONFIG {}
+#define TUNE_ELISION_CONFIG(a, b)
+#endif
+
+#endif
--
1.7.7.6