events.h 1.3 KB

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