aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 06:43:18 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:25 -0500
commita27a621001f4c3e57caf47feff4b014577fd01c6 (patch)
tree0f14c4c8eaff3c11142672f16a63e7b6e42d81a7
parentd83093b50416f4ca59d3a84b2ddc217748214d64 (diff)
x86: refactor ->check_phys_apicid_present() subarch methods
- spread out the namespace to per driver methods - extend it to 64-bit as well so that we can use apic->check_phys_apicid_present() unconditionally Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/include/asm/bigsmp/apic.h6
-rw-r--r--arch/x86/include/asm/es7000/apic.h4
-rw-r--r--arch/x86/include/asm/genapic.h1
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h18
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apic.h1
-rw-r--r--arch/x86/include/asm/numaq/apic.h4
-rw-r--r--arch/x86/include/asm/summit/apic.h2
-rw-r--r--arch/x86/kernel/genapic_flat_64.c4
-rw-r--r--arch/x86/kernel/genx2apic_cluster.c2
-rw-r--r--arch/x86/kernel/genx2apic_phys.c2
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c2
-rw-r--r--arch/x86/kernel/smpboot.c7
-rw-r--r--arch/x86/mach-generic/bigsmp.c2
-rw-r--r--arch/x86/mach-generic/default.c2
-rw-r--r--arch/x86/mach-generic/es7000.c2
-rw-r--r--arch/x86/mach-generic/numaq.c2
-rw-r--r--arch/x86/mach-generic/summit.c2
17 files changed, 38 insertions, 25 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index 2fa70032e3b4..5ba4118fcdf2 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -99,13 +99,13 @@ static inline void bigsmp_setup_portio_remap(void)
99{ 99{
100} 100}
101 101
102static inline void enable_apic_mode(void) 102static inline int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid)
103{ 103{
104 return 1;
104} 105}
105 106
106static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) 107static inline void enable_apic_mode(void)
107{ 108{
108 return (1);
109} 109}
110 110
111/* As we are using single CPU as destination, pick only one CPU here */ 111/* As we are using single CPU as destination, pick only one CPU here */
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index c5b0eb51e53a..717c27f8da61 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -126,9 +126,9 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)
126 return physids_promote(0xff); 126 return physids_promote(0xff);
127} 127}
128 128
129
130extern unsigned int boot_cpu_physical_apicid; 129extern unsigned int boot_cpu_physical_apicid;
131static inline int check_phys_apicid_present(int cpu_physical_apicid) 130
131static inline int es7000_check_phys_apicid_present(int cpu_physical_apicid)
132{ 132{
133 boot_cpu_physical_apicid = read_apic_id(); 133 boot_cpu_physical_apicid = read_apic_id();
134 return (1); 134 return (1);
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 2cb14d51e459..f292fd02ebab 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -110,6 +110,7 @@ DECLARE_PER_CPU(int, x2apic_extra_bits);
110extern void default_setup_apic_routing(void); 110extern void default_setup_apic_routing(void);
111 111
112extern int default_cpu_present_to_apicid(int mps_cpu); 112extern int default_cpu_present_to_apicid(int mps_cpu);
113extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
113#endif 114#endif
114 115
115#endif /* _ASM_X86_GENAPIC_64_H */ 116#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 54c20e19e280..0a824d3a2238 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -118,13 +118,26 @@ static inline int __default_cpu_present_to_apicid(int mps_cpu)
118 return BAD_APICID; 118 return BAD_APICID;
119} 119}
120 120
121static inline int
122__default_check_phys_apicid_present(int boot_cpu_physical_apicid)
123{
124 return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
125}
126
121#ifdef CONFIG_X86_32 127#ifdef CONFIG_X86_32
122static inline int default_cpu_present_to_apicid(int mps_cpu) 128static inline int default_cpu_present_to_apicid(int mps_cpu)
123{ 129{
124 return __default_cpu_present_to_apicid(mps_cpu); 130 return __default_cpu_present_to_apicid(mps_cpu);
125} 131}
132
133static inline int
134default_check_phys_apicid_present(int boot_cpu_physical_apicid)
135{
136 return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
137}
126#else 138#else
127extern int default_cpu_present_to_apicid(int mps_cpu); 139extern int default_cpu_present_to_apicid(int mps_cpu);
140extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
128#endif 141#endif
129 142
130static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid) 143static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
@@ -132,11 +145,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
132 return physid_mask_of_physid(phys_apicid); 145 return physid_mask_of_physid(phys_apicid);
133} 146}
134 147
135static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
136{
137 return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
138}
139
140static inline void enable_apic_mode(void) 148static inline void enable_apic_mode(void)
141{ 149{
142} 150}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 393a97c5685f..efd762d951ac 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -3,7 +3,6 @@
3 3
4#include <asm/genapic.h> 4#include <asm/genapic.h>
5 5
6#define check_phys_apicid_present (apic->check_phys_apicid_present)
7#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) 6#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
8#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) 7#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
9#define enable_apic_mode (apic->enable_apic_mode) 8#define enable_apic_mode (apic->enable_apic_mode)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 6b626519cd75..3be735e2ab90 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -92,9 +92,9 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)
92 92
93extern void *xquad_portio; 93extern void *xquad_portio;
94 94
95static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) 95static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
96{ 96{
97 return (1); 97 return 1;
98} 98}
99 99
100static inline void enable_apic_mode(void) 100static inline void enable_apic_mode(void)
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 131343b0b757..fe578f6df782 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -120,7 +120,7 @@ static inline void summit_setup_portio_remap(void)
120{ 120{
121} 121}
122 122
123static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) 123static inline int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)
124{ 124{
125 return 1; 125 return 1;
126} 126}
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index f4a2c1c0a1a4..78adf71f7e55 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -200,7 +200,7 @@ struct genapic apic_flat = {
200 .cpu_present_to_apicid = default_cpu_present_to_apicid, 200 .cpu_present_to_apicid = default_cpu_present_to_apicid,
201 .apicid_to_cpu_present = NULL, 201 .apicid_to_cpu_present = NULL,
202 .setup_portio_remap = NULL, 202 .setup_portio_remap = NULL,
203 .check_phys_apicid_present = NULL, 203 .check_phys_apicid_present = default_check_phys_apicid_present,
204 .enable_apic_mode = NULL, 204 .enable_apic_mode = NULL,
205 .phys_pkg_id = phys_pkg_id, 205 .phys_pkg_id = phys_pkg_id,
206 .mps_oem_check = NULL, 206 .mps_oem_check = NULL,
@@ -344,7 +344,7 @@ struct genapic apic_physflat = {
344 .cpu_present_to_apicid = default_cpu_present_to_apicid, 344 .cpu_present_to_apicid = default_cpu_present_to_apicid,
345 .apicid_to_cpu_present = NULL, 345 .apicid_to_cpu_present = NULL,
346 .setup_portio_remap = NULL, 346 .setup_portio_remap = NULL,
347 .check_phys_apicid_present = NULL, 347 .check_phys_apicid_present = default_check_phys_apicid_present,
348 .enable_apic_mode = NULL, 348 .enable_apic_mode = NULL,
349 .phys_pkg_id = phys_pkg_id, 349 .phys_pkg_id = phys_pkg_id,
350 .mps_oem_check = NULL, 350 .mps_oem_check = NULL,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 710d612a9641..7062e24b18f6 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -202,7 +202,7 @@ struct genapic apic_x2apic_cluster = {
202 .cpu_present_to_apicid = default_cpu_present_to_apicid, 202 .cpu_present_to_apicid = default_cpu_present_to_apicid,
203 .apicid_to_cpu_present = NULL, 203 .apicid_to_cpu_present = NULL,
204 .setup_portio_remap = NULL, 204 .setup_portio_remap = NULL,
205 .check_phys_apicid_present = NULL, 205 .check_phys_apicid_present = default_check_phys_apicid_present,
206 .enable_apic_mode = NULL, 206 .enable_apic_mode = NULL,
207 .phys_pkg_id = phys_pkg_id, 207 .phys_pkg_id = phys_pkg_id,
208 .mps_oem_check = NULL, 208 .mps_oem_check = NULL,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index 49a449178c3b..7177a1110f0d 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -198,7 +198,7 @@ struct genapic apic_x2apic_phys = {
198 .cpu_present_to_apicid = default_cpu_present_to_apicid, 198 .cpu_present_to_apicid = default_cpu_present_to_apicid,
199 .apicid_to_cpu_present = NULL, 199 .apicid_to_cpu_present = NULL,
200 .setup_portio_remap = NULL, 200 .setup_portio_remap = NULL,
201 .check_phys_apicid_present = NULL, 201 .check_phys_apicid_present = default_check_phys_apicid_present,
202 .enable_apic_mode = NULL, 202 .enable_apic_mode = NULL,
203 .phys_pkg_id = phys_pkg_id, 203 .phys_pkg_id = phys_pkg_id,
204 .mps_oem_check = NULL, 204 .mps_oem_check = NULL,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index a08a63591864..debd721f0b4e 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -263,7 +263,7 @@ struct genapic apic_x2apic_uv_x = {
263 .cpu_present_to_apicid = default_cpu_present_to_apicid, 263 .cpu_present_to_apicid = default_cpu_present_to_apicid,
264 .apicid_to_cpu_present = NULL, 264 .apicid_to_cpu_present = NULL,
265 .setup_portio_remap = NULL, 265 .setup_portio_remap = NULL,
266 .check_phys_apicid_present = NULL, 266 .check_phys_apicid_present = default_check_phys_apicid_present,
267 .enable_apic_mode = NULL, 267 .enable_apic_mode = NULL,
268 .phys_pkg_id = phys_pkg_id, 268 .phys_pkg_id = phys_pkg_id,
269 .mps_oem_check = NULL, 269 .mps_oem_check = NULL,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 0e7d26c01f9f..ab83be2f8e0f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -908,6 +908,11 @@ int default_cpu_present_to_apicid(int mps_cpu)
908{ 908{
909 return __default_cpu_present_to_apicid(mps_cpu); 909 return __default_cpu_present_to_apicid(mps_cpu);
910} 910}
911
912int default_check_phys_apicid_present(int boot_cpu_physical_apicid)
913{
914 return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
915}
911#endif 916#endif
912 917
913int __cpuinit native_cpu_up(unsigned int cpu) 918int __cpuinit native_cpu_up(unsigned int cpu)
@@ -1058,7 +1063,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
1058 * Should not be necessary because the MP table should list the boot 1063 * Should not be necessary because the MP table should list the boot
1059 * CPU too, but we do it for the sake of robustness anyway. 1064 * CPU too, but we do it for the sake of robustness anyway.
1060 */ 1065 */
1061 if (!check_phys_apicid_present(boot_cpu_physical_apicid)) { 1066 if (!apic->check_phys_apicid_present(boot_cpu_physical_apicid)) {
1062 printk(KERN_NOTICE 1067 printk(KERN_NOTICE
1063 "weird, boot CPU (#%d) not listed by the BIOS.\n", 1068 "weird, boot CPU (#%d) not listed by the BIOS.\n",
1064 boot_cpu_physical_apicid); 1069 boot_cpu_physical_apicid);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 424740554a32..82743d16c23d 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -85,7 +85,7 @@ struct genapic apic_bigsmp = {
85 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, 85 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
86 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, 86 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present,
87 .setup_portio_remap = NULL, 87 .setup_portio_remap = NULL,
88 .check_phys_apicid_present = check_phys_apicid_present, 88 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
89 .enable_apic_mode = enable_apic_mode, 89 .enable_apic_mode = enable_apic_mode,
90 .phys_pkg_id = phys_pkg_id, 90 .phys_pkg_id = phys_pkg_id,
91 .mps_oem_check = mps_oem_check, 91 .mps_oem_check = mps_oem_check,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index b48a58daf719..d0374c69ad01 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -66,7 +66,7 @@ struct genapic apic_default = {
66 .cpu_present_to_apicid = default_cpu_present_to_apicid, 66 .cpu_present_to_apicid = default_cpu_present_to_apicid,
67 .apicid_to_cpu_present = default_apicid_to_cpu_present, 67 .apicid_to_cpu_present = default_apicid_to_cpu_present,
68 .setup_portio_remap = NULL, 68 .setup_portio_remap = NULL,
69 .check_phys_apicid_present = check_phys_apicid_present, 69 .check_phys_apicid_present = default_check_phys_apicid_present,
70 .enable_apic_mode = enable_apic_mode, 70 .enable_apic_mode = enable_apic_mode,
71 .phys_pkg_id = phys_pkg_id, 71 .phys_pkg_id = phys_pkg_id,
72 .mps_oem_check = mps_oem_check, 72 .mps_oem_check = mps_oem_check,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 449eca5b6048..52b3eb5e645f 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -127,7 +127,7 @@ struct genapic apic_es7000 = {
127 .cpu_present_to_apicid = es7000_cpu_present_to_apicid, 127 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
128 .apicid_to_cpu_present = es7000_apicid_to_cpu_present, 128 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
129 .setup_portio_remap = NULL, 129 .setup_portio_remap = NULL,
130 .check_phys_apicid_present = check_phys_apicid_present, 130 .check_phys_apicid_present = es7000_check_phys_apicid_present,
131 .enable_apic_mode = enable_apic_mode, 131 .enable_apic_mode = enable_apic_mode,
132 .phys_pkg_id = phys_pkg_id, 132 .phys_pkg_id = phys_pkg_id,
133 .mps_oem_check = mps_oem_check, 133 .mps_oem_check = mps_oem_check,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index e60361b0bf1e..7ec2ca43ca20 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -85,7 +85,7 @@ struct genapic apic_numaq = {
85 .cpu_present_to_apicid = numaq_cpu_present_to_apicid, 85 .cpu_present_to_apicid = numaq_cpu_present_to_apicid,
86 .apicid_to_cpu_present = numaq_apicid_to_cpu_present, 86 .apicid_to_cpu_present = numaq_apicid_to_cpu_present,
87 .setup_portio_remap = numaq_setup_portio_remap, 87 .setup_portio_remap = numaq_setup_portio_remap,
88 .check_phys_apicid_present = check_phys_apicid_present, 88 .check_phys_apicid_present = numaq_check_phys_apicid_present,
89 .enable_apic_mode = enable_apic_mode, 89 .enable_apic_mode = enable_apic_mode,
90 .phys_pkg_id = phys_pkg_id, 90 .phys_pkg_id = phys_pkg_id,
91 .mps_oem_check = mps_oem_check, 91 .mps_oem_check = mps_oem_check,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index ffcf7ca2e8ce..acf12de8916f 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -65,7 +65,7 @@ struct genapic apic_summit = {
65 .cpu_present_to_apicid = summit_cpu_present_to_apicid, 65 .cpu_present_to_apicid = summit_cpu_present_to_apicid,
66 .apicid_to_cpu_present = summit_apicid_to_cpu_present, 66 .apicid_to_cpu_present = summit_apicid_to_cpu_present,
67 .setup_portio_remap = NULL, 67 .setup_portio_remap = NULL,
68 .check_phys_apicid_present = check_phys_apicid_present, 68 .check_phys_apicid_present = summit_check_phys_apicid_present,
69 .enable_apic_mode = enable_apic_mode, 69 .enable_apic_mode = enable_apic_mode,
70 .phys_pkg_id = phys_pkg_id, 70 .phys_pkg_id = phys_pkg_id,
71 .mps_oem_check = mps_oem_check, 71 .mps_oem_check = mps_oem_check,