events.h 860 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_XEN_EVENTS_H
  3. #define _ASM_X86_XEN_EVENTS_H
  4. #include <xen/xen.h>
  5. enum ipi_vector {
  6. XEN_RESCHEDULE_VECTOR,
  7. XEN_CALL_FUNCTION_VECTOR,
  8. XEN_CALL_FUNCTION_SINGLE_VECTOR,
  9. XEN_SPIN_UNLOCK_VECTOR,
  10. XEN_IRQ_WORK_VECTOR,
  11. XEN_NMI_VECTOR,
  12. XEN_NR_IPIS,
  13. };
  14. static inline int xen_irqs_disabled(struct pt_regs *regs)
  15. {
  16. return raw_irqs_disabled_flags(regs->flags);
  17. }
  18. /* No need for a barrier -- XCHG is a barrier on x86. */
  19. #define xchg_xen_ulong(ptr, val) xchg((ptr), (val))
  20. extern bool xen_have_vector_callback;
  21. /*
  22. * Events delivered via platform PCI interrupts are always
  23. * routed to vcpu 0 and hence cannot be rebound.
  24. */
  25. static inline bool xen_support_evtchn_rebind(void)
  26. {
  27. return (!xen_hvm_domain() || xen_have_vector_callback);
  28. }
  29. extern bool xen_percpu_upcall;
  30. #endif /* _ASM_X86_XEN_EVENTS_H */