nmi.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #include <asm/io.h>
  8. struct pt_regs;
  9. typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu);
  10. /**
  11. * set_nmi_callback
  12. *
  13. * Set a handler for an NMI. Only one handler may be
  14. * set. Return 1 if the NMI was handled.
  15. */
  16. void set_nmi_callback(nmi_callback_t callback);
  17. /**
  18. * unset_nmi_callback
  19. *
  20. * Remove the handler previously set.
  21. */
  22. void unset_nmi_callback(void);
  23. #ifdef CONFIG_PM
  24. /** Replace the PM callback routine for NMI. */
  25. struct pm_dev * set_nmi_pm_callback(pm_callback callback);
  26. /** Unset the PM callback routine back to the default. */
  27. void unset_nmi_pm_callback(struct pm_dev * dev);
  28. #else
  29. static inline struct pm_dev * set_nmi_pm_callback(pm_callback callback)
  30. {
  31. return 0;
  32. }
  33. static inline void unset_nmi_pm_callback(struct pm_dev * dev)
  34. {
  35. }
  36. #endif /* CONFIG_PM */
  37. extern void default_do_nmi(struct pt_regs *);
  38. extern void die_nmi(char *str, struct pt_regs *regs);
  39. #define get_nmi_reason() inb(0x61)
  40. extern int panic_on_timeout;
  41. extern int unknown_nmi_panic;
  42. extern int check_nmi_watchdog(void);
  43. extern void setup_apic_nmi_watchdog (void);
  44. extern int reserve_lapic_nmi(void);
  45. extern void release_lapic_nmi(void);
  46. extern void disable_timer_nmi_watchdog(void);
  47. extern void enable_timer_nmi_watchdog(void);
  48. extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
  49. extern void nmi_watchdog_default(void);
  50. extern int setup_nmi_watchdog(char *);
  51. extern unsigned int nmi_watchdog;
  52. #define NMI_DEFAULT -1
  53. #define NMI_NONE 0
  54. #define NMI_IO_APIC 1
  55. #define NMI_LOCAL_APIC 2
  56. #define NMI_INVALID 3
  57. #endif /* ASM_NMI_H */