events.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. int resend_irq_on_evtchn(unsigned int irq);
  30. static inline void notify_remote_via_evtchn(int port)
  31. {
  32. struct evtchn_send send = { .port = port };
  33. (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send);
  34. }
  35. extern void notify_remote_via_irq(int irq);
  36. #endif /* _XEN_EVENTS_H */