direct-io.hg

changeset 4646:7317dcb7ef66

bitkeeper revision 1.1374 (426a2d13oNszAPe4DJtPXXT5G-vZVQ)

evtchn.c:
Fix freebsd lockup.
author kaf24@firebug.cl.cam.ac.uk
date Sat Apr 23 11:10:11 2005 +0000 (2005-04-23)
parents cc637433c0fd
children f9f8f250228f
files freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c
line diff
     1.1 --- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c	Sat Apr 23 11:04:40 2005 +0000
     1.2 +++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/evtchn.c	Sat Apr 23 11:10:11 2005 +0000
     1.3 @@ -54,7 +54,7 @@ evtchn_do_upcall(struct intrframe *frame
     1.4  {
     1.5      unsigned long  l1, l2;
     1.6      unsigned int   l1i, l2i, port;
     1.7 -    int            irq;
     1.8 +    int            irq, owned;
     1.9      unsigned long  flags;
    1.10      shared_info_t *s = HYPERVISOR_shared_info;
    1.11      vcpu_info_t   *vcpu_info = &s->vcpu_data[smp_processor_id()];
    1.12 @@ -78,12 +78,16 @@ evtchn_do_upcall(struct intrframe *frame
    1.13                  l2 &= ~(1 << l2i);
    1.14              
    1.15                  port = (l1i << 5) + l2i;
    1.16 +                if ( (owned = mtx_owned(&sched_lock)) != 0 )
    1.17 +                    mtx_unlock_spin_flags(&sched_lock, MTX_QUIET);
    1.18                  if ( (irq = evtchn_to_irq[port]) != -1 ) {
    1.19  		    struct intsrc *isrc = intr_lookup_source(irq);
    1.20  		    intr_execute_handlers(isrc, frame);
    1.21  		} else {
    1.22                      evtchn_device_upcall(port);
    1.23  		}
    1.24 +                if ( owned )
    1.25 +                    mtx_lock_spin_flags(&sched_lock, MTX_QUIET);                    
    1.26              }
    1.27          }
    1.28      }