lockdep.h 1.4 KB

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