radix tree test suite: Remove types.h
authorMatthew Wilcox <mawilcox@microsoft.com>
Fri, 16 Dec 2016 19:53:45 +0000 (14:53 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Jun 2018 08:28:56 +0000 (10:28 +0200)
commit 12ea65390bd5a46f8a70f068eb0d48922576a781 upstream.

Move the pieces we still need to tools/include and update a few implicit
includes.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
[ Just take the tools/include/linux/* portions of this patch - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/include/linux/compiler.h
tools/include/linux/spinlock.h [new file with mode: 0644]

index 6326ede9aecef7f6b417f67990894032e79b3f4a..8de163b17c0d00011d33083d247936d8265465e7 100644 (file)
@@ -25,6 +25,8 @@
 #endif
 
 #define __user
+#define __rcu
+#define __read_mostly
 
 #ifndef __attribute_const__
 # define __attribute_const__
@@ -54,6 +56,8 @@
 # define unlikely(x)           __builtin_expect(!!(x), 0)
 #endif
 
+#define uninitialized_var(x) x = *(&(x))
+
 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
 
 #include <linux/types.h>
diff --git a/tools/include/linux/spinlock.h b/tools/include/linux/spinlock.h
new file mode 100644 (file)
index 0000000..58397dc
--- /dev/null
@@ -0,0 +1,5 @@
+#define spinlock_t             pthread_mutex_t
+#define DEFINE_SPINLOCK(x)     pthread_mutex_t x = PTHREAD_MUTEX_INITIALIZER;
+
+#define spin_lock_irqsave(x, f)                (void)f, pthread_mutex_lock(x)
+#define spin_unlock_irqrestore(x, f)   (void)f, pthread_mutex_unlock(x)