]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Splitlock splitlock
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 11 Dec 2019 17:23:47 +0000 (17:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 15 Feb 2024 16:05:54 +0000 (16:05 +0000)
docs/all-tests.dox
tests/splitlock/Makefile [new file with mode: 0644]
tests/splitlock/main.c [new file with mode: 0644]

index 892a9e4747438e78610334068bac88fdd365236d..ff88aee7997678dd821c386ec3c65dc0672b6886 100644 (file)
@@ -176,6 +176,8 @@ states.
 
 @subpage test-msr - Print MSR information.
 
+@subpage test-splitlock - Splitlock generator.
+
 @subpage test-rtm-check - Probe for the RTM behaviour.
 
 
diff --git a/tests/splitlock/Makefile b/tests/splitlock/Makefile
new file mode 100644 (file)
index 0000000..e486f48
--- /dev/null
@@ -0,0 +1,9 @@
+include $(ROOT)/build/common.mk
+
+NAME      := splitlock
+CATEGORY  := utility
+TEST-ENVS := pv64 hvm64
+
+obj-perenv += main.o
+
+include $(ROOT)/build/gen.mk
diff --git a/tests/splitlock/main.c b/tests/splitlock/main.c
new file mode 100644 (file)
index 0000000..a5dc180
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * @file tests/splitlock/main.c
+ * @ref test-splitlock
+ *
+ * @page test-splitlock splitlock
+ *
+ * @todo Docs for test-splitlock
+ *
+ * @see tests/splitlock/main.c
+ */
+#include <xtf.h>
+
+const char test_title[] = "Test splitlock";
+
+void test_main(void)
+{
+    unsigned int *ptr = _p(KB(8) - 2);
+
+    for ( ;; )
+        asm volatile ("lock incl %0" : "+m" (*ptr));
+
+    xtf_success(NULL);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */