iPXE
xenevent.h
Go to the documentation of this file.
00001 #ifndef _IPXE_XENEVENT_H
00002 #define _IPXE_XENEVENT_H
00003 
00004 /** @file
00005  *
00006  * Xen events
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/xen.h>
00013 #include <xen/event_channel.h>
00014 
00015 /**
00016  * Close event channel
00017  *
00018  * @v xen               Xen hypervisor
00019  * @v close             Event descriptor
00020  * @ret xenrc           Xen status code
00021  */
00022 static inline __attribute__ (( always_inline )) int
00023 xenevent_close ( struct xen_hypervisor *xen, struct evtchn_close *close ) {
00024 
00025         return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
00026                                  EVTCHNOP_close, virt_to_phys ( close ) );
00027 }
00028 
00029 /**
00030  * Send event
00031  *
00032  * @v xen               Xen hypervisor
00033  * @v send              Event descriptor
00034  * @ret xenrc           Xen status code
00035  */
00036 static inline __attribute__ (( always_inline )) int
00037 xenevent_send ( struct xen_hypervisor *xen, struct evtchn_send *send ) {
00038 
00039         return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
00040                                  EVTCHNOP_send, virt_to_phys ( send ) );
00041 }
00042 
00043 /**
00044  * Allocate an unbound event channel
00045  *
00046  * @v xen               Xen hypervisor
00047  * @v alloc_unbound     Event descriptor
00048  * @ret xenrc           Xen status code
00049  */
00050 static inline __attribute__ (( always_inline )) int
00051 xenevent_alloc_unbound ( struct xen_hypervisor *xen,
00052                          struct evtchn_alloc_unbound *alloc_unbound ) {
00053 
00054         return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
00055                                  EVTCHNOP_alloc_unbound,
00056                                  virt_to_phys ( alloc_unbound ) );
00057 }
00058 
00059 #endif /* _IPXE_XENEVENT_H */