diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2005-02-22 09:36:11 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2005-02-22 09:36:11 +0000 |
commit | 9c8f91343008a9358c3bc96aa9412f7a12a56834 (patch) | |
tree | c80bd2a6648d3c5e4796504358646151ba29a357 | |
parent | 7100bc4659a58189f885b87ff146a5d886738dab (diff) | |
download | xen-9c8f91343008a9358c3bc96aa9412f7a12a56834.tar.gz xen-9c8f91343008a9358c3bc96aa9412f7a12a56834.tar.bz2 xen-9c8f91343008a9358c3bc96aa9412f7a12a56834.zip |
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>
-rw-r--r-- | linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c index e5aa5a1b18..22885955c9 100644 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c @@ -92,42 +92,36 @@ void force_evtchn_callback(void) (void)HYPERVISOR_xen_version(0); } +/* NB. Interrupts are disabled on entry. */ asmlinkage void evtchn_do_upcall(struct pt_regs *regs) { unsigned long l1, l2; unsigned int l1i, l2i, port; int irq; - unsigned long flags; shared_info_t *s = HYPERVISOR_shared_info; - local_irq_save(flags); - - while ( s->vcpu_data[0].evtchn_upcall_pending ) + s->vcpu_data[0].evtchn_upcall_pending = 0; + + /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ + l1 = xchg(&s->evtchn_pending_sel, 0); + while ( l1 != 0 ) { - s->vcpu_data[0].evtchn_upcall_pending = 0; - /* NB. No need for a barrier here -- XCHG is a barrier on x86. */ - l1 = xchg(&s->evtchn_pending_sel, 0); - while ( (l1i = ffs(l1)) != 0 ) - { - l1i--; - l1 &= ~(1 << l1i); + l1i = __ffs(l1); + l1 &= ~(1 << l1i); - l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; - while ( (l2i = ffs(l2)) != 0 ) - { - l2i--; - l2 &= ~(1 << l2i); + l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; + while ( l2 != 0 ) + { + l2i = __ffs(l2); + l2 &= ~(1 << l2i); - port = (l1i << 5) + l2i; - if ( (irq = evtchn_to_irq[port]) != -1 ) - do_IRQ(irq, regs); - else - evtchn_device_upcall(port); - } + port = (l1i << 5) + l2i; + if ( (irq = evtchn_to_irq[port]) != -1 ) + do_IRQ(irq, regs); + else + evtchn_device_upcall(port); } } - - local_irq_restore(flags); } static int find_unbound_irq(void) |