nmi.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * linux/include/linux/nmi.h
  3. */
  4. #ifndef LINUX_NMI_H
  5. #define LINUX_NMI_H
  6. #include <linux/sched.h>
  7. #include <asm/irq.h>
  8. /**
  9. * touch_nmi_watchdog - restart NMI watchdog timeout.
  10. *
  11. * If the architecture supports the NMI watchdog, touch_nmi_watchdog()
  12. * may be used to reset the timeout - for code which intentionally
  13. * disables interrupts for a long time. This call is stateless.
  14. */
  15. #ifdef ARCH_HAS_NMI_WATCHDOG
  16. #include <asm/nmi.h>
  17. #endif
  18. #ifndef CONFIG_HARDLOCKUP_DETECTOR
  19. static inline void touch_nmi_watchdog(void)
  20. {
  21. touch_softlockup_watchdog();
  22. }
  23. #else
  24. extern void touch_nmi_watchdog(void);
  25. #endif
  26. /*
  27. * Create trigger_all_cpu_backtrace() out of the arch-provided
  28. * base function. Return whether such support was available,
  29. * to allow calling code to fall back to some other mechanism:
  30. */
  31. #ifdef arch_trigger_all_cpu_backtrace
  32. static inline bool trigger_all_cpu_backtrace(void)
  33. {
  34. arch_trigger_all_cpu_backtrace();
  35. return true;
  36. }
  37. #else
  38. static inline bool trigger_all_cpu_backtrace(void)
  39. {
  40. return false;
  41. }
  42. #endif
  43. #ifdef CONFIG_LOCKUP_DETECTOR
  44. int hw_nmi_is_cpu_stuck(struct pt_regs *);
  45. u64 hw_nmi_get_sample_period(void);
  46. extern int watchdog_enabled;
  47. struct ctl_table;
  48. extern int proc_dowatchdog_enabled(struct ctl_table *, int ,
  49. void __user *, size_t *, loff_t *);
  50. #endif
  51. #endif