ia64/xen-unstable

view xen/include/xen/event.h @ 9597:8f7aad20b4a5

Backtrack on the new interface for reserved event-channel
ports, as binding them in user space via the evtchn driver
would be a pain. Instead extend VIRQs so they can be
classified as 'global' or 'per vcpu'. The former can only
be allocated once per guest, but can be re-bound to
an arbitrary VCPU.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 05 19:30:02 2006 +0100 (2006-04-05)
parents e1152d55ea31
children 4c8311699685
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 extern 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 extern 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 extern 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 extern void send_guest_pirq(struct domain *d, int pirq);
41 /* Note: Bitwise operations result in fast code with no branches. */
42 #define event_pending(v) \
43 (!!(v)->vcpu_info->evtchn_upcall_pending & \
44 !(v)->vcpu_info->evtchn_upcall_mask)
46 #define evtchn_pending(d, p) \
47 (test_bit((p), &(d)->shared_info->evtchn_pending[0]))
49 /* Send a notification from a local event-channel port. */
50 extern long evtchn_send(unsigned int lport);
52 /* Bind a local event-channel port to the specified VCPU. */
53 extern long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id);
55 #endif /* __XEN_EVENT_H__ */