events.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _XEN_EVENTS_H
  2. #define _XEN_EVENTS_H
  3. #include <linux/interrupt.h>
  4. #include <xen/interface/event_channel.h>
  5. #include <asm/xen/hypercall.h>
  6. enum ipi_vector {
  7. XEN_RESCHEDULE_VECTOR,
  8. XEN_CALL_FUNCTION_VECTOR,
  9. XEN_NR_IPIS,
  10. };
  11. int bind_evtchn_to_irq(unsigned int evtchn);
  12. int bind_evtchn_to_irqhandler(unsigned int evtchn,
  13. irq_handler_t handler,
  14. unsigned long irqflags, const char *devname,
  15. void *dev_id);
  16. int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
  17. irq_handler_t handler,
  18. unsigned long irqflags, const char *devname,
  19. void *dev_id);
  20. int bind_ipi_to_irqhandler(enum ipi_vector ipi,
  21. unsigned int cpu,
  22. irq_handler_t handler,
  23. unsigned long irqflags,
  24. const char *devname,
  25. void *dev_id);
  26. /*
  27. * Common unbind function for all event sources. Takes IRQ to unbind from.
  28. * Automatically closes the underlying event channel (even for bindings
  29. * made with bind_evtchn_to_irqhandler()).
  30. */
  31. void unbind_from_irqhandler(unsigned int irq, void *dev_id);
  32. void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
  33. static inline void notify_remote_via_evtchn(int port)
  34. {
  35. struct evtchn_send send = { .port = port };
  36. (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
  37. }
  38. extern void notify_remote_via_irq(int irq);
  39. #endif /* _XEN_EVENTS_H */