lockdep.h 1010 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _LIBLOCKDEP_LOCKDEP_H_
  2. #define _LIBLOCKDEP_LOCKDEP_H_
  3. #include <sys/prctl.h>
  4. #include <sys/syscall.h>
  5. #include <string.h>
  6. #include <limits.h>
  7. #include <linux/utsname.h>
  8. #define MAX_LOCK_DEPTH 2000UL
  9. #include "../../../include/linux/lockdep.h"
  10. struct task_struct {
  11. u64 curr_chain_key;
  12. int lockdep_depth;
  13. unsigned int lockdep_recursion;
  14. struct held_lock held_locks[MAX_LOCK_DEPTH];
  15. gfp_t lockdep_reclaim_gfp;
  16. int pid;
  17. char comm[17];
  18. };
  19. extern struct task_struct *__curr(void);
  20. #define current (__curr())
  21. #define debug_locks_off() 1
  22. #define task_pid_nr(tsk) ((tsk)->pid)
  23. #define KSYM_NAME_LEN 128
  24. #define printk printf
  25. #define list_del_rcu list_del
  26. #define atomic_t unsigned long
  27. #define atomic_inc(x) ((*(x))++)
  28. static struct new_utsname *init_utsname(void)
  29. {
  30. static struct new_utsname n = (struct new_utsname) {
  31. .release = "liblockdep",
  32. .version = LIBLOCKDEP_VERSION,
  33. };
  34. return &n;
  35. }
  36. #define print_tainted() ""
  37. #define static_obj(x) 1
  38. #define debug_show_all_locks()
  39. #endif