ia64/xen-unstable

changeset 2242:caf120933dc8

bitkeeper revision 1.1159.1.64 (41206d44aLwz5oslqPWoV3gXftNh_A)

Fix PIRQ virtualisation for IRQS 64 to 127.
author kaf24@scramble.cl.cam.ac.uk
date Mon Aug 16 08:16:04 2004 +0000 (2004-08-16)
parents d23ce975d922
children c3e3a082384f f36e0e397466
files xen/arch/x86/irq.c
line diff
     1.1 --- a/xen/arch/x86/irq.c	Sat Aug 14 17:29:51 2004 +0000
     1.2 +++ b/xen/arch/x86/irq.c	Mon Aug 16 08:16:04 2004 +0000
     1.3 @@ -195,36 +195,36 @@ static void __do_IRQ_guest(int irq)
     1.4  {
     1.5      irq_desc_t         *desc = &irq_desc[irq];
     1.6      irq_guest_action_t *action = (irq_guest_action_t *)desc->action;
     1.7 -    struct domain *p;
     1.8 +    struct domain      *d;
     1.9      int                 i;
    1.10  
    1.11      for ( i = 0; i < action->nr_guests; i++ )
    1.12      {
    1.13 -        p = action->guest[i];
    1.14 -        if ( !test_and_set_bit(irq, &p->pirq_mask) )
    1.15 +        d = action->guest[i];
    1.16 +        if ( !test_and_set_bit(irq, &d->pirq_mask) )
    1.17              action->in_flight++;
    1.18 -        send_guest_pirq(p, irq);
    1.19 +        send_guest_pirq(d, irq);
    1.20      }
    1.21  }
    1.22  
    1.23 -int pirq_guest_unmask(struct domain *p)
    1.24 +int pirq_guest_unmask(struct domain *d)
    1.25  {
    1.26      irq_desc_t    *desc;
    1.27      int            i, j, pirq;
    1.28      u32            m;
    1.29 -    shared_info_t *s = p->shared_info;
    1.30 +    shared_info_t *s = d->shared_info;
    1.31  
    1.32 -    for ( i = 0; i < 2; i++ )
    1.33 +    for ( i = 0; i < ARRAY_SIZE(d->pirq_mask); i++ )
    1.34      {
    1.35 -        m = p->pirq_mask[i];
    1.36 +        m = d->pirq_mask[i];
    1.37          while ( (j = ffs(m)) != 0 )
    1.38          {
    1.39              m &= ~(1 << --j);
    1.40              pirq = (i << 5) + j;
    1.41              desc = &irq_desc[pirq];
    1.42              spin_lock_irq(&desc->lock);
    1.43 -            if ( !test_bit(p->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
    1.44 -                 test_and_clear_bit(pirq, &p->pirq_mask) &&
    1.45 +            if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
    1.46 +                 test_and_clear_bit(pirq, &d->pirq_mask) &&
    1.47                   (--((irq_guest_action_t *)desc->action)->in_flight == 0) )
    1.48                  desc->handler->end(pirq);
    1.49              spin_unlock_irq(&desc->lock);
    1.50 @@ -234,14 +234,14 @@ int pirq_guest_unmask(struct domain *p)
    1.51      return 0;
    1.52  }
    1.53  
    1.54 -int pirq_guest_bind(struct domain *p, int irq, int will_share)
    1.55 +int pirq_guest_bind(struct domain *d, int irq, int will_share)
    1.56  {
    1.57      irq_desc_t         *desc = &irq_desc[irq];
    1.58      irq_guest_action_t *action;
    1.59      unsigned long       flags;
    1.60      int                 rc = 0;
    1.61  
    1.62 -    if ( !IS_CAPABLE_PHYSDEV(p) )
    1.63 +    if ( !IS_CAPABLE_PHYSDEV(d) )
    1.64          return -EPERM;
    1.65  
    1.66      spin_lock_irqsave(&desc->lock, flags);
    1.67 @@ -278,7 +278,7 @@ int pirq_guest_bind(struct domain *p, in
    1.68          /* Attempt to bind the interrupt target to the correct CPU. */
    1.69          if ( desc->handler->set_affinity != NULL )
    1.70              desc->handler->set_affinity(
    1.71 -                irq, apicid_to_phys_cpu_present(p->processor));
    1.72 +                irq, apicid_to_phys_cpu_present(d->processor));
    1.73      }
    1.74      else if ( !will_share || !action->shareable )
    1.75      {
    1.76 @@ -295,14 +295,14 @@ int pirq_guest_bind(struct domain *p, in
    1.77          goto out;
    1.78      }
    1.79  
    1.80 -    action->guest[action->nr_guests++] = p;
    1.81 +    action->guest[action->nr_guests++] = d;
    1.82  
    1.83   out:
    1.84      spin_unlock_irqrestore(&desc->lock, flags);
    1.85      return rc;
    1.86  }
    1.87  
    1.88 -int pirq_guest_unbind(struct domain *p, int irq)
    1.89 +int pirq_guest_unbind(struct domain *d, int irq)
    1.90  {
    1.91      irq_desc_t         *desc = &irq_desc[irq];
    1.92      irq_guest_action_t *action;
    1.93 @@ -313,7 +313,7 @@ int pirq_guest_unbind(struct domain *p, 
    1.94  
    1.95      action = (irq_guest_action_t *)desc->action;
    1.96  
    1.97 -    if ( test_and_clear_bit(irq, &p->pirq_mask) &&
    1.98 +    if ( test_and_clear_bit(irq, &d->pirq_mask) &&
    1.99           (--action->in_flight == 0) )
   1.100          desc->handler->end(irq);
   1.101  
   1.102 @@ -329,7 +329,7 @@ int pirq_guest_unbind(struct domain *p, 
   1.103      else
   1.104      {
   1.105          i = 0;
   1.106 -        while ( action->guest[i] != p )
   1.107 +        while ( action->guest[i] != d )
   1.108              i++;
   1.109          memmove(&action->guest[i], &action->guest[i+1], IRQ_MAX_GUESTS-i-1);
   1.110          action->nr_guests--;