]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - tools/lib/lockdep/uinclude/linux/kernel.h
4a31ebe1a377c065e0c3c27e81c2fe85ed43115b
1 #ifndef _LIBLOCKDEP_LINUX_KERNEL_H_
2 #define _LIBLOCKDEP_LINUX_KERNEL_H_
4 #include <linux/export.h>
5 #include <linux/types.h>
7 #include <linux/hardirq.h>
8 #include <linux/kern_levels.h>
11 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
14 #define container_of(ptr, type, member) ({ \
15 const typeof(((type *)0)->member) * __mptr = (ptr); \
16 (type *)((char *)__mptr - offsetof(type, member)); })
19 #define max(x, y) ({ \
20 typeof(x) _max1 = (x); \
21 typeof(y) _max2 = (y); \
22 (void) (&_max1 == &_max2); \
23 _max1 > _max2 ? _max1 : _max2; })
25 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
27 static inline int lockdep_warn(int condition
)
31 #define WARN_ON(x) lockdep_warn(x)
32 #define WARN_ON_ONCE(x) WARN_ON(x)
33 #define WARN(x, y...) WARN_ON(x)
36 #define uninitialized_var(x) x
39 #define list_add_tail_rcu list_add_tail
40 #define list_for_each_entry_rcu list_for_each_entry
42 #define synchronize_sched()
45 #define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
49 #define _RET_IP_ CALLER_ADDR0
53 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
56 #define pr_err(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
57 #define pr_warn pr_err
59 #define current_gfp_context(k) 0