ia64/linux-2.6.18-xen.hg

changeset 749:2892ca2b9c17

linux/x86: cleanup IO-APIC code

- get 32-bit code in sync with 64-bit wrt ExtINT pin detection being
unnecessary
- eliminate build warnings resulting from c/s 725

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 28 13:31:21 2008 +0000 (2008-11-28)
parents 39a8680e7a70
children cdc6729dc702
files arch/i386/kernel/io_apic-xen.c arch/x86_64/kernel/io_apic-xen.c
line diff
     1.1 --- a/arch/i386/kernel/io_apic-xen.c	Fri Nov 28 13:30:58 2008 +0000
     1.2 +++ b/arch/i386/kernel/io_apic-xen.c	Fri Nov 28 13:31:21 2008 +0000
     1.3 @@ -87,8 +87,10 @@ static inline void xen_io_apic_write(uns
     1.4  int (*ioapic_renumber_irq)(int ioapic, int irq);
     1.5  atomic_t irq_mis_count;
     1.6  
     1.7 +#ifndef CONFIG_XEN
     1.8  /* Where if anywhere is the i8259 connect in external int mode */
     1.9  static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
    1.10 +#endif
    1.11  
    1.12  static DEFINE_SPINLOCK(ioapic_lock);
    1.13  static DEFINE_SPINLOCK(vector_lock);
    1.14 @@ -793,6 +795,7 @@ static int find_irq_entry(int apic, int 
    1.15  	return -1;
    1.16  }
    1.17  
    1.18 +#ifndef CONFIG_XEN
    1.19  /*
    1.20   * Find the pin to which IRQ[irq] (ISA) is connected
    1.21   */
    1.22 @@ -842,6 +845,7 @@ static int __init find_isa_irq_apic(int 
    1.23  
    1.24  	return -1;
    1.25  }
    1.26 +#endif
    1.27  
    1.28  /*
    1.29   * Find a specific PCI IRQ entry.
    1.30 @@ -1687,7 +1691,9 @@ void /*__init*/ print_PIC(void)
    1.31  static void __init enable_IO_APIC(void)
    1.32  {
    1.33  	union IO_APIC_reg_01 reg_01;
    1.34 +#ifndef CONFIG_XEN
    1.35  	int i8259_apic, i8259_pin;
    1.36 +#endif
    1.37  	int i, apic;
    1.38  	unsigned long flags;
    1.39  
    1.40 @@ -1708,6 +1714,7 @@ static void __init enable_IO_APIC(void)
    1.41  		spin_unlock_irqrestore(&ioapic_lock, flags);
    1.42  		nr_ioapic_registers[apic] = reg_01.bits.entries+1;
    1.43  	}
    1.44 +#ifndef CONFIG_XEN
    1.45  	for(apic = 0; apic < nr_ioapics; apic++) {
    1.46  		int pin;
    1.47  		/* See if any of the pins is in ExtINT mode */
    1.48 @@ -1749,6 +1756,7 @@ static void __init enable_IO_APIC(void)
    1.49  	{
    1.50  		printk(KERN_WARNING "ExtINT in hardware and MP table differ\n");
    1.51  	}
    1.52 +#endif
    1.53  
    1.54  	/*
    1.55  	 * Do not trust the IO-APIC being empty at bootup
    1.56 @@ -2517,6 +2525,8 @@ static int __init io_apic_bug_finalize(v
    1.57  
    1.58  late_initcall(io_apic_bug_finalize);
    1.59  
    1.60 +#ifndef CONFIG_XEN
    1.61 +
    1.62  struct sysfs_ioapic_data {
    1.63  	struct sys_device dev;
    1.64  	struct IO_APIC_route_entry entry[0];
    1.65 @@ -2570,10 +2580,8 @@ static int ioapic_resume(struct sys_devi
    1.66  
    1.67  static struct sysdev_class ioapic_sysdev_class = {
    1.68  	set_kset_name("ioapic"),
    1.69 -#ifndef CONFIG_XEN
    1.70  	.suspend = ioapic_suspend,
    1.71  	.resume = ioapic_resume,
    1.72 -#endif
    1.73  };
    1.74  
    1.75  static int __init ioapic_init_sysfs(void)
    1.76 @@ -2611,6 +2619,8 @@ static int __init ioapic_init_sysfs(void
    1.77  
    1.78  device_initcall(ioapic_init_sysfs);
    1.79  
    1.80 +#endif /* CONFIG_XEN */
    1.81 +
    1.82  /* --------------------------------------------------------------------------
    1.83                            ACPI-based IOAPIC Configuration
    1.84     -------------------------------------------------------------------------- */
     2.1 --- a/arch/x86_64/kernel/io_apic-xen.c	Fri Nov 28 13:30:58 2008 +0000
     2.2 +++ b/arch/x86_64/kernel/io_apic-xen.c	Fri Nov 28 13:31:21 2008 +0000
     2.3 @@ -2054,6 +2054,8 @@ void __init setup_IO_APIC(void)
     2.4  		print_IO_APIC();
     2.5  }
     2.6  
     2.7 +#ifndef CONFIG_XEN
     2.8 +
     2.9  struct sysfs_ioapic_data {
    2.10  	struct sys_device dev;
    2.11  	struct IO_APIC_route_entry entry[0];
    2.12 @@ -2107,10 +2109,8 @@ static int ioapic_resume(struct sys_devi
    2.13  
    2.14  static struct sysdev_class ioapic_sysdev_class = {
    2.15  	set_kset_name("ioapic"),
    2.16 -#ifndef CONFIG_XEN
    2.17  	.suspend = ioapic_suspend,
    2.18  	.resume = ioapic_resume,
    2.19 -#endif
    2.20  };
    2.21  
    2.22  static int __init ioapic_init_sysfs(void)
    2.23 @@ -2148,6 +2148,8 @@ static int __init ioapic_init_sysfs(void
    2.24  
    2.25  device_initcall(ioapic_init_sysfs);
    2.26  
    2.27 +#endif /* CONFIG_XEN */
    2.28 +
    2.29  /* --------------------------------------------------------------------------
    2.30                            ACPI-based IOAPIC Configuration
    2.31     -------------------------------------------------------------------------- */