aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/apicdef.h8
-rw-r--r--arch/x86/include/asm/apicnum.h12
-rw-r--r--arch/x86/include/asm/irq_vectors.h16
3 files changed, 25 insertions, 11 deletions
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h
index 63134e31e8b9..1a6454ef7f6c 100644
--- a/arch/x86/include/asm/apicdef.h
+++ b/arch/x86/include/asm/apicdef.h
@@ -132,12 +132,8 @@
132#define APIC_BASE_MSR 0x800 132#define APIC_BASE_MSR 0x800
133#define X2APIC_ENABLE (1UL << 10) 133#define X2APIC_ENABLE (1UL << 10)
134 134
135#ifdef CONFIG_X86_32 135/* get MAX_IO_APICS */
136# define MAX_IO_APICS 64 136#include <asm/apicnum.h>
137#else
138# define MAX_IO_APICS 128
139# define MAX_LOCAL_APIC 32768
140#endif
141 137
142/* 138/*
143 * All x86-64 systems are xAPIC compatible. 139 * All x86-64 systems are xAPIC compatible.
diff --git a/arch/x86/include/asm/apicnum.h b/arch/x86/include/asm/apicnum.h
new file mode 100644
index 000000000000..82f613c607ce
--- /dev/null
+++ b/arch/x86/include/asm/apicnum.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_X86_APICNUM_H
2#define _ASM_X86_APICNUM_H
3
4/* define MAX_IO_APICS */
5#ifdef CONFIG_X86_32
6# define MAX_IO_APICS 64
7#else
8# define MAX_IO_APICS 128
9# define MAX_LOCAL_APIC 32768
10#endif
11
12#endif /* _ASM_X86_APICNUM_H */
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index f7ff65032b9d..602361ad0e74 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -105,6 +105,8 @@
105 105
106#if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER) 106#if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER)
107 107
108#include <asm/apicnum.h> /* need MAX_IO_APICS */
109
108#ifndef CONFIG_SPARSE_IRQ 110#ifndef CONFIG_SPARSE_IRQ
109# if NR_CPUS < MAX_IO_APICS 111# if NR_CPUS < MAX_IO_APICS
110# define NR_IRQS (NR_VECTORS + (32 * NR_CPUS)) 112# define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
@@ -112,11 +114,15 @@
112# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS)) 114# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
113# endif 115# endif
114#else 116#else
115# if (8 * NR_CPUS) > (32 * MAX_IO_APICS) 117
116# define NR_IRQS (NR_VECTORS + (8 * NR_CPUS)) 118/* defined as a macro so nr_irqs = max_nr_irqs(nr_cpu_ids) can be used */
117# else 119# define max_nr_irqs(nr_cpus) \
118# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS)) 120 ((8 * nr_cpus) > (32 * MAX_IO_APICS) ? \
119# endif 121 (NR_VECTORS + (8 * NR_CPUS)) : \
122 (NR_VECTORS + (32 * MAX_IO_APICS))) \
123
124# define NR_IRQS max_nr_irqs(NR_CPUS)
125
120#endif 126#endif
121 127
122#elif defined(CONFIG_X86_VOYAGER) 128#elif defined(CONFIG_X86_VOYAGER)