ia64/xen-unstable

changeset 9897:0ee104bd6557

Remove definition of NR_PIRQS and replace all uses with
NR_IRQS. Allows removal of redundant check in pirq_guest_bind().

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Apr 30 09:26:01 2006 +0100 (2006-04-30)
parents 42a8e3101c6c
children 369bdfa1e04a
files xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/irq.c xen/arch/x86/domain_build.c xen/arch/x86/i8259.c xen/arch/x86/irq.c xen/arch/x86/x86_32/traps.c xen/common/dom0_ops.c xen/include/asm-x86/irq.h xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Sun Apr 30 09:16:15 2006 +0100
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Sun Apr 30 09:26:01 2006 +0100
     1.3 @@ -1237,7 +1237,7 @@ static void physdev_init_dom0(struct dom
     1.4  {
     1.5  	if (iomem_permit_access(d, 0UL, ~0UL))
     1.6  		BUG();
     1.7 -	if (irqs_permit_access(d, 0, NR_PIRQS-1))
     1.8 +	if (irqs_permit_access(d, 0, NR_IRQS-1))
     1.9  		BUG();
    1.10  }
    1.11  
     2.1 --- a/xen/arch/ia64/xen/irq.c	Sun Apr 30 09:16:15 2006 +0100
     2.2 +++ b/xen/arch/ia64/xen/irq.c	Sun Apr 30 09:26:01 2006 +0100
     2.3 @@ -435,9 +435,9 @@ int pirq_guest_unmask(struct domain *d)
     2.4      int            irq;
     2.5      shared_info_t *s = d->shared_info;
     2.6  
     2.7 -    for ( irq = find_first_bit(d->pirq_mask, NR_PIRQS);
     2.8 -          irq < NR_PIRQS;
     2.9 -          irq = find_next_bit(d->pirq_mask, NR_PIRQS, irq+1) )
    2.10 +    for ( irq = find_first_bit(d->pirq_mask, NR_IRQS);
    2.11 +          irq < NR_IRQS;
    2.12 +          irq = find_next_bit(d->pirq_mask, NR_IRQS, irq+1) )
    2.13      {
    2.14          desc = &irq_desc[irq];
    2.15          spin_lock_irq(&desc->lock);
     3.1 --- a/xen/arch/x86/domain_build.c	Sun Apr 30 09:16:15 2006 +0100
     3.2 +++ b/xen/arch/x86/domain_build.c	Sun Apr 30 09:26:01 2006 +0100
     3.3 @@ -809,7 +809,7 @@ int construct_dom0(struct domain *d,
     3.4      /* DOM0 is permitted full I/O capabilities. */
     3.5      rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     3.6      rc |= iomem_permit_access(dom0, 0UL, ~0UL);
     3.7 -    rc |= irqs_permit_access(dom0, 0, NR_PIRQS-1);
     3.8 +    rc |= irqs_permit_access(dom0, 0, NR_IRQS-1);
     3.9  
    3.10      /*
    3.11       * Modify I/O port access permissions.
     4.1 --- a/xen/arch/x86/i8259.c	Sun Apr 30 09:16:15 2006 +0100
     4.2 +++ b/xen/arch/x86/i8259.c	Sun Apr 30 09:26:01 2006 +0100
     4.3 @@ -19,6 +19,7 @@
     4.4  #include <asm/bitops.h>
     4.5  #include <xen/delay.h>
     4.6  #include <asm/apic.h>
     4.7 +#include <asm/asm_defns.h>
     4.8  #include <io_ports.h>
     4.9  
    4.10  /*
     5.1 --- a/xen/arch/x86/irq.c	Sun Apr 30 09:16:15 2006 +0100
     5.2 +++ b/xen/arch/x86/irq.c	Sun Apr 30 09:26:01 2006 +0100
     5.3 @@ -356,9 +356,9 @@ int pirq_guest_unmask(struct domain *d)
     5.4      unsigned int   irq;
     5.5      shared_info_t *s = d->shared_info;
     5.6  
     5.7 -    for ( irq = find_first_bit(d->pirq_mask, NR_PIRQS);
     5.8 -          irq < NR_PIRQS;
     5.9 -          irq = find_next_bit(d->pirq_mask, NR_PIRQS, irq+1) )
    5.10 +    for ( irq = find_first_bit(d->pirq_mask, NR_IRQS);
    5.11 +          irq < NR_IRQS;
    5.12 +          irq = find_next_bit(d->pirq_mask, NR_IRQS, irq+1) )
    5.13      {
    5.14          if ( !test_bit(d->pirq_to_evtchn[irq], s->evtchn_mask) )
    5.15              __pirq_guest_eoi(d, irq);
    5.16 @@ -410,9 +410,6 @@ int pirq_guest_bind(struct vcpu *v, int 
    5.17      int                 rc = 0;
    5.18      cpumask_t           cpumask = CPU_MASK_NONE;
    5.19  
    5.20 -    if ( (irq < 0) || (irq >= NR_IRQS) )
    5.21 -        return -EINVAL;
    5.22 -
    5.23   retry:
    5.24      vector = irq_to_vector(irq);
    5.25      if ( vector == 0 )
     6.1 --- a/xen/arch/x86/x86_32/traps.c	Sun Apr 30 09:16:15 2006 +0100
     6.2 +++ b/xen/arch/x86/x86_32/traps.c	Sun Apr 30 09:26:01 2006 +0100
     6.3 @@ -243,6 +243,7 @@ unsigned long do_iret(void)
     6.4      return regs->eax;
     6.5  }
     6.6  
     6.7 +#include <asm/asm_defns.h>
     6.8  BUILD_SMP_INTERRUPT(deferred_nmi, TRAP_deferred_nmi)
     6.9  fastcall void smp_deferred_nmi(struct cpu_user_regs *regs)
    6.10  {
     7.1 --- a/xen/common/dom0_ops.c	Sun Apr 30 09:16:15 2006 +0100
     7.2 +++ b/xen/common/dom0_ops.c	Sun Apr 30 09:26:01 2006 +0100
     7.3 @@ -641,7 +641,7 @@ long do_dom0_op(XEN_GUEST_HANDLE(dom0_op
     7.4          unsigned int pirq = op->u.irq_permission.pirq;
     7.5  
     7.6          ret = -EINVAL;
     7.7 -        if ( pirq >= NR_PIRQS )
     7.8 +        if ( pirq >= NR_IRQS )
     7.9              break;
    7.10  
    7.11          ret = -ESRCH;
     8.1 --- a/xen/include/asm-x86/irq.h	Sun Apr 30 09:16:15 2006 +0100
     8.2 +++ b/xen/include/asm-x86/irq.h	Sun Apr 30 09:26:01 2006 +0100
     8.3 @@ -5,7 +5,6 @@
     8.4  
     8.5  #include <xen/config.h>
     8.6  #include <asm/atomic.h>
     8.7 -#include <asm/asm_defns.h>
     8.8  #include <irq_vectors.h>
     8.9  
    8.10  #define IO_APIC_IRQ(irq)    (((irq) >= 16) || ((1<<(irq)) & io_apic_irqs))
     9.1 --- a/xen/include/xen/sched.h	Sun Apr 30 09:16:15 2006 +0100
     9.2 +++ b/xen/include/xen/sched.h	Sun Apr 30 09:26:01 2006 +0100
     9.3 @@ -15,6 +15,7 @@
     9.4  #include <xen/rangeset.h>
     9.5  #include <asm/domain.h>
     9.6  #include <xen/xenoprof.h>
     9.7 +#include <xen/irq.h>
     9.8  
     9.9  extern unsigned long volatile jiffies;
    9.10  extern rwlock_t domlist_lock;
    9.11 @@ -132,9 +133,8 @@ struct domain
    9.12       * domain's event-channel spinlock. Read accesses can also synchronise on 
    9.13       * the lock, but races don't usually matter.
    9.14       */
    9.15 -#define NR_PIRQS 256 /* Put this somewhere sane! */
    9.16 -    u16              pirq_to_evtchn[NR_PIRQS];
    9.17 -    DECLARE_BITMAP(pirq_mask, NR_PIRQS);
    9.18 +    u16              pirq_to_evtchn[NR_IRQS];
    9.19 +    DECLARE_BITMAP(pirq_mask, NR_IRQS);
    9.20  
    9.21      /* I/O capabilities (access to IRQs and memory-mapped I/O). */
    9.22      struct rangeset *iomem_caps;