[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86: Change nr_irqs to nr_irqs_gsi.
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1250682758 -3600 # Node ID 1afd9142eed3f112c76d73818fed717837191caa # Parent 8b0f1f37e145ad9680e1363290da8e4349a51a00 x86: Change nr_irqs to nr_irqs_gsi. Currently, nr_irqs is only used for GSI irqs, change the name to make its meaning more precise. And, also this is the initial step to support irq allocation for MSI interrupt source. Signed-off-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx> --- xen/arch/x86/i8259.c | 4 ++-- xen/arch/x86/io_apic.c | 36 ++++++++++++++++++------------------ xen/arch/x86/irq.c | 8 ++++---- xen/arch/x86/physdev.c | 4 ++-- xen/common/domain.c | 4 ++-- xen/include/xen/irq.h | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) diff -r 8b0f1f37e145 -r 1afd9142eed3 xen/arch/x86/i8259.c --- a/xen/arch/x86/i8259.c Sun Aug 16 08:46:08 2009 +0100 +++ b/xen/arch/x86/i8259.c Wed Aug 19 12:52:38 2009 +0100 @@ -403,8 +403,8 @@ void __init init_IRQ(void) set_intr_gate(i, interrupt[i]); } - irq_vector = xmalloc_array(u8, nr_irqs); - memset(irq_vector, 0, nr_irqs * sizeof(*irq_vector)); + irq_vector = xmalloc_array(u8, nr_irqs_gsi); + memset(irq_vector, 0, nr_irqs_gsi * sizeof(*irq_vector)); for ( i = 0; i < 16; i++ ) { diff -r 8b0f1f37e145 -r 1afd9142eed3 xen/arch/x86/io_apic.c --- a/xen/arch/x86/io_apic.c Sun Aug 16 08:46:08 2009 +0100 +++ b/xen/arch/x86/io_apic.c Wed Aug 19 12:52:38 2009 +0100 @@ -71,8 +71,8 @@ int disable_timer_pin_1 __initdata; * Rough estimation of how many shared IRQs there are, can * be changed anytime. */ -#define MAX_PLUS_SHARED_IRQS nr_irqs -#define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + nr_irqs) +#define MAX_PLUS_SHARED_IRQS nr_irqs_gsi +#define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + nr_irqs_gsi) /* * This is performance-critical, we want to do it O(1) @@ -741,7 +741,7 @@ static void __init setup_IO_APIC_irqs(vo vector = assign_irq_vector(irq); entry.vector = vector; ioapic_register_intr(irq, vector, IOAPIC_AUTO); - + if (!apic && (irq < 16)) disable_8259A_irq(irq); } @@ -928,7 +928,7 @@ void /*__init*/ __print_IO_APIC(void) } printk(KERN_INFO "Using vector-based indexing\n"); printk(KERN_DEBUG "IRQ to pin mappings:\n"); - for (i = 0; i < nr_irqs; i++) { + for (i = 0; i < nr_irqs_gsi; i++) { struct irq_pin_list *entry = irq_2_pin + i; if (entry->pin < 0) continue; @@ -971,10 +971,10 @@ static void __init enable_IO_APIC(void) /* Initialise dynamic irq_2_pin free list. */ irq_2_pin = xmalloc_array(struct irq_pin_list, PIN_MAP_SIZE); - memset(irq_2_pin, 0, nr_irqs * sizeof(*irq_2_pin)); + memset(irq_2_pin, 0, nr_irqs_gsi * sizeof(*irq_2_pin)); for (i = 0; i < PIN_MAP_SIZE; i++) irq_2_pin[i].pin = -1; - for (i = irq_2_pin_free_entry = nr_irqs; i < PIN_MAP_SIZE; i++) + for (i = irq_2_pin_free_entry = nr_irqs_gsi; i < PIN_MAP_SIZE; i++) irq_2_pin[i].next = i + 1; for(apic = 0; apic < nr_ioapics; apic++) { @@ -2172,7 +2172,7 @@ void dump_ioapic_irq_info(void) unsigned int irq, pin, printed = 0; unsigned long flags; - for ( irq = 0; irq < nr_irqs; irq++ ) + for ( irq = 0; irq < nr_irqs_gsi; irq++ ) { entry = &irq_2_pin[irq]; if ( entry->pin == -1 ) @@ -2216,7 +2216,7 @@ void __init init_ioapic_mappings(void) union IO_APIC_reg_01 reg_01; if ( smp_found_config ) - nr_irqs = 0; + nr_irqs_gsi = 0; for ( i = 0; i < nr_ioapics; i++ ) { if ( smp_found_config ) @@ -2247,16 +2247,16 @@ void __init init_ioapic_mappings(void) /* The number of IO-APIC IRQ registers (== #pins): */ reg_01.raw = io_apic_read(i, 1); nr_ioapic_registers[i] = reg_01.bits.entries + 1; - nr_irqs += nr_ioapic_registers[i]; - } - } - if ( !smp_found_config || skip_ioapic_setup || nr_irqs < 16 ) - nr_irqs = 16; - else if ( nr_irqs > PAGE_SIZE * 8 ) + nr_irqs_gsi += nr_ioapic_registers[i]; + } + } + if ( !smp_found_config || skip_ioapic_setup || nr_irqs_gsi < 16 ) + nr_irqs_gsi = 16; + else if ( nr_irqs_gsi > PAGE_SIZE * 8 ) { /* for PHYSDEVOP_pirq_eoi_gmfn guest assumptions */ printk(KERN_WARNING "Limiting number of IRQs found (%u) to %lu\n", - nr_irqs, PAGE_SIZE * 8); - nr_irqs = PAGE_SIZE * 8; - } -} + nr_irqs_gsi, PAGE_SIZE * 8); + nr_irqs_gsi = PAGE_SIZE * 8; + } +} diff -r 8b0f1f37e145 -r 1afd9142eed3 xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c Sun Aug 16 08:46:08 2009 +0100 +++ b/xen/arch/x86/irq.c Wed Aug 19 12:52:38 2009 +0100 @@ -26,7 +26,7 @@ int opt_noirqbalance = 0; int opt_noirqbalance = 0; boolean_param("noirqbalance", opt_noirqbalance); -unsigned int __read_mostly nr_irqs = 16; +unsigned int __read_mostly nr_irqs_gsi = 16; irq_desc_t irq_desc[NR_VECTORS]; static DEFINE_SPINLOCK(vector_lock); @@ -80,7 +80,7 @@ int assign_irq_vector(int irq) static unsigned current_vector = FIRST_DYNAMIC_VECTOR; unsigned vector; - BUG_ON(irq >= nr_irqs && irq != AUTO_ASSIGN_IRQ); + BUG_ON(irq >= nr_irqs_gsi && irq != AUTO_ASSIGN_IRQ); spin_lock(&vector_lock); @@ -886,10 +886,10 @@ int get_free_pirq(struct domain *d, int if ( type == MAP_PIRQ_TYPE_GSI ) { - for ( i = 16; i < nr_irqs; i++ ) + for ( i = 16; i < nr_irqs_gsi; i++ ) if ( !d->arch.pirq_vector[i] ) break; - if ( i == nr_irqs ) + if ( i == nr_irqs_gsi ) return -ENOSPC; } else diff -r 8b0f1f37e145 -r 1afd9142eed3 xen/arch/x86/physdev.c --- a/xen/arch/x86/physdev.c Sun Aug 16 08:46:08 2009 +0100 +++ b/xen/arch/x86/physdev.c Wed Aug 19 12:52:38 2009 +0100 @@ -55,7 +55,7 @@ static int physdev_map_pirq(struct physd switch ( map->type ) { case MAP_PIRQ_TYPE_GSI: - if ( map->index < 0 || map->index >= nr_irqs ) + if ( map->index < 0 || map->index >= nr_irqs_gsi ) { dprintk(XENLOG_G_ERR, "dom%d: map invalid irq %d\n", d->domain_id, map->index); @@ -344,7 +344,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H irq = irq_op.irq; ret = -EINVAL; - if ( (irq < 0) || (irq >= nr_irqs) ) + if ( (irq < 0) || (irq >= nr_irqs_gsi) ) break; irq_op.vector = assign_irq_vector(irq); diff -r 8b0f1f37e145 -r 1afd9142eed3 xen/common/domain.c --- a/xen/common/domain.c Sun Aug 16 08:46:08 2009 +0100 +++ b/xen/common/domain.c Wed Aug 19 12:52:38 2009 +0100 @@ -253,9 +253,9 @@ struct domain *domain_create( d->is_paused_by_controller = 1; atomic_inc(&d->pause_count); - d->nr_pirqs = (nr_irqs + + d->nr_pirqs = (nr_irqs_gsi + (domid ? extra_domU_irqs : - extra_dom0_irqs ?: nr_irqs)); + extra_dom0_irqs ?: nr_irqs_gsi)); d->pirq_to_evtchn = xmalloc_array(u16, d->nr_pirqs); d->pirq_mask = xmalloc_array( unsigned long, BITS_TO_LONGS(d->nr_pirqs)); diff -r 8b0f1f37e145 -r 1afd9142eed3 xen/include/xen/irq.h --- a/xen/include/xen/irq.h Sun Aug 16 08:46:08 2009 +0100 +++ b/xen/include/xen/irq.h Wed Aug 19 12:52:38 2009 +0100 @@ -50,9 +50,9 @@ typedef struct hw_interrupt_type hw_irq_ #include <asm/irq.h> #ifdef NR_IRQS -# define nr_irqs NR_IRQS +# define nr_irqs_gsi NR_IRQS #else -extern unsigned int nr_irqs; +extern unsigned int nr_irqs_gsi; #endif struct msi_desc; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |