diff options
author | Matthew Wilcox <willy@linux.intel.com> | 2016-05-20 20:01:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-20 20:58:30 -0400 |
commit | f518b1607e128a8dcfa75f539864c1321c5a18ea (patch) | |
tree | 4bddf435c81080c03b6efca2cf63b84f3df1c2c0 /tools/testing/radix-tree/linux/kernel.h | |
parent | e9256efcc8e390fa4fcf796a0c0b47d642d77d32 (diff) |
radix tree test suite: fix build
Add an empty linux/init.h, and definitions for a few parts of the kernel
API either in use now, or to be used in the near future. Start using the
common definitions in tools/include/linux, although more work needs to be
done here.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Kirill Shutemov <kirill.shutemov@linux.intel.com>
Cc: Jan Kara <jack@suse.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/radix-tree/linux/kernel.h')
-rw-r--r-- | tools/testing/radix-tree/linux/kernel.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h index ae013b0160ac..6d0cdf618084 100644 --- a/tools/testing/radix-tree/linux/kernel.h +++ b/tools/testing/radix-tree/linux/kernel.h | |||
@@ -7,19 +7,25 @@ | |||
7 | #include <stddef.h> | 7 | #include <stddef.h> |
8 | #include <limits.h> | 8 | #include <limits.h> |
9 | 9 | ||
10 | #include "../../include/linux/compiler.h" | ||
11 | |||
10 | #ifndef NULL | 12 | #ifndef NULL |
11 | #define NULL 0 | 13 | #define NULL 0 |
12 | #endif | 14 | #endif |
13 | 15 | ||
14 | #define BUG_ON(expr) assert(!(expr)) | 16 | #define BUG_ON(expr) assert(!(expr)) |
17 | #define WARN_ON(expr) assert(!(expr)) | ||
15 | #define __init | 18 | #define __init |
16 | #define __must_check | 19 | #define __must_check |
17 | #define panic(expr) | 20 | #define panic(expr) |
18 | #define printk printf | 21 | #define printk printf |
19 | #define __force | 22 | #define __force |
20 | #define likely(c) (c) | ||
21 | #define unlikely(c) (c) | ||
22 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 23 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
24 | #define pr_debug printk | ||
25 | |||
26 | #define smp_rmb() barrier() | ||
27 | #define smp_wmb() barrier() | ||
28 | #define cpu_relax() barrier() | ||
23 | 29 | ||
24 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) | 30 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) |
25 | 31 | ||
@@ -28,6 +34,8 @@ | |||
28 | (type *)( (char *)__mptr - offsetof(type, member) );}) | 34 | (type *)( (char *)__mptr - offsetof(type, member) );}) |
29 | #define min(a, b) ((a) < (b) ? (a) : (b)) | 35 | #define min(a, b) ((a) < (b) ? (a) : (b)) |
30 | 36 | ||
37 | #define cond_resched() sched_yield() | ||
38 | |||
31 | static inline int in_interrupt(void) | 39 | static inline int in_interrupt(void) |
32 | { | 40 | { |
33 | return 0; | 41 | return 0; |