nmi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * linux/include/asm-i386/nmi.h
  3. */
  4. #ifndef ASM_NMI_H
  5. #define ASM_NMI_H
  6. #include <linux/pm.h>
  7. struct pt_regs;
  8. typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu);
  9. /**
  10. * set_nmi_callback
  11. *
  12. * Set a handler for an NMI. Only one handler may be
  13. * set. Return 1 if the NMI was handled.
  14. */
  15. void set_nmi_callback(nmi_callback_t callback);
  16. /**
  17. * unset_nmi_callback
  18. *
  19. * Remove the handler previously set.
  20. */
  21. void unset_nmi_callback(void);
  22. #ifdef CONFIG_PM
  23. /** Replace the PM callback routine for NMI. */
  24. struct pm_dev * set_nmi_pm_callback(pm_callback callback);
  25. /** Unset the PM callback routine back to the default. */
  26. void unset_nmi_pm_callback(struct pm_dev * dev);
  27. #else
  28. static inline struct pm_dev * set_nmi_pm_callback(pm_callback callback)
  29. {
  30. return 0;
  31. }
  32. static inline void unset_nmi_pm_callback(struct pm_dev * dev)
  33. {
  34. }
  35. #endif /* CONFIG_PM */
  36. extern void default_do_nmi(struct pt_regs *);
  37. extern void die_nmi(char *str, struct pt_regs *regs);
  38. #define get_nmi_reason() inb(0x61)
  39. extern int panic_on_timeout;
  40. extern int unknown_nmi_panic;
  41. extern int check_nmi_watchdog(void);
  42. #endif /* ASM_NMI_H */