nmi.h 1.5 KB

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