diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2008-07-20 19:52:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-24 06:37:10 -0400 |
commit | 32f71aff77b6470d272f80ac28f43f9601c4d140 (patch) | |
tree | 92e34f77aa71472179f4d171a151cf7af9c6b6fa | |
parent | 338b9bb3adac0d2c5a1e180491d9b001d624c402 (diff) |
x86: PIC, L-APIC and I/O APIC debug information
Dump all the PIC, local APIC and I/O APIC information at the
fs_initcall() level, which is after ACPI (if used) has initialised PCI
information, making the point of invocation consistent across MP-table and
ACPI platforms. Remove explicit calls to print_IO_APIC() from elsewhere.
Make the interface of all the functions involved consistent between 32-bit
and 64-bit versions and make them all static by default by the means of a
New-and-Improved(TM) __apicdebuginit() macro.
Note that like print_IO_APIC() all these only output anything if
"apic=debug" has been passed to the kernel through the command line.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-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 |
4 files changed, 38 insertions, 28 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index de9aa0e3a9c5..d54455ec9850 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -50,6 +50,8 @@ | |||
50 | #include <mach_apic.h> | 50 | #include <mach_apic.h> |
51 | #include <mach_apicdef.h> | 51 | #include <mach_apicdef.h> |
52 | 52 | ||
53 | #define __apicdebuginit(type) static type __init | ||
54 | |||
53 | int (*ioapic_renumber_irq)(int ioapic, int irq); | 55 | int (*ioapic_renumber_irq)(int ioapic, int irq); |
54 | atomic_t irq_mis_count; | 56 | atomic_t irq_mis_count; |
55 | 57 | ||
@@ -1345,7 +1347,8 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, | |||
1345 | ioapic_write_entry(apic, pin, entry); | 1347 | ioapic_write_entry(apic, pin, entry); |
1346 | } | 1348 | } |
1347 | 1349 | ||
1348 | void __init print_IO_APIC(void) | 1350 | |
1351 | __apicdebuginit(void) print_IO_APIC(void) | ||
1349 | { | 1352 | { |
1350 | int apic, i; | 1353 | int apic, i; |
1351 | union IO_APIC_reg_00 reg_00; | 1354 | union IO_APIC_reg_00 reg_00; |
@@ -1460,9 +1463,7 @@ void __init print_IO_APIC(void) | |||
1460 | return; | 1463 | return; |
1461 | } | 1464 | } |
1462 | 1465 | ||
1463 | #if 0 | 1466 | __apicdebuginit(void) print_APIC_bitfield(int base) |
1464 | |||
1465 | static void print_APIC_bitfield(int base) | ||
1466 | { | 1467 | { |
1467 | unsigned int v; | 1468 | unsigned int v; |
1468 | int i, j; | 1469 | int i, j; |
@@ -1483,7 +1484,7 @@ static void print_APIC_bitfield(int base) | |||
1483 | } | 1484 | } |
1484 | } | 1485 | } |
1485 | 1486 | ||
1486 | void /*__init*/ print_local_APIC(void *dummy) | 1487 | __apicdebuginit(void) print_local_APIC(void *dummy) |
1487 | { | 1488 | { |
1488 | unsigned int v, ver, maxlvt; | 1489 | unsigned int v, ver, maxlvt; |
1489 | 1490 | ||
@@ -1567,12 +1568,12 @@ void /*__init*/ print_local_APIC(void *dummy) | |||
1567 | printk("\n"); | 1568 | printk("\n"); |
1568 | } | 1569 | } |
1569 | 1570 | ||
1570 | void print_all_local_APICs(void) | 1571 | __apicdebuginit(void) print_all_local_APICs(void) |
1571 | { | 1572 | { |
1572 | on_each_cpu(print_local_APIC, NULL, 1); | 1573 | on_each_cpu(print_local_APIC, NULL, 1); |
1573 | } | 1574 | } |
1574 | 1575 | ||
1575 | void /*__init*/ print_PIC(void) | 1576 | __apicdebuginit(void) print_PIC(void) |
1576 | { | 1577 | { |
1577 | unsigned int v; | 1578 | unsigned int v; |
1578 | unsigned long flags; | 1579 | unsigned long flags; |
@@ -1604,7 +1605,17 @@ void /*__init*/ print_PIC(void) | |||
1604 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); | 1605 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); |
1605 | } | 1606 | } |
1606 | 1607 | ||
1607 | #endif /* 0 */ | 1608 | __apicdebuginit(int) print_all_ICs(void) |
1609 | { | ||
1610 | print_PIC(); | ||
1611 | print_all_local_APICs(); | ||
1612 | print_IO_APIC(); | ||
1613 | |||
1614 | return 0; | ||
1615 | } | ||
1616 | |||
1617 | fs_initcall(print_all_ICs); | ||
1618 | |||
1608 | 1619 | ||
1609 | static void __init enable_IO_APIC(void) | 1620 | static void __init enable_IO_APIC(void) |
1610 | { | 1621 | { |
@@ -2333,8 +2344,6 @@ void __init setup_IO_APIC(void) | |||
2333 | setup_IO_APIC_irqs(); | 2344 | setup_IO_APIC_irqs(); |
2334 | init_IO_APIC_traps(); | 2345 | init_IO_APIC_traps(); |
2335 | check_timer(); | 2346 | check_timer(); |
2336 | if (!acpi_ioapic) | ||
2337 | print_IO_APIC(); | ||
2338 | } | 2347 | } |
2339 | 2348 | ||
2340 | /* | 2349 | /* |
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index 8269434d1707..8cdcc4f287cc 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -53,6 +53,8 @@ | |||
53 | #include <mach_ipi.h> | 53 | #include <mach_ipi.h> |
54 | #include <mach_apic.h> | 54 | #include <mach_apic.h> |
55 | 55 | ||
56 | #define __apicdebuginit(type) static type __init | ||
57 | |||
56 | struct irq_cfg { | 58 | struct irq_cfg { |
57 | cpumask_t domain; | 59 | cpumask_t domain; |
58 | cpumask_t old_domain; | 60 | cpumask_t old_domain; |
@@ -87,8 +89,6 @@ int first_system_vector = 0xfe; | |||
87 | 89 | ||
88 | char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE}; | 90 | char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE}; |
89 | 91 | ||
90 | #define __apicdebuginit __init | ||
91 | |||
92 | int sis_apic_bug; /* not actually supported, dummy for compile */ | 92 | int sis_apic_bug; /* not actually supported, dummy for compile */ |
93 | 93 | ||
94 | static int no_timer_check; | 94 | static int no_timer_check; |
@@ -965,7 +965,8 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, | |||
965 | ioapic_write_entry(apic, pin, entry); | 965 | ioapic_write_entry(apic, pin, entry); |
966 | } | 966 | } |
967 | 967 | ||
968 | void __apicdebuginit print_IO_APIC(void) | 968 | |
969 | __apicdebuginit(void) print_IO_APIC(void) | ||
969 | { | 970 | { |
970 | int apic, i; | 971 | int apic, i; |
971 | union IO_APIC_reg_00 reg_00; | 972 | union IO_APIC_reg_00 reg_00; |
@@ -1059,9 +1060,7 @@ void __apicdebuginit print_IO_APIC(void) | |||
1059 | return; | 1060 | return; |
1060 | } | 1061 | } |
1061 | 1062 | ||
1062 | #if 0 | 1063 | __apicdebuginit(void) print_APIC_bitfield(int base) |
1063 | |||
1064 | static __apicdebuginit void print_APIC_bitfield (int base) | ||
1065 | { | 1064 | { |
1066 | unsigned int v; | 1065 | unsigned int v; |
1067 | int i, j; | 1066 | int i, j; |
@@ -1082,7 +1081,7 @@ static __apicdebuginit void print_APIC_bitfield (int base) | |||
1082 | } | 1081 | } |
1083 | } | 1082 | } |
1084 | 1083 | ||
1085 | void __apicdebuginit print_local_APIC(void * dummy) | 1084 | __apicdebuginit(void) print_local_APIC(void *dummy) |
1086 | { | 1085 | { |
1087 | unsigned int v, ver, maxlvt; | 1086 | unsigned int v, ver, maxlvt; |
1088 | 1087 | ||
@@ -1159,12 +1158,12 @@ void __apicdebuginit print_local_APIC(void * dummy) | |||
1159 | printk("\n"); | 1158 | printk("\n"); |
1160 | } | 1159 | } |
1161 | 1160 | ||
1162 | void print_all_local_APICs (void) | 1161 | __apicdebuginit(void) print_all_local_APICs(void) |
1163 | { | 1162 | { |
1164 | on_each_cpu(print_local_APIC, NULL, 1); | 1163 | on_each_cpu(print_local_APIC, NULL, 1); |
1165 | } | 1164 | } |
1166 | 1165 | ||
1167 | void __apicdebuginit print_PIC(void) | 1166 | __apicdebuginit(void) print_PIC(void) |
1168 | { | 1167 | { |
1169 | unsigned int v; | 1168 | unsigned int v; |
1170 | unsigned long flags; | 1169 | unsigned long flags; |
@@ -1196,7 +1195,17 @@ void __apicdebuginit print_PIC(void) | |||
1196 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); | 1195 | printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); |
1197 | } | 1196 | } |
1198 | 1197 | ||
1199 | #endif /* 0 */ | 1198 | __apicdebuginit(int) print_all_ICs(void) |
1199 | { | ||
1200 | print_PIC(); | ||
1201 | print_all_local_APICs(); | ||
1202 | print_IO_APIC(); | ||
1203 | |||
1204 | return 0; | ||
1205 | } | ||
1206 | |||
1207 | fs_initcall(print_all_ICs); | ||
1208 | |||
1200 | 1209 | ||
1201 | void __init enable_IO_APIC(void) | 1210 | void __init enable_IO_APIC(void) |
1202 | { | 1211 | { |
@@ -1849,8 +1858,6 @@ void __init setup_IO_APIC(void) | |||
1849 | setup_IO_APIC_irqs(); | 1858 | setup_IO_APIC_irqs(); |
1850 | init_IO_APIC_traps(); | 1859 | init_IO_APIC_traps(); |
1851 | check_timer(); | 1860 | check_timer(); |
1852 | if (!acpi_ioapic) | ||
1853 | print_IO_APIC(); | ||
1854 | } | 1861 | } |
1855 | 1862 | ||
1856 | struct sysfs_ioapic_data { | 1863 | 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 77ba51df5668..83e0048dca78 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 | ||