direct-io.hg
changeset 10350:63967ff8d459
[XEN] Abstract setting of master event-pending flag into asm/event.h.
Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kfraser@dhcp93.uk.xensource.com |
---|---|
date | Wed Jun 14 13:48:04 2006 +0100 (2006-06-14) |
parents | 578e306b0bd4 |
children | ee482dc60eab |
files | xen/arch/x86/traps.c xen/common/event_channel.c xen/include/asm-ia64/event.h xen/include/asm-x86/event.h |
line diff
1.1 --- a/xen/arch/x86/traps.c Wed Jun 14 13:31:38 2006 +0100 1.2 +++ b/xen/arch/x86/traps.c Wed Jun 14 13:48:04 2006 +0100 1.3 @@ -1279,7 +1279,7 @@ asmlinkage int do_general_protection(str 1.4 static void nmi_softirq(void) 1.5 { 1.6 /* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */ 1.7 - evtchn_notify(dom0->vcpu[0]); 1.8 + vcpu_kick(dom0->vcpu[0]); 1.9 } 1.10 1.11 static void nmi_dom0_report(unsigned int reason_idx)
2.1 --- a/xen/common/event_channel.c Wed Jun 14 13:31:38 2006 +0100 2.2 +++ b/xen/common/event_channel.c Wed Jun 14 13:48:04 2006 +0100 2.3 @@ -493,10 +493,9 @@ void evtchn_set_pending(struct vcpu *v, 2.4 2.5 if ( !test_bit (port, s->evtchn_mask) && 2.6 !test_and_set_bit(port / BITS_PER_LONG, 2.7 - &v->vcpu_info->evtchn_pending_sel) && 2.8 - !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) ) 2.9 + &v->vcpu_info->evtchn_pending_sel) ) 2.10 { 2.11 - evtchn_notify(v); 2.12 + vcpu_mark_events_pending(v); 2.13 } 2.14 2.15 /* Check if some VCPU might be polling for this event. */ 2.16 @@ -682,10 +681,9 @@ static long evtchn_unmask(evtchn_unmask_ 2.17 if ( test_and_clear_bit(port, s->evtchn_mask) && 2.18 test_bit (port, s->evtchn_pending) && 2.19 !test_and_set_bit (port / BITS_PER_LONG, 2.20 - &v->vcpu_info->evtchn_pending_sel) && 2.21 - !test_and_set_bit (0, &v->vcpu_info->evtchn_upcall_pending) ) 2.22 + &v->vcpu_info->evtchn_pending_sel) ) 2.23 { 2.24 - evtchn_notify(v); 2.25 + vcpu_mark_events_pending(v); 2.26 } 2.27 2.28 spin_unlock(&d->evtchn_lock);
3.1 --- a/xen/include/asm-ia64/event.h Wed Jun 14 13:31:38 2006 +0100 3.2 +++ b/xen/include/asm-ia64/event.h Wed Jun 14 13:48:04 2006 +0100 3.3 @@ -12,7 +12,7 @@ 3.4 #include <public/arch-ia64.h> 3.5 #include <asm/vcpu.h> 3.6 3.7 -static inline void evtchn_notify(struct vcpu *v) 3.8 +static inline void vcpu_kick(struct vcpu *v) 3.9 { 3.10 /* 3.11 * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of 3.12 @@ -32,6 +32,12 @@ static inline void evtchn_notify(struct 3.13 vcpu_pend_interrupt(v, v->domain->shared_info->arch.evtchn_vector); 3.14 } 3.15 3.16 +static inline void vcpu_mark_events_pending(struct vcpu *v) 3.17 +{ 3.18 + if ( !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) ) 3.19 + vcpu_kick(v); 3.20 +} 3.21 + 3.22 /* Note: Bitwise operations result in fast code with no branches. */ 3.23 #define event_pending(v) \ 3.24 (!!(v)->vcpu_info->evtchn_upcall_pending & \
4.1 --- a/xen/include/asm-x86/event.h Wed Jun 14 13:31:38 2006 +0100 4.2 +++ b/xen/include/asm-x86/event.h Wed Jun 14 13:48:04 2006 +0100 4.3 @@ -9,7 +9,7 @@ 4.4 #ifndef __ASM_EVENT_H__ 4.5 #define __ASM_EVENT_H__ 4.6 4.7 -static inline void evtchn_notify(struct vcpu *v) 4.8 +static inline void vcpu_kick(struct vcpu *v) 4.9 { 4.10 /* 4.11 * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of 4.12 @@ -26,6 +26,12 @@ static inline void evtchn_notify(struct 4.13 smp_send_event_check_cpu(v->processor); 4.14 } 4.15 4.16 +static inline void vcpu_mark_events_pending(struct vcpu *v) 4.17 +{ 4.18 + if ( !test_and_set_bit(0, &v->vcpu_info->evtchn_upcall_pending) ) 4.19 + vcpu_kick(v); 4.20 +} 4.21 + 4.22 static inline int local_events_need_delivery(void) 4.23 { 4.24 struct vcpu *v = current;