nmi.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /******************************************************************************
  2. * nmi.h
  3. *
  4. * NMI callback registration and reason codes.
  5. *
  6. * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
  7. */
  8. #ifndef __XEN_PUBLIC_NMI_H__
  9. #define __XEN_PUBLIC_NMI_H__
  10. #include <xen/interface/xen.h>
  11. /*
  12. * NMI reason codes:
  13. * Currently these are x86-specific, stored in arch_shared_info.nmi_reason.
  14. */
  15. /* I/O-check error reported via ISA port 0x61, bit 6. */
  16. #define _XEN_NMIREASON_io_error 0
  17. #define XEN_NMIREASON_io_error (1UL << _XEN_NMIREASON_io_error)
  18. /* PCI SERR reported via ISA port 0x61, bit 7. */
  19. #define _XEN_NMIREASON_pci_serr 1
  20. #define XEN_NMIREASON_pci_serr (1UL << _XEN_NMIREASON_pci_serr)
  21. /* Unknown hardware-generated NMI. */
  22. #define _XEN_NMIREASON_unknown 2
  23. #define XEN_NMIREASON_unknown (1UL << _XEN_NMIREASON_unknown)
  24. /*
  25. * long nmi_op(unsigned int cmd, void *arg)
  26. * NB. All ops return zero on success, else a negative error code.
  27. */
  28. /*
  29. * Register NMI callback for this (calling) VCPU. Currently this only makes
  30. * sense for domain 0, vcpu 0. All other callers will be returned EINVAL.
  31. * arg == pointer to xennmi_callback structure.
  32. */
  33. #define XENNMI_register_callback 0
  34. struct xennmi_callback {
  35. unsigned long handler_address;
  36. unsigned long pad;
  37. };
  38. DEFINE_GUEST_HANDLE_STRUCT(xennmi_callback);
  39. /*
  40. * Deregister NMI callback for this (calling) VCPU.
  41. * arg == NULL.
  42. */
  43. #define XENNMI_unregister_callback 1
  44. #endif /* __XEN_PUBLIC_NMI_H__ */