lkml.org 
[lkml]   [2013]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/29] x86, tsx: Add a minimal RTM tester at bootup
Date
From: Andi Kleen <ak@linux.intel.com>

May be removed later, but useful for basic sanity checking.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
arch/x86/kernel/Makefile | 2 ++
arch/x86/kernel/rtm-test.c | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
create mode 100644 arch/x86/kernel/rtm-test.c

diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 7bd3bd3..f46aebd 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -114,3 +114,5 @@ ifeq ($(CONFIG_X86_64),y)
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
obj-y += vsmp_64.o
endif
+
+obj-y += rtm-test.o
diff --git a/arch/x86/kernel/rtm-test.c b/arch/x86/kernel/rtm-test.c
new file mode 100644
index 0000000..5e138c1
--- /dev/null
+++ b/arch/x86/kernel/rtm-test.c
@@ -0,0 +1,22 @@
+#include <asm/rtm.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+int x;
+
+static __init int rtm_test(void)
+{
+ unsigned status;
+
+ pr_info("simple rtm test\n");
+ if ((status = _xbegin()) == _XBEGIN_STARTED) {
+ x++;
+ _xend();
+ pr_info("transaction committed\n");
+ } else {
+ pr_info("transaction aborted %x\n", status);
+ }
+ return 0;
+}
+
+device_initcall(rtm_test);
--
1.7.7.6


\
 
 \ /
  Last update: 2013-03-23 02:41    [W:0.238 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site