diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-08-19 23:50:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 10:52:54 -0400 |
commit | efa2559f65167989f1893cb065e3126d4f13ba60 (patch) | |
tree | 5682fd57b093f1514af837820a8210bc512bbeba /arch/x86/kernel/io_apic_32.c | |
parent | 8ea5371baa82db452a8d93e9977b418d30944e32 (diff) |
x86: order variables in io_apic_xx.c
move first_system_vector to apic_64.c.
also add #ifdef CONFIG_INTR_REMAP to prepare 32 bit to use
same file.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/io_apic_32.c')
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index 9531ef33362b..3010bdd3352d 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -54,25 +54,23 @@ | |||
54 | 54 | ||
55 | #define __apicdebuginit(type) static type __init | 55 | #define __apicdebuginit(type) static type __init |
56 | 56 | ||
57 | int (*ioapic_renumber_irq)(int ioapic, int irq); | ||
58 | atomic_t irq_mis_count; | ||
59 | |||
60 | /* Where if anywhere is the i8259 connect in external int mode */ | ||
61 | static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; | ||
62 | |||
63 | static DEFINE_SPINLOCK(ioapic_lock); | ||
64 | static DEFINE_SPINLOCK(vector_lock); | ||
65 | |||
66 | int timer_through_8259 __initdata; | ||
67 | |||
68 | /* | 57 | /* |
69 | * Is the SiS APIC rmw bug present ? | 58 | * Is the SiS APIC rmw bug present ? |
70 | * -1 = don't know, 0 = no, 1 = yes | 59 | * -1 = don't know, 0 = no, 1 = yes |
71 | */ | 60 | */ |
72 | int sis_apic_bug = -1; | 61 | int sis_apic_bug = -1; |
73 | 62 | ||
63 | static DEFINE_SPINLOCK(ioapic_lock); | ||
64 | static DEFINE_SPINLOCK(vector_lock); | ||
65 | |||
74 | int first_free_entry; | 66 | int first_free_entry; |
75 | /* | 67 | /* |
68 | * Rough estimation of how many shared IRQs there are, can | ||
69 | * be changed anytime. | ||
70 | */ | ||
71 | int pin_map_size; | ||
72 | |||
73 | /* | ||
76 | * # of IRQ routing registers | 74 | * # of IRQ routing registers |
77 | */ | 75 | */ |
78 | int nr_ioapic_registers[MAX_IO_APICS]; | 76 | int nr_ioapic_registers[MAX_IO_APICS]; |
@@ -93,7 +91,15 @@ int mp_bus_id_to_type[MAX_MP_BUSSES]; | |||
93 | 91 | ||
94 | DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); | 92 | DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES); |
95 | 93 | ||
96 | static int disable_timer_pin_1 __initdata; | 94 | int skip_ioapic_setup; |
95 | |||
96 | static int __init parse_noapic(char *arg) | ||
97 | { | ||
98 | /* disable IO-APIC */ | ||
99 | disable_ioapic_setup(); | ||
100 | return 0; | ||
101 | } | ||
102 | early_param("noapic", parse_noapic); | ||
97 | 103 | ||
98 | struct irq_cfg; | 104 | struct irq_cfg; |
99 | struct irq_pin_list; | 105 | struct irq_pin_list; |
@@ -268,13 +274,6 @@ static struct irq_cfg *irq_cfg_alloc(unsigned int irq) | |||
268 | return cfg; | 274 | return cfg; |
269 | } | 275 | } |
270 | 276 | ||
271 | static int assign_irq_vector(int irq, cpumask_t mask); | ||
272 | /* | ||
273 | * Rough estimation of how many shared IRQs there are, can | ||
274 | * be changed anytime. | ||
275 | */ | ||
276 | int pin_map_size; | ||
277 | |||
278 | /* | 277 | /* |
279 | * This is performance-critical, we want to do it O(1) | 278 | * This is performance-critical, we want to do it O(1) |
280 | * | 279 | * |
@@ -465,6 +464,9 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, u8 vector) | |||
465 | entry = entry->next; | 464 | entry = entry->next; |
466 | } | 465 | } |
467 | } | 466 | } |
467 | |||
468 | static int assign_irq_vector(int irq, cpumask_t mask); | ||
469 | |||
468 | static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) | 470 | static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) |
469 | { | 471 | { |
470 | struct irq_cfg *cfg; | 472 | struct irq_cfg *cfg; |
@@ -677,7 +679,6 @@ void send_IPI_self(int vector) | |||
677 | #define MAX_PIRQS 8 | 679 | #define MAX_PIRQS 8 |
678 | static int pirq_entries [MAX_PIRQS]; | 680 | static int pirq_entries [MAX_PIRQS]; |
679 | static int pirqs_enabled; | 681 | static int pirqs_enabled; |
680 | int skip_ioapic_setup; | ||
681 | 682 | ||
682 | static int __init ioapic_pirq_setup(char *str) | 683 | static int __init ioapic_pirq_setup(char *str) |
683 | { | 684 | { |
@@ -981,6 +982,7 @@ static inline int irq_trigger(int idx) | |||
981 | return MPBIOS_trigger(idx); | 982 | return MPBIOS_trigger(idx); |
982 | } | 983 | } |
983 | 984 | ||
985 | int (*ioapic_renumber_irq)(int ioapic, int irq); | ||
984 | static int pin_2_irq(int idx, int apic, int pin) | 986 | static int pin_2_irq(int idx, int apic, int pin) |
985 | { | 987 | { |
986 | int irq, i; | 988 | int irq, i; |
@@ -1621,6 +1623,9 @@ __apicdebuginit(int) print_all_ICs(void) | |||
1621 | fs_initcall(print_all_ICs); | 1623 | fs_initcall(print_all_ICs); |
1622 | 1624 | ||
1623 | 1625 | ||
1626 | /* Where if anywhere is the i8259 connect in external int mode */ | ||
1627 | static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; | ||
1628 | |||
1624 | static void __init enable_IO_APIC(void) | 1629 | static void __init enable_IO_APIC(void) |
1625 | { | 1630 | { |
1626 | union IO_APIC_reg_01 reg_01; | 1631 | union IO_APIC_reg_01 reg_01; |
@@ -1998,6 +2003,7 @@ static void ack_apic_edge(unsigned int irq) | |||
1998 | ack_APIC_irq(); | 2003 | ack_APIC_irq(); |
1999 | } | 2004 | } |
2000 | 2005 | ||
2006 | atomic_t irq_mis_count; | ||
2001 | static void ack_apic_level(unsigned int irq) | 2007 | static void ack_apic_level(unsigned int irq) |
2002 | { | 2008 | { |
2003 | unsigned long v; | 2009 | unsigned long v; |
@@ -2208,6 +2214,17 @@ static inline void __init unlock_ExtINT_logic(void) | |||
2208 | ioapic_write_entry(apic, pin, entry0); | 2214 | ioapic_write_entry(apic, pin, entry0); |
2209 | } | 2215 | } |
2210 | 2216 | ||
2217 | static int disable_timer_pin_1 __initdata; | ||
2218 | |||
2219 | static int __init parse_disable_timer_pin_1(char *arg) | ||
2220 | { | ||
2221 | disable_timer_pin_1 = 1; | ||
2222 | return 0; | ||
2223 | } | ||
2224 | early_param("disable_timer_pin_1", parse_disable_timer_pin_1); | ||
2225 | |||
2226 | int timer_through_8259 __initdata; | ||
2227 | |||
2211 | /* | 2228 | /* |
2212 | * This code may look a bit paranoid, but it's supposed to cooperate with | 2229 | * This code may look a bit paranoid, but it's supposed to cooperate with |
2213 | * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ | 2230 | * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ |
@@ -2983,28 +3000,6 @@ void __init setup_ioapic_dest(void) | |||
2983 | } | 3000 | } |
2984 | #endif | 3001 | #endif |
2985 | 3002 | ||
2986 | static int __init parse_disable_timer_pin_1(char *arg) | ||
2987 | { | ||
2988 | disable_timer_pin_1 = 1; | ||
2989 | return 0; | ||
2990 | } | ||
2991 | early_param("disable_timer_pin_1", parse_disable_timer_pin_1); | ||
2992 | |||
2993 | static int __init parse_enable_timer_pin_1(char *arg) | ||
2994 | { | ||
2995 | disable_timer_pin_1 = -1; | ||
2996 | return 0; | ||
2997 | } | ||
2998 | early_param("enable_timer_pin_1", parse_enable_timer_pin_1); | ||
2999 | |||
3000 | static int __init parse_noapic(char *arg) | ||
3001 | { | ||
3002 | /* disable IO-APIC */ | ||
3003 | disable_ioapic_setup(); | ||
3004 | return 0; | ||
3005 | } | ||
3006 | early_param("noapic", parse_noapic); | ||
3007 | |||
3008 | void __init ioapic_init_mappings(void) | 3003 | void __init ioapic_init_mappings(void) |
3009 | { | 3004 | { |
3010 | unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; | 3005 | unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; |