aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/event.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-14 19:33:45 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-14 19:33:45 +0100
commitbadff410e406c0efaaac5d50cd6092e3768951f1 (patch)
tree87df811f1d06f9af245b2ef6a2131721112c70d9 /xen/include/xen/event.h
parenta55585779379db13f69f047e7802f6bccf105e95 (diff)
downloadxen-badff410e406c0efaaac5d50cd6092e3768951f1.tar.gz
xen-badff410e406c0efaaac5d50cd6092e3768951f1.tar.bz2
xen-badff410e406c0efaaac5d50cd6092e3768951f1.zip
Define a new sched_op hypercall called sched_op_new, which differs from the
legacy hypercall in that it takes a pointer to a block of extra arguments rather than an opaque unsigned long. The old hypercall still exists, for backwards compatibility. The new hypercall supports new sub-command SCHEDOP_poll, which can be used to wait on a set of event-channel ports with an optional timeout. This is exported in XenLinux as HYPERVISOR_poll, and used in the pcifront driver to wait on a response from the pciback driver. Can also be used for debuggers. :-) Signed-off-by: Keir Fraser <keir@xensource.com> Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'xen/include/xen/event.h')
-rw-r--r--xen/include/xen/event.h34
1 files changed, 5 insertions, 29 deletions
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2e0c2712cc..8487a25c7b 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -15,41 +15,14 @@
#include <asm/bitops.h>
#include <asm/event.h>
-/*
- * EVENT-CHANNEL NOTIFICATIONS
- * NB. On x86, the atomic bit operations also act as memory barriers. There
- * is therefore sufficiently strict ordering for this architecture -- others
- * may require explicit memory barriers.
- */
-
-static inline void evtchn_set_pending(struct vcpu *v, int port)
-{
- struct domain *d = v->domain;
- shared_info_t *s = d->shared_info;
-
- /* These four operations must happen in strict order. */
- if ( !test_and_set_bit(port, &s->evtchn_pending[0]) &&
- !test_bit (port, &s->evtchn_mask[0]) &&
- !test_and_set_bit(port / BITS_PER_LONG,
- &v->vcpu_info->evtchn_pending_sel) &&
- !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) )
- {
- evtchn_notify(v);
- }
-}
+extern void evtchn_set_pending(struct vcpu *v, int port);
/*
* send_guest_virq:
* @v: VCPU to which virtual IRQ should be sent
* @virq: Virtual IRQ number (VIRQ_*)
*/
-static inline void send_guest_virq(struct vcpu *v, int virq)
-{
- int port = v->virq_to_evtchn[virq];
-
- if ( likely(port != 0) )
- evtchn_set_pending(v, port);
-}
+extern void send_guest_virq(struct vcpu *v, int virq);
/*
* send_guest_pirq:
@@ -63,6 +36,9 @@ extern void send_guest_pirq(struct domain *d, int pirq);
(!!(v)->vcpu_info->evtchn_upcall_pending & \
!(v)->vcpu_info->evtchn_upcall_mask)
+#define evtchn_pending(d, p) \
+ (test_bit((p), &(d)->shared_info->evtchn_pending[0]))
+
/* Send a notification from a local event-channel port. */
extern long evtchn_send(unsigned int lport);