aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/irq_vectors.h7
-rw-r--r--arch/x86/kernel/io_apic.c16
2 files changed, 18 insertions, 5 deletions
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 602361ad0e74..a16a2ab2b429 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -115,14 +115,11 @@
115# endif 115# endif
116#else 116#else
117 117
118/* defined as a macro so nr_irqs = max_nr_irqs(nr_cpu_ids) can be used */ 118# define NR_IRQS \
119# define max_nr_irqs(nr_cpus) \ 119 ((8 * NR_CPUS) > (32 * MAX_IO_APICS) ? \
120 ((8 * nr_cpus) > (32 * MAX_IO_APICS) ? \
121 (NR_VECTORS + (8 * NR_CPUS)) : \ 120 (NR_VECTORS + (8 * NR_CPUS)) : \
122 (NR_VECTORS + (32 * MAX_IO_APICS))) \ 121 (NR_VECTORS + (32 * MAX_IO_APICS))) \
123 122
124# define NR_IRQS max_nr_irqs(NR_CPUS)
125
126#endif 123#endif
127 124
128#elif defined(CONFIG_X86_VOYAGER) 125#elif defined(CONFIG_X86_VOYAGER)
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index ae80638012de..157986916cd1 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -3850,6 +3850,22 @@ void __init probe_nr_irqs_gsi(void)
3850 nr_irqs_gsi = nr; 3850 nr_irqs_gsi = nr;
3851} 3851}
3852 3852
3853#ifdef CONFIG_SPARSE_IRQ
3854int __init arch_probe_nr_irqs(void)
3855{
3856 int nr;
3857
3858 nr = ((8 * nr_cpu_ids) > (32 * nr_ioapics) ?
3859 (NR_VECTORS + (8 * nr_cpu_ids)) :
3860 (NR_VECTORS + (32 * nr_ioapics)));
3861
3862 if (nr < nr_irqs && nr > nr_irqs_gsi)
3863 nr_irqs = nr;
3864
3865 return 0;
3866}
3867#endif
3868
3853/* -------------------------------------------------------------------------- 3869/* --------------------------------------------------------------------------
3854 ACPI-based IOAPIC Configuration 3870 ACPI-based IOAPIC Configuration
3855 -------------------------------------------------------------------------- */ 3871 -------------------------------------------------------------------------- */