aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/io_apic.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-19 23:50:52 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:52:58 -0400
commit9d6a4d0823b3b8e29156f5e698b5a68687afad32 (patch)
treeb3a06b8392f8b451625ad64ad7d51b60456fb388 /arch/x86/kernel/io_apic.c
parent8f09cd20a24c5f13c571bc73ddcd47be0af3b70f (diff)
x86: probe nr_irqs even only mptable is used
for !CONFIG_HAVE_SPARSE_IRQ fix: In file included from arch/x86/kernel/early-quirks.c:18: include/asm/io_apic.h: In function 'probe_nr_irqs': include/asm/io_apic.h:209: error: 'NR_IRQS' undeclared (first use in this function) include/asm/io_apic.h:209: error: (Each undeclared identifier is reported only once include/asm/io_apic.h:209: error: for each function it appears in.) v2: fix by Ingo 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.c')
-rw-r--r--arch/x86/kernel/io_apic.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index f853b667fa5c..f7e80262cbbb 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -3596,6 +3596,36 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3596} 3596}
3597#endif /* CONFIG_HT_IRQ */ 3597#endif /* CONFIG_HT_IRQ */
3598 3598
3599int __init io_apic_get_redir_entries (int ioapic)
3600{
3601 union IO_APIC_reg_01 reg_01;
3602 unsigned long flags;
3603
3604 spin_lock_irqsave(&ioapic_lock, flags);
3605 reg_01.raw = io_apic_read(ioapic, 1);
3606 spin_unlock_irqrestore(&ioapic_lock, flags);
3607
3608 return reg_01.bits.entries;
3609}
3610
3611int __init probe_nr_irqs(void)
3612{
3613 int idx;
3614 int nr = 0;
3615
3616 for (idx = 0; idx < nr_ioapics; idx++)
3617 nr += io_apic_get_redir_entries(idx);
3618
3619 /* double it for hotplug and msi and nmi */
3620 nr <<= 1;
3621
3622 /* something wrong ? */
3623 if (nr < 32)
3624 nr = 32;
3625
3626 return nr;
3627}
3628
3599/* -------------------------------------------------------------------------- 3629/* --------------------------------------------------------------------------
3600 ACPI-based IOAPIC Configuration 3630 ACPI-based IOAPIC Configuration
3601 -------------------------------------------------------------------------- */ 3631 -------------------------------------------------------------------------- */
@@ -3690,19 +3720,6 @@ int __init io_apic_get_version(int ioapic)
3690} 3720}
3691#endif 3721#endif
3692 3722
3693int __init io_apic_get_redir_entries (int ioapic)
3694{
3695 union IO_APIC_reg_01 reg_01;
3696 unsigned long flags;
3697
3698 spin_lock_irqsave(&ioapic_lock, flags);
3699 reg_01.raw = io_apic_read(ioapic, 1);
3700 spin_unlock_irqrestore(&ioapic_lock, flags);
3701
3702 return reg_01.bits.entries;
3703}
3704
3705
3706int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity) 3723int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity)
3707{ 3724{
3708 if (!IO_APIC_IRQ(irq)) { 3725 if (!IO_APIC_IRQ(irq)) {