From: Jan Beulich Date: Wed, 9 Mar 2011 16:28:58 +0000 (+0000) Subject: x86: IO-APIC cleanup X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7b491593ff6ae6c88287b0107c424de76114bedf;p=xen.git x86: IO-APIC cleanup Remove unused and pointless bits from IO-APIC handling code. Move whatever possible into .init.*, and some data items into .data.read_mostly. Adjust some types. Signed-off-by: Jan Beulich --- diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index 71d6ece23f..47cdd3a402 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -355,7 +355,6 @@ void disable_local_APIC(void) } } -extern int ioapic_ack_new; /* * This is to verify that we're looking at a real local APIC. * Check these against your board if the CPUs aren't getting diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c index 93ba9ffc3a..824e1faba1 100644 --- a/xen/arch/x86/i8259.c +++ b/xen/arch/x86/i8259.c @@ -129,7 +129,7 @@ static unsigned int cached_irq_mask = 0xffff; * this 'mixed mode' IRQ handling costs nothing because it's only used * at IRQ setup time. */ -unsigned long io_apic_irqs; +unsigned int __read_mostly io_apic_irqs; void disable_8259A_irq(unsigned int irq) { diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index fcdf65fc7a..b8dd26de01 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -44,13 +44,14 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; static DEFINE_SPINLOCK(ioapic_lock); bool_t __read_mostly skip_ioapic_setup; +bool_t __read_mostly ioapic_ack_new = 1; #ifndef sis_apic_bug /* * Is the SiS APIC rmw bug present? * -1 = don't know, 0 = no, 1 = yes */ -int sis_apic_bug = -1; +s8 __read_mostly sis_apic_bug = -1; #endif /* @@ -76,7 +77,7 @@ int __read_mostly nr_ioapics; static struct irq_pin_list { int apic, pin; unsigned int next; -} *irq_2_pin; +} *__read_mostly irq_2_pin; static unsigned int irq_2_pin_free_entry; @@ -1191,7 +1192,7 @@ static void /*__init*/ __print_IO_APIC(void) return; } -void print_IO_APIC(void) +static void __init print_IO_APIC(void) { if (apic_verbosity != APIC_QUIET) __print_IO_APIC(); @@ -1321,7 +1322,6 @@ void disable_IO_APIC(void) * by Matt Domsch Tue Dec 21 12:25:05 CST 1999 */ -#ifndef CONFIG_X86_NUMAQ static void __init setup_ioapic_ids_from_mpc(void) { union IO_APIC_reg_00 reg_00; @@ -1428,9 +1428,6 @@ static void __init setup_ioapic_ids_from_mpc(void) apic_printk(APIC_VERBOSE, " ok.\n"); } } -#else -static void __init setup_ioapic_ids_from_mpc(void) { } -#endif /* * There is a nasty bug in some older SMP boards, their mptable lies @@ -1546,8 +1543,7 @@ static unsigned int startup_level_ioapic_irq (unsigned int irq) return 0; /* don't check for pending */ } -int __read_mostly ioapic_ack_new = 1; -static void setup_ioapic_ack(char *s) +static void __init setup_ioapic_ack(char *s) { if ( !strcmp(s, "old") ) ioapic_ack_new = 0; @@ -1716,9 +1712,7 @@ static void disable_edge_ioapic_irq(unsigned int irq) { } -static void end_edge_ioapic_irq(unsigned int irq) - { - } +#define end_edge_ioapic_irq disable_edge_ioapic_irq /* * Level and edge triggered IO-APIC interrupts need different handling, @@ -1820,7 +1814,7 @@ static void ack_lapic_irq(unsigned int irq) ack_APIC_irq(); } -static void end_lapic_irq(unsigned int irq) { /* nothing */ } +#define end_lapic_irq end_edge_ioapic_irq static hw_irq_controller lapic_irq_type = { .typename = "local-APIC-edge", diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 3275b2d07c..e97127ca0c 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1092,7 +1092,6 @@ int pirq_guest_unmask(struct domain *d) return 0; } -extern int ioapic_ack_new; static int pirq_acktype(struct domain *d, int pirq) { struct irq_desc *desc; diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h index a36ba4270b..02c4b71f53 100644 --- a/xen/include/asm-x86/io_apic.h +++ b/xen/include/asm-x86/io_apic.h @@ -169,7 +169,7 @@ static inline void io_apic_eoi(unsigned int apic, unsigned int vector) * Older SiS APIC requires we rewrite the index regiser */ #ifdef __i386__ -extern int sis_apic_bug; +extern s8 sis_apic_bug; #else #define sis_apic_bug 0 #endif @@ -184,6 +184,7 @@ static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned /* 1 if "noapic" boot option passed */ extern bool_t skip_ioapic_setup; +extern bool_t ioapic_ack_new; #ifdef CONFIG_ACPI_BOOT extern int io_apic_get_unique_id (int ioapic, int apic_id); diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h index 4026df12fd..b216f16c7a 100644 --- a/xen/include/asm-x86/irq.h +++ b/xen/include/asm-x86/irq.h @@ -99,10 +99,9 @@ int i8259A_resume(void); void setup_IO_APIC(void); void disable_IO_APIC(void); -void print_IO_APIC(void); void setup_ioapic_dest(void); -extern unsigned long io_apic_irqs; +extern unsigned int io_apic_irqs; DECLARE_PER_CPU(unsigned int, irq_count);