Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
5634bd7d SL |
2 | #ifndef _LIBLOCKDEP_LOCKDEP_H_ |
3 | #define _LIBLOCKDEP_LOCKDEP_H_ | |
4 | ||
5 | #include <sys/prctl.h> | |
6 | #include <sys/syscall.h> | |
7 | #include <string.h> | |
8 | #include <limits.h> | |
9 | #include <linux/utsname.h> | |
2b62c2db | 10 | #include <linux/compiler.h> |
e58e871b LASL |
11 | #include <linux/export.h> |
12 | #include <linux/kern_levels.h> | |
13 | #include <linux/err.h> | |
14 | #include <linux/rcu.h> | |
15 | #include <linux/list.h> | |
16 | #include <linux/hardirq.h> | |
20fb654a | 17 | #include <unistd.h> |
5634bd7d | 18 | |
98dcea0c | 19 | #define MAX_LOCK_DEPTH 63UL |
5634bd7d | 20 | |
95f75476 SL |
21 | #define asmlinkage |
22 | #define __visible | |
23 | ||
5634bd7d SL |
24 | #include "../../../include/linux/lockdep.h" |
25 | ||
26 | struct task_struct { | |
27 | u64 curr_chain_key; | |
28 | int lockdep_depth; | |
29 | unsigned int lockdep_recursion; | |
30 | struct held_lock held_locks[MAX_LOCK_DEPTH]; | |
31 | gfp_t lockdep_reclaim_gfp; | |
32 | int pid; | |
33 | char comm[17]; | |
34 | }; | |
35 | ||
36 | extern struct task_struct *__curr(void); | |
37 | ||
38 | #define current (__curr()) | |
39 | ||
bb7ea2a9 BH |
40 | static inline int debug_locks_off(void) |
41 | { | |
42 | return 1; | |
43 | } | |
44 | ||
5634bd7d SL |
45 | #define task_pid_nr(tsk) ((tsk)->pid) |
46 | ||
47 | #define KSYM_NAME_LEN 128 | |
20fb654a | 48 | #define printk(...) dprintf(STDOUT_FILENO, __VA_ARGS__) |
e58e871b LASL |
49 | #define pr_err(format, ...) fprintf (stderr, format, ## __VA_ARGS__) |
50 | #define pr_warn pr_err | |
92ccc262 | 51 | #define pr_cont pr_err |
5634bd7d SL |
52 | |
53 | #define list_del_rcu list_del | |
54 | ||
55 | #define atomic_t unsigned long | |
56 | #define atomic_inc(x) ((*(x))++) | |
57 | ||
5634bd7d SL |
58 | #define print_tainted() "" |
59 | #define static_obj(x) 1 | |
60 | ||
61 | #define debug_show_all_locks() | |
2b62c2db | 62 | extern void debug_check_no_locks_held(void); |
5634bd7d | 63 | |
3156cbae LASL |
64 | static __used bool __is_kernel_percpu_address(unsigned long addr, void *can_addr) |
65 | { | |
66 | return false; | |
67 | } | |
68 | ||
5634bd7d | 69 | #endif |