ia64/xen-unstable

view xen/include/xen/event.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents c820bf73a914
children
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 <xen/softirq.h>
16 #include <asm/bitops.h>
17 #include <asm/event.h>
19 /*
20 * send_guest_vcpu_virq: Notify guest via a per-VCPU VIRQ.
21 * @v: VCPU to which virtual IRQ should be sent
22 * @virq: Virtual IRQ number (VIRQ_*)
23 */
24 void send_guest_vcpu_virq(struct vcpu *v, int virq);
26 /*
27 * send_guest_global_virq: Notify guest via a global VIRQ.
28 * @d: Domain to which virtual IRQ should be sent
29 * @virq: Virtual IRQ number (VIRQ_*)
30 */
31 void send_guest_global_virq(struct domain *d, int virq);
33 /*
34 * send_guest_pirq:
35 * @d: Domain to which physical IRQ should be sent
36 * @pirq: Physical IRQ number
37 * Returns TRUE if the delivery port was already pending.
38 */
39 int send_guest_pirq(struct domain *d, int pirq);
41 /* Send a notification from a given domain's event-channel port. */
42 int evtchn_send(struct domain *d, 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 /* Unmask a local event-channel port. */
48 int evtchn_unmask(unsigned int port);
50 /* Allocate/free a Xen-attached event channel port. */
51 int alloc_unbound_xen_event_channel(
52 struct vcpu *local_vcpu, domid_t remote_domid);
53 void free_xen_event_channel(
54 struct vcpu *local_vcpu, int port);
56 /* Query if event channel is in use by the guest */
57 int guest_enabled_event(struct vcpu *v, int virq);
59 /* Notify remote end of a Xen-attached event channel.*/
60 void notify_via_xen_event_channel(int lport);
62 /* Wait on a Xen-attached event channel. */
63 #define wait_on_xen_event_channel(port, condition) \
64 do { \
65 if ( condition ) \
66 break; \
67 set_bit(_VPF_blocked_in_xen, &current->pause_flags); \
68 mb(); /* set blocked status /then/ re-evaluate condition */ \
69 if ( condition ) \
70 { \
71 clear_bit(_VPF_blocked_in_xen, &current->pause_flags); \
72 break; \
73 } \
74 raise_softirq(SCHEDULE_SOFTIRQ); \
75 do_softirq(); \
76 } while ( 0 )
78 #define prepare_wait_on_xen_event_channel(port) \
79 do { \
80 set_bit(_VPF_blocked_in_xen, &current->pause_flags); \
81 raise_softirq(SCHEDULE_SOFTIRQ); \
82 mb(); /* set blocked status /then/ caller does his work */ \
83 } while ( 0 )
85 #endif /* __XEN_EVENT_H__ */