ia64/xen-unstable
changeset 3888:606f04db7033
bitkeeper revision 1.1159.258.7 (421afd0bk-TdZ_Jc5UrN-eVwJPdgbw)
Remove unnecessary irq enable/disable and flag test from do_upcall().
Signed-off-by: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Remove unnecessary irq enable/disable and flag test from do_upcall().
Signed-off-by: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Tue Feb 22 09:36:11 2005 +0000 (2005-02-22) |
parents | 73c3313f21d3 |
children | 6184c07ee434 edd47d0137fa |
files | linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c |
line diff
1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c Mon Feb 21 19:13:13 2005 +0000 1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c Tue Feb 22 09:36:11 2005 +0000 1.3 @@ -92,42 +92,36 @@ void force_evtchn_callback(void) 1.4 (void)HYPERVISOR_xen_version(0); 1.5 } 1.6 1.7 +/* NB. Interrupts are disabled on entry. */ 1.8 asmlinkage void evtchn_do_upcall(struct pt_regs *regs) 1.9 { 1.10 unsigned long l1, l2; 1.11 unsigned int l1i, l2i, port; 1.12 int irq; 1.13 - unsigned long flags; 1.14 shared_info_t *s = HYPERVISOR_shared_info; 1.15 1.16 - local_irq_save(flags); 1.17 - 1.18 - while ( s->vcpu_data[0].evtchn_upcall_pending ) 1.19 + s->vcpu_data[0].evtchn_upcall_pending = 0; 1.20 + 1.21 + /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ 1.22 + l1 = xchg(&s->evtchn_pending_sel, 0); 1.23 + while ( l1 != 0 ) 1.24 { 1.25 - s->vcpu_data[0].evtchn_upcall_pending = 0; 1.26 - /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ 1.27 - l1 = xchg(&s->evtchn_pending_sel, 0); 1.28 - while ( (l1i = ffs(l1)) != 0 ) 1.29 - { 1.30 - l1i--; 1.31 - l1 &= ~(1 << l1i); 1.32 + l1i = __ffs(l1); 1.33 + l1 &= ~(1 << l1i); 1.34 1.35 - l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; 1.36 - while ( (l2i = ffs(l2)) != 0 ) 1.37 - { 1.38 - l2i--; 1.39 - l2 &= ~(1 << l2i); 1.40 + l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; 1.41 + while ( l2 != 0 ) 1.42 + { 1.43 + l2i = __ffs(l2); 1.44 + l2 &= ~(1 << l2i); 1.45 1.46 - port = (l1i << 5) + l2i; 1.47 - if ( (irq = evtchn_to_irq[port]) != -1 ) 1.48 - do_IRQ(irq, regs); 1.49 - else 1.50 - evtchn_device_upcall(port); 1.51 - } 1.52 + port = (l1i << 5) + l2i; 1.53 + if ( (irq = evtchn_to_irq[port]) != -1 ) 1.54 + do_IRQ(irq, regs); 1.55 + else 1.56 + evtchn_device_upcall(port); 1.57 } 1.58 } 1.59 - 1.60 - local_irq_restore(flags); 1.61 } 1.62 1.63 static int find_unbound_irq(void)