You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xenevent.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _IPXE_XENEVENT_H
  2. #define _IPXE_XENEVENT_H
  3. /** @file
  4. *
  5. * Xen events
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <ipxe/xen.h>
  10. #include <xen/event_channel.h>
  11. /**
  12. * Close event channel
  13. *
  14. * @v xen Xen hypervisor
  15. * @v close Event descriptor
  16. * @ret xenrc Xen status code
  17. */
  18. static inline __attribute__ (( always_inline )) int
  19. xenevent_close ( struct xen_hypervisor *xen, struct evtchn_close *close ) {
  20. return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
  21. EVTCHNOP_close, virt_to_phys ( close ) );
  22. }
  23. /**
  24. * Send event
  25. *
  26. * @v xen Xen hypervisor
  27. * @v send Event descriptor
  28. * @ret xenrc Xen status code
  29. */
  30. static inline __attribute__ (( always_inline )) int
  31. xenevent_send ( struct xen_hypervisor *xen, struct evtchn_send *send ) {
  32. return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
  33. EVTCHNOP_send, virt_to_phys ( send ) );
  34. }
  35. /**
  36. * Allocate an unbound event channel
  37. *
  38. * @v xen Xen hypervisor
  39. * @v alloc_unbound Event descriptor
  40. * @ret xenrc Xen status code
  41. */
  42. static inline __attribute__ (( always_inline )) int
  43. xenevent_alloc_unbound ( struct xen_hypervisor *xen,
  44. struct evtchn_alloc_unbound *alloc_unbound ) {
  45. return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
  46. EVTCHNOP_alloc_unbound,
  47. virt_to_phys ( alloc_unbound ) );
  48. }
  49. #endif /* _IPXE_XENEVENT_H */