nmi.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _ASM_X86_NMI_H
  2. #define _ASM_X86_NMI_H
  3. #include <linux/pm.h>
  4. #include <asm/irq.h>
  5. #include <asm/io.h>
  6. #ifdef CONFIG_X86_LOCAL_APIC
  7. extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
  8. extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
  9. extern int reserve_perfctr_nmi(unsigned int);
  10. extern void release_perfctr_nmi(unsigned int);
  11. extern int reserve_evntsel_nmi(unsigned int);
  12. extern void release_evntsel_nmi(unsigned int);
  13. struct ctl_table;
  14. extern int proc_nmi_enabled(struct ctl_table *, int ,
  15. void __user *, size_t *, loff_t *);
  16. extern int unknown_nmi_panic;
  17. void arch_trigger_all_cpu_backtrace(void);
  18. #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
  19. #endif
  20. /*
  21. * Define some priorities for the nmi notifier call chain.
  22. *
  23. * Create a local nmi bit that has a higher priority than
  24. * external nmis, because the local ones are more frequent.
  25. *
  26. * Also setup some default high/normal/low settings for
  27. * subsystems to registers with. Using 4 bits to seperate
  28. * the priorities. This can go alot higher if needed be.
  29. */
  30. #define NMI_LOCAL_SHIFT 16 /* randomly picked */
  31. #define NMI_LOCAL_BIT (1ULL << NMI_LOCAL_SHIFT)
  32. #define NMI_HIGH_PRIOR (1ULL << 8)
  33. #define NMI_NORMAL_PRIOR (1ULL << 4)
  34. #define NMI_LOW_PRIOR (1ULL << 0)
  35. #define NMI_LOCAL_HIGH_PRIOR (NMI_LOCAL_BIT | NMI_HIGH_PRIOR)
  36. #define NMI_LOCAL_NORMAL_PRIOR (NMI_LOCAL_BIT | NMI_NORMAL_PRIOR)
  37. #define NMI_LOCAL_LOW_PRIOR (NMI_LOCAL_BIT | NMI_LOW_PRIOR)
  38. void stop_nmi(void);
  39. void restart_nmi(void);
  40. #endif /* _ASM_X86_NMI_H */