aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 00:50:47 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:24 -0500
commita21769a4461801454930a06bc18bd8249cd9e993 (patch)
tree8b879f9a6d1c957d17a155ff865a0f7c8a18e257 /arch/x86
parent5257c5111ca21c8e857b65a79ab986b313e1c362 (diff)
x86, apic: clean up ->cpu_present_to_apicid()
- separate the namespace - remove macros Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/bigsmp/apic.h2
-rw-r--r--arch/x86/include/asm/es7000/apic.h2
-rw-r--r--arch/x86/include/asm/genapic.h2
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h11
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apic.h1
-rw-r--r--arch/x86/include/asm/numaq/apic.h2
-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.c9
-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, 34 insertions, 17 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index d0d894ff7d3..eea5e9788dd 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -67,7 +67,7 @@ static inline int bigsmp_apicid_to_node(int logical_apicid)
67 return apicid_2_node[hard_smp_processor_id()]; 67 return apicid_2_node[hard_smp_processor_id()];
68} 68}
69 69
70static inline int cpu_present_to_apicid(int mps_cpu) 70static inline int bigsmp_cpu_present_to_apicid(int mps_cpu)
71{ 71{
72 if (mps_cpu < nr_cpu_ids) 72 if (mps_cpu < nr_cpu_ids)
73 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu); 73 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index e0cd07e74f9..7cdde3d9c5f 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -88,7 +88,7 @@ static inline int es7000_apicid_to_node(int logical_apicid)
88} 88}
89 89
90 90
91static inline int cpu_present_to_apicid(int mps_cpu) 91static inline int es7000_cpu_present_to_apicid(int mps_cpu)
92{ 92{
93 if (!mps_cpu) 93 if (!mps_cpu)
94 return boot_cpu_physical_apicid; 94 return boot_cpu_physical_apicid;
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index 38b1202316f..2cb14d51e45 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -108,6 +108,8 @@ extern struct genapic apic_x2apic_uv_x;
108DECLARE_PER_CPU(int, x2apic_extra_bits); 108DECLARE_PER_CPU(int, x2apic_extra_bits);
109 109
110extern void default_setup_apic_routing(void); 110extern void default_setup_apic_routing(void);
111
112extern int default_cpu_present_to_apicid(int mps_cpu);
111#endif 113#endif
112 114
113#endif /* _ASM_X86_GENAPIC_64_H */ 115#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 eae3e4b6ed0..15d5627a9d6 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -110,7 +110,7 @@ static inline int default_cpu_to_logical_apicid(int cpu)
110 return 1 << cpu; 110 return 1 << cpu;
111} 111}
112 112
113static inline int cpu_present_to_apicid(int mps_cpu) 113static inline int __default_cpu_present_to_apicid(int mps_cpu)
114{ 114{
115 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu)) 115 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
116 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 116 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
@@ -118,6 +118,15 @@ static inline int cpu_present_to_apicid(int mps_cpu)
118 return BAD_APICID; 118 return BAD_APICID;
119} 119}
120 120
121#ifdef CONFIG_X86_32
122static inline int default_cpu_present_to_apicid(int mps_cpu)
123{
124 return __default_cpu_present_to_apicid(mps_cpu);
125}
126#else
127extern int default_cpu_present_to_apicid(int mps_cpu);
128#endif
129
121static inline physid_mask_t apicid_to_cpu_present(int phys_apicid) 130static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
122{ 131{
123 return physid_mask_of_physid(phys_apicid); 132 return physid_mask_of_physid(phys_apicid);
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 2ea913e8e0d..332fe93ab41 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 cpu_present_to_apicid (apic->cpu_present_to_apicid)
7#define apicid_to_cpu_present (apic->apicid_to_cpu_present) 6#define apicid_to_cpu_present (apic->apicid_to_cpu_present)
8#define setup_portio_remap (apic->setup_portio_remap) 7#define setup_portio_remap (apic->setup_portio_remap)
9#define check_phys_apicid_present (apic->check_phys_apicid_present) 8#define check_phys_apicid_present (apic->check_phys_apicid_present)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 6989abd3485..f482b063447 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -69,7 +69,7 @@ static inline int numaq_cpu_to_logical_apicid(int cpu)
69 * cpu to APIC ID relation to properly interact with the intelligent 69 * cpu to APIC ID relation to properly interact with the intelligent
70 * mode of the cluster controller. 70 * mode of the cluster controller.
71 */ 71 */
72static inline int cpu_present_to_apicid(int mps_cpu) 72static inline int numaq_cpu_present_to_apicid(int mps_cpu)
73{ 73{
74 if (mps_cpu < 60) 74 if (mps_cpu < 60)
75 return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3)); 75 return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index d564d7ee3f6..fc127369188 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -96,7 +96,7 @@ static inline int summit_cpu_to_logical_apicid(int cpu)
96#endif 96#endif
97} 97}
98 98
99static inline int cpu_present_to_apicid(int mps_cpu) 99static inline int summit_cpu_present_to_apicid(int mps_cpu)
100{ 100{
101 if (mps_cpu < nr_cpu_ids) 101 if (mps_cpu < nr_cpu_ids)
102 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 102 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 9446f372a16..f4a2c1c0a1a 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -197,7 +197,7 @@ struct genapic apic_flat = {
197 .multi_timer_check = NULL, 197 .multi_timer_check = NULL,
198 .apicid_to_node = NULL, 198 .apicid_to_node = NULL,
199 .cpu_to_logical_apicid = NULL, 199 .cpu_to_logical_apicid = NULL,
200 .cpu_present_to_apicid = NULL, 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 = NULL,
@@ -341,7 +341,7 @@ struct genapic apic_physflat = {
341 .multi_timer_check = NULL, 341 .multi_timer_check = NULL,
342 .apicid_to_node = NULL, 342 .apicid_to_node = NULL,
343 .cpu_to_logical_apicid = NULL, 343 .cpu_to_logical_apicid = NULL,
344 .cpu_present_to_apicid = NULL, 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 = NULL,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index 2eeca6e744a..710d612a964 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -199,7 +199,7 @@ struct genapic apic_x2apic_cluster = {
199 .multi_timer_check = NULL, 199 .multi_timer_check = NULL,
200 .apicid_to_node = NULL, 200 .apicid_to_node = NULL,
201 .cpu_to_logical_apicid = NULL, 201 .cpu_to_logical_apicid = NULL,
202 .cpu_present_to_apicid = NULL, 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 = NULL,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index be0ee3e56ef..49a449178c3 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -195,7 +195,7 @@ struct genapic apic_x2apic_phys = {
195 .multi_timer_check = NULL, 195 .multi_timer_check = NULL,
196 .apicid_to_node = NULL, 196 .apicid_to_node = NULL,
197 .cpu_to_logical_apicid = NULL, 197 .cpu_to_logical_apicid = NULL,
198 .cpu_present_to_apicid = NULL, 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 = NULL,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 68b423f3da9..a08a6359186 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -260,7 +260,7 @@ struct genapic apic_x2apic_uv_x = {
260 .multi_timer_check = NULL, 260 .multi_timer_check = NULL,
261 .apicid_to_node = NULL, 261 .apicid_to_node = NULL,
262 .cpu_to_logical_apicid = NULL, 262 .cpu_to_logical_apicid = NULL,
263 .cpu_present_to_apicid = NULL, 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 = NULL,
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 1dd4cecd4bc..812bf39de35 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -903,9 +903,16 @@ do_rest:
903 return boot_error; 903 return boot_error;
904} 904}
905 905
906#ifdef CONFIG_X86_64
907int default_cpu_present_to_apicid(int mps_cpu)
908{
909 return __default_cpu_present_to_apicid(mps_cpu);
910}
911#endif
912
906int __cpuinit native_cpu_up(unsigned int cpu) 913int __cpuinit native_cpu_up(unsigned int cpu)
907{ 914{
908 int apicid = cpu_present_to_apicid(cpu); 915 int apicid = apic->cpu_present_to_apicid(cpu);
909 unsigned long flags; 916 unsigned long flags;
910 int err; 917 int err;
911 918
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index cd6f02ba88e..1eaf18c801d 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -82,7 +82,7 @@ struct genapic apic_bigsmp = {
82 .multi_timer_check = NULL, 82 .multi_timer_check = NULL,
83 .apicid_to_node = bigsmp_apicid_to_node, 83 .apicid_to_node = bigsmp_apicid_to_node,
84 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, 84 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
85 .cpu_present_to_apicid = cpu_present_to_apicid, 85 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
86 .apicid_to_cpu_present = apicid_to_cpu_present, 86 .apicid_to_cpu_present = apicid_to_cpu_present,
87 .setup_portio_remap = setup_portio_remap, 87 .setup_portio_remap = setup_portio_remap,
88 .check_phys_apicid_present = check_phys_apicid_present, 88 .check_phys_apicid_present = check_phys_apicid_present,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index ef9b936c41a..2903657f420 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -63,7 +63,7 @@ struct genapic apic_default = {
63 .multi_timer_check = NULL, 63 .multi_timer_check = NULL,
64 .apicid_to_node = default_apicid_to_node, 64 .apicid_to_node = default_apicid_to_node,
65 .cpu_to_logical_apicid = default_cpu_to_logical_apicid, 65 .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
66 .cpu_present_to_apicid = cpu_present_to_apicid, 66 .cpu_present_to_apicid = default_cpu_present_to_apicid,
67 .apicid_to_cpu_present = apicid_to_cpu_present, 67 .apicid_to_cpu_present = apicid_to_cpu_present,
68 .setup_portio_remap = setup_portio_remap, 68 .setup_portio_remap = setup_portio_remap,
69 .check_phys_apicid_present = check_phys_apicid_present, 69 .check_phys_apicid_present = check_phys_apicid_present,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 74bf2b6b751..5a3a8ab4f8a 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -124,7 +124,7 @@ struct genapic apic_es7000 = {
124 .multi_timer_check = NULL, 124 .multi_timer_check = NULL,
125 .apicid_to_node = es7000_apicid_to_node, 125 .apicid_to_node = es7000_apicid_to_node,
126 .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid, 126 .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
127 .cpu_present_to_apicid = cpu_present_to_apicid, 127 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
128 .apicid_to_cpu_present = apicid_to_cpu_present, 128 .apicid_to_cpu_present = apicid_to_cpu_present,
129 .setup_portio_remap = setup_portio_remap, 129 .setup_portio_remap = setup_portio_remap,
130 .check_phys_apicid_present = check_phys_apicid_present, 130 .check_phys_apicid_present = check_phys_apicid_present,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 461f5beedb2..d928cae211c 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -69,7 +69,7 @@ struct genapic apic_numaq = {
69 .multi_timer_check = numaq_multi_timer_check, 69 .multi_timer_check = numaq_multi_timer_check,
70 .apicid_to_node = numaq_apicid_to_node, 70 .apicid_to_node = numaq_apicid_to_node,
71 .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid, 71 .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid,
72 .cpu_present_to_apicid = cpu_present_to_apicid, 72 .cpu_present_to_apicid = numaq_cpu_present_to_apicid,
73 .apicid_to_cpu_present = apicid_to_cpu_present, 73 .apicid_to_cpu_present = apicid_to_cpu_present,
74 .setup_portio_remap = setup_portio_remap, 74 .setup_portio_remap = setup_portio_remap,
75 .check_phys_apicid_present = check_phys_apicid_present, 75 .check_phys_apicid_present = check_phys_apicid_present,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index d99be2d4efc..e6bb34ee580 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -62,7 +62,7 @@ struct genapic apic_summit = {
62 .multi_timer_check = NULL, 62 .multi_timer_check = NULL,
63 .apicid_to_node = summit_apicid_to_node, 63 .apicid_to_node = summit_apicid_to_node,
64 .cpu_to_logical_apicid = summit_cpu_to_logical_apicid, 64 .cpu_to_logical_apicid = summit_cpu_to_logical_apicid,
65 .cpu_present_to_apicid = cpu_present_to_apicid, 65 .cpu_present_to_apicid = summit_cpu_present_to_apicid,
66 .apicid_to_cpu_present = apicid_to_cpu_present, 66 .apicid_to_cpu_present = apicid_to_cpu_present,
67 .setup_portio_remap = setup_portio_remap, 67 .setup_portio_remap = setup_portio_remap,
68 .check_phys_apicid_present = check_phys_apicid_present, 68 .check_phys_apicid_present = check_phys_apicid_present,