aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/event.h
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-08-04 20:34:44 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-08-04 20:34:44 +0100
commit76338bfaaa51f16b2c4ee5602985e510a92c51ed (patch)
tree0cdd4df21619cee123069c53115fac223599c9b7 /xen/include/xen/event.h
parent5eeca68ffd007f81ac202eafdc96d44e5bb69bfb (diff)
downloadxen-76338bfaaa51f16b2c4ee5602985e510a92c51ed.tar.gz
xen-76338bfaaa51f16b2c4ee5602985e510a92c51ed.tar.bz2
xen-76338bfaaa51f16b2c4ee5602985e510a92c51ed.zip
[XEN] Add Xen-attached event channels, which will be used
by HVM for the ioreq_packet port. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/event.h')
-rw-r--r--xen/include/xen/event.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 7b0d428b67..304466a945 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -15,33 +15,58 @@
#include <asm/bitops.h>
#include <asm/event.h>
-extern void evtchn_set_pending(struct vcpu *v, int port);
+void evtchn_set_pending(struct vcpu *v, int port);
/*
* send_guest_vcpu_virq: Notify guest via a per-VCPU VIRQ.
* @v: VCPU to which virtual IRQ should be sent
* @virq: Virtual IRQ number (VIRQ_*)
*/
-extern void send_guest_vcpu_virq(struct vcpu *v, int virq);
+void send_guest_vcpu_virq(struct vcpu *v, int virq);
/*
* send_guest_global_virq: Notify guest via a global VIRQ.
* @d: Domain to which virtual IRQ should be sent
* @virq: Virtual IRQ number (VIRQ_*)
*/
-extern void send_guest_global_virq(struct domain *d, int virq);
+void send_guest_global_virq(struct domain *d, int virq);
/*
* send_guest_pirq:
* @d: Domain to which physical IRQ should be sent
* @pirq: Physical IRQ number
*/
-extern void send_guest_pirq(struct domain *d, int pirq);
+void send_guest_pirq(struct domain *d, int pirq);
/* Send a notification from a local event-channel port. */
-extern long evtchn_send(unsigned int lport);
+long evtchn_send(unsigned int lport);
/* Bind a local event-channel port to the specified VCPU. */
-extern long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id);
+long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id);
+
+/* Allocate/free a Xen-attached event channel port. */
+int alloc_unbound_xen_event_channel(
+ struct vcpu *local_vcpu, domid_t remote_domid);
+void free_xen_event_channel(
+ struct vcpu *local_vcpu, int port);
+
+/* Notify remote end of a Xen-attached event channel.*/
+void notify_via_xen_event_channel(int lport);
+
+/* Wait on a Xen-attached event channel. */
+#define wait_on_xen_event_channel(port, condition) \
+ do { \
+ if ( condition ) \
+ break; \
+ set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags); \
+ mb(); /* set blocked status /then/ re-evaluate condition */ \
+ if ( condition ) \
+ { \
+ clear_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags); \
+ break; \
+ } \
+ raise_softirq(SCHEDULE_SOFTIRQ); \
+ do_softirq(); \
+ } while ( 0 )
#endif /* __XEN_EVENT_H__ */