direct-io.hg

view xen/include/asm-ia64/event.h @ 10320:5b1bd9eab3b9

[IA64] Fix a typo in local_event_delivery_enable().
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Jun 12 08:53:38 2006 +0100 (2006-06-12)
parents ddc25d4ebf60
children 63967ff8d459
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) && !v->arch.event_callback_ip)
32 vcpu_pend_interrupt(v, v->domain->shared_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 local_events_need_delivery(void)
41 {
42 return event_pending(current);
43 }
45 static inline int local_event_delivery_is_enabled(void)
46 {
47 return !current->vcpu_info->evtchn_upcall_mask;
48 }
50 static inline void local_event_delivery_disable(void)
51 {
52 current->vcpu_info->evtchn_upcall_mask = 1;
53 }
55 static inline void local_event_delivery_enable(void)
56 {
57 current->vcpu_info->evtchn_upcall_mask = 0;
58 }
60 static inline int arch_virq_is_global(int virq)
61 {
62 int rc;
64 switch ( virq )
65 {
66 case VIRQ_ITC:
67 rc = 0;
68 break;
69 default:
70 rc = 1;
71 break;
72 }
74 return rc;
75 }
77 #endif