events.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #include <asm/xen/events.h>
  7. int bind_evtchn_to_irq(unsigned int evtchn);
  8. int bind_evtchn_to_irqhandler(unsigned int evtchn,
  9. irq_handler_t handler,
  10. unsigned long irqflags, const char *devname,
  11. void *dev_id);
  12. int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
  13. irq_handler_t handler,
  14. unsigned long irqflags, const char *devname,
  15. void *dev_id);
  16. int bind_ipi_to_irqhandler(enum ipi_vector ipi,
  17. unsigned int cpu,
  18. irq_handler_t handler,
  19. unsigned long irqflags,
  20. const char *devname,
  21. void *dev_id);
  22. /*
  23. * Common unbind function for all event sources. Takes IRQ to unbind from.
  24. * Automatically closes the underlying event channel (even for bindings
  25. * made with bind_evtchn_to_irqhandler()).
  26. */
  27. void unbind_from_irqhandler(unsigned int irq, void *dev_id);
  28. void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
  29. static inline void notify_remote_via_evtchn(int port)
  30. {
  31. struct evtchn_send send = { .port = port };
  32. (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
  33. }
  34. extern void notify_remote_via_irq(int irq);
  35. #endif /* _XEN_EVENTS_H */