ia64/xen-unstable

view xen/include/asm-ia64/event.h @ 10099:3d3e5a3008f6

Check `global' property of the arch specific virqs.
Signed-off-by Kevin Tian <Kevin.tian@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu May 18 16:19:18 2006 +0100 (2006-05-18)
parents 4c8311699685
children 72c5d8206d48
line source
1 /******************************************************************************
2 * event.h
3 *
4 * A nice interface for passing asynchronous events to guest OSes.
5 * (architecture-dependent part)
6 *
7 */
9 #ifndef __ASM_EVENT_H__
10 #define __ASM_EVENT_H__
12 #include <public/arch-ia64.h>
13 #include <asm/vcpu.h>
15 static inline void evtchn_notify(struct vcpu *v)
16 {
17 /*
18 * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
19 * pending flag. These values may fluctuate (after all, we hold no
20 * locks) but the key insight is that each change will cause
21 * evtchn_upcall_pending to be polled.
22 *
23 * NB2. We save VCPUF_running across the unblock to avoid a needless
24 * IPI for domains that we IPI'd to unblock.
25 */
26 int running = test_bit(_VCPUF_running, &v->vcpu_flags);
27 vcpu_unblock(v);
28 if ( running )
29 smp_send_event_check_cpu(v->processor);
31 if(!VMX_DOMAIN(v))
32 vcpu_pend_interrupt(v, v->vcpu_info->arch.evtchn_vector);
33 }
35 /* Note: Bitwise operations result in fast code with no branches. */
36 #define event_pending(v) \
37 (!!(v)->vcpu_info->evtchn_upcall_pending & \
38 !(v)->vcpu_info->evtchn_upcall_mask)
40 static inline int arch_virq_is_global(int virq)
41 {
42 int rc;
44 switch ( virq )
45 {
46 case VIRQ_ITC:
47 rc = 0;
48 break;
49 default:
50 rc = 1;
51 break;
52 }
54 return rc;
55 }
57 #endif