direct-io.hg

view xen/include/xen/event.h @ 10949:ffa5b2975dff

[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>
author kfraser@localhost.localdomain
date Fri Aug 04 20:34:44 2006 +0100 (2006-08-04)
parents ddc25d4ebf60
children 415614d3a1ee
line source
1 /******************************************************************************
2 * event.h
3 *
4 * A nice interface for passing asynchronous events to guest OSes.
5 *
6 * Copyright (c) 2002-2006, K A Fraser
7 */
9 #ifndef __XEN_EVENT_H__
10 #define __XEN_EVENT_H__
12 #include <xen/config.h>
13 #include <xen/sched.h>
14 #include <xen/smp.h>
15 #include <asm/bitops.h>
16 #include <asm/event.h>
18 void evtchn_set_pending(struct vcpu *v, int port);
20 /*
21 * send_guest_vcpu_virq: Notify guest via a per-VCPU VIRQ.
22 * @v: VCPU to which virtual IRQ should be sent
23 * @virq: Virtual IRQ number (VIRQ_*)
24 */
25 void send_guest_vcpu_virq(struct vcpu *v, int virq);
27 /*
28 * send_guest_global_virq: Notify guest via a global VIRQ.
29 * @d: Domain to which virtual IRQ should be sent
30 * @virq: Virtual IRQ number (VIRQ_*)
31 */
32 void send_guest_global_virq(struct domain *d, int virq);
34 /*
35 * send_guest_pirq:
36 * @d: Domain to which physical IRQ should be sent
37 * @pirq: Physical IRQ number
38 */
39 void send_guest_pirq(struct domain *d, int pirq);
41 /* Send a notification from a local event-channel port. */
42 long evtchn_send(unsigned int lport);
44 /* Bind a local event-channel port to the specified VCPU. */
45 long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id);
47 /* Allocate/free a Xen-attached event channel port. */
48 int alloc_unbound_xen_event_channel(
49 struct vcpu *local_vcpu, domid_t remote_domid);
50 void free_xen_event_channel(
51 struct vcpu *local_vcpu, int port);
53 /* Notify remote end of a Xen-attached event channel.*/
54 void notify_via_xen_event_channel(int lport);
56 /* Wait on a Xen-attached event channel. */
57 #define wait_on_xen_event_channel(port, condition) \
58 do { \
59 if ( condition ) \
60 break; \
61 set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags); \
62 mb(); /* set blocked status /then/ re-evaluate condition */ \
63 if ( condition ) \
64 { \
65 clear_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags); \
66 break; \
67 } \
68 raise_softirq(SCHEDULE_SOFTIRQ); \
69 do_softirq(); \
70 } while ( 0 )
72 #endif /* __XEN_EVENT_H__ */