]> Pileus Git - ~andy/linux/blob - tools/lib/lockdep/uinclude/linux/lockdep.h
liblockdep: Wrap kernel/locking/lockdep.c to allow usage from userspace
[~andy/linux] / tools / lib / lockdep / uinclude / linux / lockdep.h
1 #ifndef _LIBLOCKDEP_LOCKDEP_H_
2 #define _LIBLOCKDEP_LOCKDEP_H_
3
4 #include <sys/prctl.h>
5 #include <sys/syscall.h>
6 #include <string.h>
7 #include <limits.h>
8 #include <linux/utsname.h>
9
10
11 #define MAX_LOCK_DEPTH 2000UL
12
13 #include "../../../include/linux/lockdep.h"
14
15 struct task_struct {
16         u64 curr_chain_key;
17         int lockdep_depth;
18         unsigned int lockdep_recursion;
19         struct held_lock held_locks[MAX_LOCK_DEPTH];
20         gfp_t lockdep_reclaim_gfp;
21         int pid;
22         char comm[17];
23 };
24
25 extern struct task_struct *__curr(void);
26
27 #define current (__curr())
28
29 #define debug_locks_off() 1
30 #define task_pid_nr(tsk) ((tsk)->pid)
31
32 #define KSYM_NAME_LEN 128
33 #define printk printf
34
35 #define list_del_rcu list_del
36
37 #define atomic_t unsigned long
38 #define atomic_inc(x) ((*(x))++)
39
40 static struct new_utsname *init_utsname(void)
41 {
42         static struct new_utsname n = (struct new_utsname) {
43                 .release = "liblockdep",
44                 .version = LIBLOCKDEP_VERSION,
45         };
46
47         return &n;
48 }
49
50 #define print_tainted() ""
51 #define static_obj(x) 1
52
53 #define debug_show_all_locks()
54
55 #endif