nmi.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #if defined(ARCH_HAS_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
  16. #include <asm/nmi.h>
  17. extern void touch_nmi_watchdog(void);
  18. #else
  19. static inline void touch_nmi_watchdog(void)
  20. {
  21. touch_softlockup_watchdog();
  22. }
  23. #endif
  24. /*
  25. * Create trigger_all_cpu_backtrace() out of the arch-provided
  26. * base function. Return whether such support was available,
  27. * to allow calling code to fall back to some other mechanism:
  28. */
  29. #ifdef arch_trigger_all_cpu_backtrace
  30. static inline bool trigger_all_cpu_backtrace(void)
  31. {
  32. arch_trigger_all_cpu_backtrace();
  33. return true;
  34. }
  35. #else
  36. static inline bool trigger_all_cpu_backtrace(void)
  37. {
  38. return false;
  39. }
  40. #endif
  41. #ifdef CONFIG_LOCKUP_DETECTOR
  42. int hw_nmi_is_cpu_stuck(struct pt_regs *);
  43. u64 hw_nmi_get_sample_period(int watchdog_thresh);
  44. extern int watchdog_enabled;
  45. extern int watchdog_thresh;
  46. struct ctl_table;
  47. extern int proc_dowatchdog(struct ctl_table *, int ,
  48. void __user *, size_t *, loff_t *);
  49. #endif
  50. #endif