summaryrefslogtreecommitdiff
path: root/include/linux/torture.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-01-27 23:49:39 +0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 21:00:58 +0400
commit51b1130eb5823ddb90a9ad07d243031d8cb7ecf2 (patch)
treeab66b2dfa679027a90b122ee95c1a82c4ff5a1f7 /include/linux/torture.h
parent806274c018e9858320a27b785df761f45c33a56c (diff)
downloadlinux-51b1130eb5823ddb90a9ad07d243031d8cb7ecf2.tar.xz
rcutorture: Abstract rcu_torture_random()
Because rcu_torture_random() will be used by the locking equivalent to rcutorture, pull it out into its own module. This new module cannot be separately configured, instead, use the Kconfig "select" statement from the Kconfig options of tests depending on it. Suggested-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/torture.h')
-rw-r--r--include/linux/torture.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
new file mode 100644
index 000000000000..979e3e6b378a
--- /dev/null
+++ b/include/linux/torture.h
@@ -0,0 +1,47 @@
+/*
+ * Common functions for in-kernel torture tests.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
+ * Copyright IBM Corporation, 2014
+ *
+ * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+ */
+
+#ifndef __LINUX_TORTURE_H
+#define __LINUX_TORTURE_H
+
+#include <linux/types.h>
+#include <linux/cache.h>
+#include <linux/spinlock.h>
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/seqlock.h>
+#include <linux/lockdep.h>
+#include <linux/completion.h>
+#include <linux/debugobjects.h>
+#include <linux/bug.h>
+#include <linux/compiler.h>
+
+struct torture_random_state {
+ unsigned long trs_state;
+ long trs_count;
+};
+
+#define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 }
+
+unsigned long torture_random(struct torture_random_state *trsp);
+
+#endif /* __LINUX_TORTURE_H */