nmi.h 1.3 KB

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