nmi.h 1.4 KB

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