diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-14 09:13:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-14 09:13:47 -0400 |
commit | 881b374705f352725ba1f558968ef34c17ba900e (patch) | |
tree | d7286c00d109db65662af1435fe3b5c8868814d2 | |
parent | c83d12806b6185131ece682de8696d8cfb78df69 (diff) | |
parent | d4c63ec060f3315653c0ae5bc3a7fe2419a2282f (diff) |
Merge branch 'x86/apic' into x86/core
-rw-r--r-- | arch/x86/kernel/apic_32.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 14 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 29 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_64.c | 31 | ||||
-rw-r--r-- | arch/x86/pci/acpi.c | 5 | ||||
-rw-r--r-- | include/asm-x86/hw_irq.h | 1 |
6 files changed, 61 insertions, 35 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 84318edad8fb..12b154822bce 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -205,11 +205,15 @@ EXPORT_SYMBOL_GPL(apic_ops); | |||
205 | */ | 205 | */ |
206 | void __cpuinit enable_NMI_through_LVT0(void) | 206 | void __cpuinit enable_NMI_through_LVT0(void) |
207 | { | 207 | { |
208 | unsigned int v = APIC_DM_NMI; | 208 | unsigned int v; |
209 | |||
210 | /* unmask and set to NMI */ | ||
211 | v = APIC_DM_NMI; | ||
209 | 212 | ||
210 | /* Level triggered for 82489DX */ | 213 | /* Level triggered for 82489DX (32bit mode) */ |
211 | if (!lapic_is_integrated()) | 214 | if (!lapic_is_integrated()) |
212 | v |= APIC_LVT_LEVEL_TRIGGER; | 215 | v |= APIC_LVT_LEVEL_TRIGGER; |
216 | |||
213 | apic_write(APIC_LVT0, v); | 217 | apic_write(APIC_LVT0, v); |
214 | } | 218 | } |
215 | 219 | ||
@@ -226,9 +230,13 @@ int get_physical_broadcast(void) | |||
226 | */ | 230 | */ |
227 | int lapic_get_maxlvt(void) | 231 | int lapic_get_maxlvt(void) |
228 | { | 232 | { |
229 | unsigned int v = apic_read(APIC_LVR); | 233 | unsigned int v; |
230 | 234 | ||
231 | /* 82489DXs do not report # of LVT entries. */ | 235 | v = apic_read(APIC_LVR); |
236 | /* | ||
237 | * - we always have APIC integrated on 64bit mode | ||
238 | * - 82489DXs do not report # of LVT entries | ||
239 | */ | ||
232 | return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; | 240 | return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; |
233 | } | 241 | } |
234 | 242 | ||
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index cd63c0bc6180..69a876be506f 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -220,6 +220,11 @@ void __cpuinit enable_NMI_through_LVT0(void) | |||
220 | 220 | ||
221 | /* unmask and set to NMI */ | 221 | /* unmask and set to NMI */ |
222 | v = APIC_DM_NMI; | 222 | v = APIC_DM_NMI; |
223 | |||
224 | /* Level triggered for 82489DX (32bit mode) */ | ||
225 | if (!lapic_is_integrated()) | ||
226 | v |= APIC_LVT_LEVEL_TRIGGER; | ||
227 | |||
223 | apic_write(APIC_LVT0, v); | 228 | apic_write(APIC_LVT0, v); |
224 | } | 229 | } |
225 | 230 | ||
@@ -228,11 +233,14 @@ void __cpuinit enable_NMI_through_LVT0(void) | |||
228 | */ | 233 | */ |
229 | int lapic_get_maxlvt(void) | 234 | int lapic_get_maxlvt(void) |
230 | { | 235 | { |
231 | unsigned int v, maxlvt; | 236 | unsigned int v; |
232 | 237 | ||
233 | v = apic_read(APIC_LVR); | 238 | v = apic_read(APIC_LVR); |
234 | maxlvt = GET_APIC_MAXLVT(v); | 239 | /* |
235 | return maxlvt; | 240 | * - we always have APIC integrated on 64bit mode |
241 | * - 82489DXs do not report # of LVT entries | ||
242 | */ | ||
243 | return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; | ||
236 | } | 244 | } |
237 | 245 | ||
238 | /* | 246 | /* |
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index a0f4c27c822d..e710289f673e 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -51,6 +51,8 @@ | |||
51 | #include <mach_apic.h> | 51 | #include <mach_apic.h> |
52 | #include <mach_apicdef.h> | 52 | #include <mach_apicdef.h> |
53 | 53 | ||
54 | #define __apicdebuginit(type) static type __init | ||
55 | |||
54 | int (*ioapic_renumber_irq)(int ioapic, int irq); | 56 | int (*ioapic_renumber_irq)(int ioapic, int irq); |
55 | atomic_t irq_mis_count; | 57 | atomic_t irq_mis_count; |
56 | 58 | ||
@@ -1342,7 +1344,8 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, | |||
1342 | ioapic_write_entry(apic, pin, entry); | 1344 | ioapic_write_entry(apic, pin, entry); |
1343 | } | 1345 | } |
1344 | 1346 | ||
1345 | void __init print_IO_APIC(void) | 1347 | |
1348 | __apicdebuginit(void) print_IO_APIC(void) | ||
1346 | { | 1349 | { |
1347 | int apic, i; | 1350 | int apic, i; |
1348 | union IO_APIC_reg_00 reg_00; | 1351 | union IO_APIC_reg_00 reg_00; |
@@ -1457,9 +1460,7 @@ void __init print_IO_APIC(void) | |||
1457 | return; | 1460 | return; |
1458 | } | 1461 | } |
1459 | 1462 | ||
1460 | #if 0 | 1463 | __apicdebuginit(void) print_APIC_bitfield(int base) |
1461 | |||
1462 | static void print_APIC_bitfield(int base) | ||
1463 | { | 1464 | { |
1464 | unsigned int v; | 1465 | unsigned int v; |
1465 | int i, j; | 1466 | int i, j; |
@@ -1480,7 +1481,7 @@ static void print_APIC_bitfield(int base) | |||
1480 | } | 1481 | } |
1481 | } | 1482 | } |
1482 | 1483 | ||
1483 | void /*__init*/ print_local_APIC(void *dummy) | 1484 | __apicdebuginit(void) print_local_APIC(void *dummy) |
1484 | { | 1485 | { |
1485 | unsigned int v, ver, maxlvt; | 1486 | unsigned int v, ver, maxlvt; |
1486 | u64 icr; | 1487 | u64 icr; |
@@ -1564,12 +1565,12 @@ void /*__init*/ print_local_APIC(void *dummy) | |||
1564 | printk("\n"); | 1565 | printk("\n"); |
1565 | } | 1566 | } |
1566 | 1567 | ||
1567 | void print_all_local_APICs(void) | 1568 | __apicdebuginit(void) print_all_local_APICs(void) |
1568 | { | 1569 | { |
1569 | on_each_cpu(print_local_APIC, NULL, 1); | 1570 | on_each_cpu(print_local_APIC, NULL, 1); |
1570 | } | 1571 | } |
1571 | 1572 | ||
1572 | void /*__init*/ print_PIC(void) | 1573 | __apicdebuginit(void) print_PIC(void) |
1573 | { | 1574 | { |
1574 | unsigned int v; | 1575 | unsigned int v; |
1575 | unsigned long flags; | 1576 | unsigned long flags; |
@@ -1601,7 +1602,17 @@ void /*__init*/ print_PIC(void) | |||
1601 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); | 1602 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); |
1602 | } | 1603 | } |
1603 | 1604 | ||
1604 | #endif /* 0 */ | 1605 | __apicdebuginit(int) print_all_ICs(void) |
1606 | { | ||
1607 | print_PIC(); | ||
1608 | print_all_local_APICs(); | ||
1609 | print_IO_APIC(); | ||
1610 | |||
1611 | return 0; | ||
1612 | } | ||
1613 | |||
1614 | fs_initcall(print_all_ICs); | ||
1615 | |||
1605 | 1616 | ||
1606 | static void __init enable_IO_APIC(void) | 1617 | static void __init enable_IO_APIC(void) |
1607 | { | 1618 | { |
@@ -2327,8 +2338,6 @@ void __init setup_IO_APIC(void) | |||
2327 | setup_IO_APIC_irqs(); | 2338 | setup_IO_APIC_irqs(); |
2328 | init_IO_APIC_traps(); | 2339 | init_IO_APIC_traps(); |
2329 | check_timer(); | 2340 | check_timer(); |
2330 | if (!acpi_ioapic) | ||
2331 | print_IO_APIC(); | ||
2332 | } | 2341 | } |
2333 | 2342 | ||
2334 | /* | 2343 | /* |
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index e63282e78864..a1bec2969c6a 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -55,6 +55,8 @@ | |||
55 | #include <mach_ipi.h> | 55 | #include <mach_ipi.h> |
56 | #include <mach_apic.h> | 56 | #include <mach_apic.h> |
57 | 57 | ||
58 | #define __apicdebuginit(type) static type __init | ||
59 | |||
58 | struct irq_cfg { | 60 | struct irq_cfg { |
59 | cpumask_t domain; | 61 | cpumask_t domain; |
60 | cpumask_t old_domain; | 62 | cpumask_t old_domain; |
@@ -89,8 +91,6 @@ int first_system_vector = 0xfe; | |||
89 | 91 | ||
90 | char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE}; | 92 | char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE}; |
91 | 93 | ||
92 | #define __apicdebuginit __init | ||
93 | |||
94 | int sis_apic_bug; /* not actually supported, dummy for compile */ | 94 | int sis_apic_bug; /* not actually supported, dummy for compile */ |
95 | 95 | ||
96 | static int no_timer_check; | 96 | static int no_timer_check; |
@@ -1117,7 +1117,8 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, | |||
1117 | ioapic_write_entry(apic, pin, entry); | 1117 | ioapic_write_entry(apic, pin, entry); |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | void __apicdebuginit print_IO_APIC(void) | 1120 | |
1121 | __apicdebuginit(void) print_IO_APIC(void) | ||
1121 | { | 1122 | { |
1122 | int apic, i; | 1123 | int apic, i; |
1123 | union IO_APIC_reg_00 reg_00; | 1124 | union IO_APIC_reg_00 reg_00; |
@@ -1211,9 +1212,7 @@ void __apicdebuginit print_IO_APIC(void) | |||
1211 | return; | 1212 | return; |
1212 | } | 1213 | } |
1213 | 1214 | ||
1214 | #if 0 | 1215 | __apicdebuginit(void) print_APIC_bitfield(int base) |
1215 | |||
1216 | static __apicdebuginit void print_APIC_bitfield (int base) | ||
1217 | { | 1216 | { |
1218 | unsigned int v; | 1217 | unsigned int v; |
1219 | int i, j; | 1218 | int i, j; |
@@ -1234,7 +1233,7 @@ static __apicdebuginit void print_APIC_bitfield (int base) | |||
1234 | } | 1233 | } |
1235 | } | 1234 | } |
1236 | 1235 | ||
1237 | void __apicdebuginit print_local_APIC(void * dummy) | 1236 | __apicdebuginit(void) print_local_APIC(void *dummy) |
1238 | { | 1237 | { |
1239 | unsigned int v, ver, maxlvt; | 1238 | unsigned int v, ver, maxlvt; |
1240 | unsigned long icr; | 1239 | unsigned long icr; |
@@ -1311,12 +1310,12 @@ void __apicdebuginit print_local_APIC(void * dummy) | |||
1311 | printk("\n"); | 1310 | printk("\n"); |
1312 | } | 1311 | } |
1313 | 1312 | ||
1314 | void print_all_local_APICs (void) | 1313 | __apicdebuginit(void) print_all_local_APICs(void) |
1315 | { | 1314 | { |
1316 | on_each_cpu(print_local_APIC, NULL, 1); | 1315 | on_each_cpu(print_local_APIC, NULL, 1); |
1317 | } | 1316 | } |
1318 | 1317 | ||
1319 | void __apicdebuginit print_PIC(void) | 1318 | __apicdebuginit(void) print_PIC(void) |
1320 | { | 1319 | { |
1321 | unsigned int v; | 1320 | unsigned int v; |
1322 | unsigned long flags; | 1321 | unsigned long flags; |
@@ -1348,7 +1347,17 @@ void __apicdebuginit print_PIC(void) | |||
1348 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); | 1347 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); |
1349 | } | 1348 | } |
1350 | 1349 | ||
1351 | #endif /* 0 */ | 1350 | __apicdebuginit(int) print_all_ICs(void) |
1351 | { | ||
1352 | print_PIC(); | ||
1353 | print_all_local_APICs(); | ||
1354 | print_IO_APIC(); | ||
1355 | |||
1356 | return 0; | ||
1357 | } | ||
1358 | |||
1359 | fs_initcall(print_all_ICs); | ||
1360 | |||
1352 | 1361 | ||
1353 | void __init enable_IO_APIC(void) | 1362 | void __init enable_IO_APIC(void) |
1354 | { | 1363 | { |
@@ -2172,8 +2181,6 @@ void __init setup_IO_APIC(void) | |||
2172 | setup_IO_APIC_irqs(); | 2181 | setup_IO_APIC_irqs(); |
2173 | init_IO_APIC_traps(); | 2182 | init_IO_APIC_traps(); |
2174 | check_timer(); | 2183 | check_timer(); |
2175 | if (!acpi_ioapic) | ||
2176 | print_IO_APIC(); | ||
2177 | } | 2184 | } |
2178 | 2185 | ||
2179 | struct sysfs_ioapic_data { | 2186 | struct sysfs_ioapic_data { |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 19af06927fbc..1d88d2b39771 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -250,10 +250,5 @@ int __init pci_acpi_init(void) | |||
250 | acpi_pci_irq_enable(dev); | 250 | acpi_pci_irq_enable(dev); |
251 | } | 251 | } |
252 | 252 | ||
253 | #ifdef CONFIG_X86_IO_APIC | ||
254 | if (acpi_ioapic) | ||
255 | print_IO_APIC(); | ||
256 | #endif | ||
257 | |||
258 | return 0; | 253 | return 0; |
259 | } | 254 | } |
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h index 278571a64c0e..50f6e0316b50 100644 --- a/include/asm-x86/hw_irq.h +++ b/include/asm-x86/hw_irq.h | |||
@@ -64,7 +64,6 @@ extern unsigned long io_apic_irqs; | |||
64 | extern void init_VISWS_APIC_irqs(void); | 64 | extern void init_VISWS_APIC_irqs(void); |
65 | extern void setup_IO_APIC(void); | 65 | extern void setup_IO_APIC(void); |
66 | extern void disable_IO_APIC(void); | 66 | extern void disable_IO_APIC(void); |
67 | extern void print_IO_APIC(void); | ||
68 | extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); | 67 | extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); |
69 | extern void setup_ioapic_dest(void); | 68 | extern void setup_ioapic_dest(void); |
70 | 69 | ||