ia64/xen-unstable

changeset 18800:2188ed106885

Remove NR_PIRQS definition -- always use NR_IRQS.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 14 14:33:25 2008 +0000 (2008-11-14)
parents 85198c4d4da5
children 17911073a90a
files xen/arch/x86/irq.c xen/drivers/passthrough/io.c xen/drivers/passthrough/pci.c xen/drivers/passthrough/vtd/x86/vtd.c xen/include/asm-ia64/hvm/irq.h xen/include/asm-x86/domain.h xen/include/asm-x86/hvm/irq.h xen/include/asm-x86/pirq.h xen/include/xen/hvm/irq.h
line diff
     1.1 --- a/xen/arch/x86/irq.c	Fri Nov 14 14:27:51 2008 +0000
     1.2 +++ b/xen/arch/x86/irq.c	Fri Nov 14 14:33:25 2008 +0000
     1.3 @@ -770,15 +770,15 @@ int get_free_pirq(struct domain *d, int 
     1.4  
     1.5      if ( type == MAP_PIRQ_TYPE_GSI )
     1.6      {
     1.7 -        for ( i = 16; i < NR_PIRQS; i++ )
     1.8 +        for ( i = 16; i < NR_IRQS; i++ )
     1.9              if ( !d->arch.pirq_vector[i] )
    1.10                  break;
    1.11 -        if ( i == NR_PIRQS )
    1.12 +        if ( i == NR_IRQS )
    1.13              return -ENOSPC;
    1.14      }
    1.15      else
    1.16      {
    1.17 -        for ( i = NR_PIRQS - 1; i >= 16; i-- )
    1.18 +        for ( i = NR_IRQS - 1; i >= 16; i-- )
    1.19              if ( !d->arch.pirq_vector[i] )
    1.20                  break;
    1.21          if ( i == 16 )
    1.22 @@ -805,7 +805,7 @@ int map_domain_pirq(
    1.23      if ( !IS_PRIV(current->domain) )
    1.24          return -EPERM;
    1.25  
    1.26 -    if ( pirq < 0 || pirq >= NR_PIRQS || vector < 0 || vector >= NR_VECTORS )
    1.27 +    if ( pirq < 0 || pirq >= NR_IRQS || vector < 0 || vector >= NR_VECTORS )
    1.28      {
    1.29          dprintk(XENLOG_G_ERR, "dom%d: invalid pirq %d or vector %d\n",
    1.30                  d->domain_id, pirq, vector);
    1.31 @@ -862,7 +862,7 @@ int unmap_domain_pirq(struct domain *d, 
    1.32      int vector, ret = 0;
    1.33      bool_t forced_unbind;
    1.34  
    1.35 -    if ( (pirq < 0) || (pirq >= NR_PIRQS) )
    1.36 +    if ( (pirq < 0) || (pirq >= NR_IRQS) )
    1.37          return -EINVAL;
    1.38  
    1.39      if ( !IS_PRIV(current->domain) )
    1.40 @@ -926,7 +926,7 @@ void free_domain_pirqs(struct domain *d)
    1.41  
    1.42      spin_lock(&d->event_lock);
    1.43  
    1.44 -    for ( i = 0; i < NR_PIRQS; i++ )
    1.45 +    for ( i = 0; i < NR_IRQS; i++ )
    1.46          if ( d->arch.pirq_vector[i] > 0 )
    1.47              unmap_domain_pirq(d, i);
    1.48  
     2.1 --- a/xen/drivers/passthrough/io.c	Fri Nov 14 14:27:51 2008 +0000
     2.2 +++ b/xen/drivers/passthrough/io.c	Fri Nov 14 14:33:25 2008 +0000
     2.3 @@ -62,7 +62,7 @@ int pt_irq_create_bind_vtd(
     2.4      struct dev_intx_gsi_link *digl;
     2.5      int pirq = pt_irq_bind->machine_irq;
     2.6  
     2.7 -    if ( pirq < 0 || pirq >= NR_PIRQS )
     2.8 +    if ( pirq < 0 || pirq >= NR_IRQS )
     2.9          return -EINVAL;
    2.10  
    2.11      spin_lock(&d->event_lock);
    2.12 @@ -261,7 +261,7 @@ void hvm_dpci_msi_eoi(struct domain *d, 
    2.13      spin_lock(&d->event_lock);
    2.14      pirq = hvm_irq_dpci->msi_gvec_pirq[vector];
    2.15  
    2.16 -    if ( ( pirq >= 0 ) && (pirq < NR_PIRQS) &&
    2.17 +    if ( ( pirq >= 0 ) && (pirq < NR_IRQS) &&
    2.18            test_bit(pirq, hvm_irq_dpci->mapping) &&
    2.19           (test_bit(_HVM_IRQ_DPCI_MSI, &hvm_irq_dpci->mirq[pirq].flags)))
    2.20       {
     3.1 --- a/xen/drivers/passthrough/pci.c	Fri Nov 14 14:27:51 2008 +0000
     3.2 +++ b/xen/drivers/passthrough/pci.c	Fri Nov 14 14:33:25 2008 +0000
     3.3 @@ -171,9 +171,9 @@ static void pci_clean_dpci_irqs(struct d
     3.4      hvm_irq_dpci = domain_get_irq_dpci(d);
     3.5      if ( hvm_irq_dpci != NULL )
     3.6      {
     3.7 -        for ( i = find_first_bit(hvm_irq_dpci->mapping, NR_PIRQS);
     3.8 -              i < NR_PIRQS;
     3.9 -              i = find_next_bit(hvm_irq_dpci->mapping, NR_PIRQS, i + 1) )
    3.10 +        for ( i = find_first_bit(hvm_irq_dpci->mapping, NR_IRQS);
    3.11 +              i < NR_IRQS;
    3.12 +              i = find_next_bit(hvm_irq_dpci->mapping, NR_IRQS, i + 1) )
    3.13          {
    3.14              pirq_guest_unbind(d, i);
    3.15              kill_timer(&hvm_irq_dpci->hvm_timer[irq_to_vector(i)]);
     4.1 --- a/xen/drivers/passthrough/vtd/x86/vtd.c	Fri Nov 14 14:27:51 2008 +0000
     4.2 +++ b/xen/drivers/passthrough/vtd/x86/vtd.c	Fri Nov 14 14:33:25 2008 +0000
     4.3 @@ -121,9 +121,9 @@ void hvm_dpci_isairq_eoi(struct domain *
     4.4          return;
     4.5      }
     4.6      /* Multiple mirq may be mapped to one isa irq */
     4.7 -    for ( i = find_first_bit(dpci->mapping, NR_PIRQS);
     4.8 -          i < NR_PIRQS;
     4.9 -          i = find_next_bit(dpci->mapping, NR_PIRQS, i + 1) )
    4.10 +    for ( i = find_first_bit(dpci->mapping, NR_IRQS);
    4.11 +          i < NR_IRQS;
    4.12 +          i = find_next_bit(dpci->mapping, NR_IRQS, i + 1) )
    4.13      {
    4.14          list_for_each_entry_safe ( digl, tmp,
    4.15              &dpci->mirq[i].digl_list, list )
     5.1 --- a/xen/include/asm-ia64/hvm/irq.h	Fri Nov 14 14:27:51 2008 +0000
     5.2 +++ b/xen/include/asm-ia64/hvm/irq.h	Fri Nov 14 14:33:25 2008 +0000
     5.3 @@ -26,7 +26,6 @@
     5.4  
     5.5  #define NR_VECTORS 256
     5.6  #define VIOAPIC_NUM_PINS  48
     5.7 -#define NR_PIRQS   256
     5.8  
     5.9  #include <xen/hvm/irq.h>
    5.10  
     6.1 --- a/xen/include/asm-x86/domain.h	Fri Nov 14 14:27:51 2008 +0000
     6.2 +++ b/xen/include/asm-x86/domain.h	Fri Nov 14 14:33:25 2008 +0000
     6.3 @@ -6,7 +6,6 @@
     6.4  #include <asm/hvm/vcpu.h>
     6.5  #include <asm/hvm/domain.h>
     6.6  #include <asm/e820.h>
     6.7 -#include <asm/pirq.h>
     6.8  
     6.9  #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
    6.10  #define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
    6.11 @@ -237,7 +236,7 @@ struct arch_domain
    6.12  
    6.13      /* NB. protected by d->event_lock and by irq_desc[vector].lock */
    6.14      int vector_pirq[NR_VECTORS];
    6.15 -    int pirq_vector[NR_PIRQS];
    6.16 +    int pirq_vector[NR_IRQS];
    6.17  
    6.18      /* Pseudophysical e820 map (XENMEM_memory_map).  */
    6.19      struct e820entry e820[3];
     7.1 --- a/xen/include/asm-x86/hvm/irq.h	Fri Nov 14 14:27:51 2008 +0000
     7.2 +++ b/xen/include/asm-x86/hvm/irq.h	Fri Nov 14 14:33:25 2008 +0000
     7.3 @@ -22,7 +22,6 @@
     7.4  #ifndef __ASM_X86_HVM_IRQ_H__
     7.5  #define __ASM_X86_HVM_IRQ_H__
     7.6  
     7.7 -#include <asm/pirq.h>
     7.8  #include <xen/hvm/irq.h>
     7.9  #include <asm/hvm/hvm.h>
    7.10  #include <asm/hvm/vpic.h>
     8.1 --- a/xen/include/asm-x86/pirq.h	Fri Nov 14 14:27:51 2008 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,11 +0,0 @@
     8.4 -#ifndef __XEN_PIRQ_H
     8.5 -#define __XEN_PIRQ_H
     8.6 -
     8.7 -#define PIRQ_BASE       0
     8.8 -#define NR_PIRQS        256
     8.9 -
    8.10 -#define DYNIRQ_BASE     (PIRQ_BASE + NR_PIRQS)
    8.11 -#define NR_DYNIRQS      256
    8.12 -
    8.13 -#endif /* __XEN_PIRQ_H */
    8.14 -
     9.1 --- a/xen/include/xen/hvm/irq.h	Fri Nov 14 14:27:51 2008 +0000
     9.2 +++ b/xen/include/xen/hvm/irq.h	Fri Nov 14 14:33:25 2008 +0000
     9.3 @@ -63,7 +63,7 @@ struct hvm_girq_dpci_mapping {
     9.4  /* Protected by domain's event_lock */
     9.5  struct hvm_irq_dpci {
     9.6      /* Machine IRQ to guest device/intx mapping. */
     9.7 -    DECLARE_BITMAP(mapping, NR_PIRQS);
     9.8 +    DECLARE_BITMAP(mapping, NR_IRQS);
     9.9      struct hvm_mirq_dpci_mapping mirq[NR_IRQS];
    9.10      /* Guest IRQ to guest device/intx mapping. */
    9.11      struct hvm_girq_dpci_mapping girq[NR_IRQS];