aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 07:24:54 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:27 -0500
commitcb8cc442dc7e07cb5438b357843ab4095ad73933 (patch)
treed818d1814507b2fe71f1e07c4bc108fe0c9ebb91 /arch/x86
parentd4c9a9f3d416cfa1f5ffbe09d864d069467fe693 (diff)
x86, apic: refactor ->phys_pkg_id()
Refactor the ->phys_pkg_id() methods: - namespace separation - macro wrapper removal - open-coded calls to the methods in the generic code 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/mach-default/mach_apic.h3
-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/cpu/addon_cpuid_features.c6
-rw-r--r--arch/x86/kernel/cpu/common.c8
-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
13 files changed, 17 insertions, 19 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index b7cba5b5635b..1230f5d7a38e 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -133,7 +133,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
133 return BAD_APICID; 133 return BAD_APICID;
134} 134}
135 135
136static inline int phys_pkg_id(int cpuid_apic, int index_msb) 136static inline int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
137{ 137{
138 return cpuid_apic >> index_msb; 138 return cpuid_apic >> index_msb;
139} 139}
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index d2c6c202e8bd..f183dfb4de4a 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -221,7 +221,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
221 return apicid; 221 return apicid;
222} 222}
223 223
224static inline int phys_pkg_id(int cpuid_apic, int index_msb) 224static inline int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
225{ 225{
226 return cpuid_apic >> index_msb; 226 return cpuid_apic >> index_msb;
227} 227}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 55797a35150f..d0605281a6b7 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -21,7 +21,6 @@ static inline const struct cpumask *default_target_cpus(void)
21#include <asm/genapic.h> 21#include <asm/genapic.h>
22#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) 22#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
23#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) 23#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
24#define phys_pkg_id (apic->phys_pkg_id)
25#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) 24#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
26#define send_IPI_self (apic->send_IPI_self) 25#define send_IPI_self (apic->send_IPI_self)
27#define wakeup_secondary_cpu (apic->wakeup_cpu) 26#define wakeup_secondary_cpu (apic->wakeup_cpu)
@@ -65,7 +64,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
65 return (unsigned int)(mask1 & mask2 & mask3); 64 return (unsigned int)(mask1 & mask2 & mask3);
66} 65}
67 66
68static inline int phys_pkg_id(int cpuid_apic, int index_msb) 67static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
69{ 68{
70 return cpuid_apic >> index_msb; 69 return cpuid_apic >> index_msb;
71} 70}
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index 6fed521585c4..1eeb5b61e488 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -5,7 +5,6 @@
5 5
6#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) 6#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
7#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)
8#define phys_pkg_id (apic->phys_pkg_id)
9#define wakeup_secondary_cpu (apic->wakeup_cpu) 8#define wakeup_secondary_cpu (apic->wakeup_cpu)
10 9
11extern void generic_bigsmp_probe(void); 10extern void generic_bigsmp_probe(void);
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index bc2c8a425c03..765c4d5124cb 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -113,7 +113,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
113} 113}
114 114
115/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */ 115/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
116static inline int phys_pkg_id(int cpuid_apic, int index_msb) 116static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
117{ 117{
118 return cpuid_apic >> index_msb; 118 return cpuid_apic >> index_msb;
119} 119}
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 64cd441ae006..fa6b3b45290d 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -182,7 +182,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
182 * 182 *
183 * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID. 183 * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
184 */ 184 */
185static inline int phys_pkg_id(int cpuid_apic, int index_msb) 185static inline int summit_phys_pkg_id(int cpuid_apic, int index_msb)
186{ 186{
187 return hard_smp_processor_id() >> index_msb; 187 return hard_smp_processor_id() >> index_msb;
188} 188}
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 84f8e4a5aef7..e8bb892c09fd 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -116,13 +116,13 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
116 116
117 core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width; 117 core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width;
118 118
119 c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width) 119 c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, ht_mask_width)
120 & core_select_mask; 120 & core_select_mask;
121 c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width); 121 c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, core_plus_mask_width);
122 /* 122 /*
123 * Reinit the apicid, now that we have extended initial_apicid. 123 * Reinit the apicid, now that we have extended initial_apicid.
124 */ 124 */
125 c->apicid = phys_pkg_id(c->initial_apicid, 0); 125 c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
126 126
127 c->x86_max_cores = (core_level_siblings / smp_num_siblings); 127 c->x86_max_cores = (core_level_siblings / smp_num_siblings);
128 128
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 93c491c4fe7f..055b9c3a6600 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -442,7 +442,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
442 } 442 }
443 443
444 index_msb = get_count_order(smp_num_siblings); 444 index_msb = get_count_order(smp_num_siblings);
445 c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb); 445 c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb);
446 446
447 smp_num_siblings = smp_num_siblings / c->x86_max_cores; 447 smp_num_siblings = smp_num_siblings / c->x86_max_cores;
448 448
@@ -450,7 +450,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
450 450
451 core_bits = get_count_order(c->x86_max_cores); 451 core_bits = get_count_order(c->x86_max_cores);
452 452
453 c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) & 453 c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, index_msb) &
454 ((1 << core_bits) - 1); 454 ((1 << core_bits) - 1);
455 } 455 }
456 456
@@ -686,7 +686,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
686 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF; 686 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
687#ifdef CONFIG_X86_32 687#ifdef CONFIG_X86_32
688# ifdef CONFIG_X86_HT 688# ifdef CONFIG_X86_HT
689 c->apicid = phys_pkg_id(c->initial_apicid, 0); 689 c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
690# else 690# else
691 c->apicid = c->initial_apicid; 691 c->apicid = c->initial_apicid;
692# endif 692# endif
@@ -733,7 +733,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
733 this_cpu->c_identify(c); 733 this_cpu->c_identify(c);
734 734
735#ifdef CONFIG_X86_64 735#ifdef CONFIG_X86_64
736 c->apicid = phys_pkg_id(c->initial_apicid, 0); 736 c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
737#endif 737#endif
738 738
739 /* 739 /*
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index e151b472456f..d04b38954df3 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -87,7 +87,7 @@ struct genapic apic_bigsmp = {
87 .setup_portio_remap = NULL, 87 .setup_portio_remap = NULL,
88 .check_phys_apicid_present = bigsmp_check_phys_apicid_present, 88 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
89 .enable_apic_mode = NULL, 89 .enable_apic_mode = NULL,
90 .phys_pkg_id = phys_pkg_id, 90 .phys_pkg_id = bigsmp_phys_pkg_id,
91 .mps_oem_check = mps_oem_check, 91 .mps_oem_check = mps_oem_check,
92 92
93 .get_apic_id = get_apic_id, 93 .get_apic_id = get_apic_id,
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
index ac6be195b977..5c9266f756e0 100644
--- a/arch/x86/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
@@ -68,7 +68,7 @@ struct genapic apic_default = {
68 .setup_portio_remap = NULL, 68 .setup_portio_remap = NULL,
69 .check_phys_apicid_present = default_check_phys_apicid_present, 69 .check_phys_apicid_present = default_check_phys_apicid_present,
70 .enable_apic_mode = NULL, 70 .enable_apic_mode = NULL,
71 .phys_pkg_id = phys_pkg_id, 71 .phys_pkg_id = default_phys_pkg_id,
72 .mps_oem_check = mps_oem_check, 72 .mps_oem_check = mps_oem_check,
73 73
74 .get_apic_id = get_apic_id, 74 .get_apic_id = get_apic_id,
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 1185964b7a33..52787e34c9cc 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -122,7 +122,7 @@ struct genapic apic_es7000 = {
122 .setup_portio_remap = NULL, 122 .setup_portio_remap = NULL,
123 .check_phys_apicid_present = es7000_check_phys_apicid_present, 123 .check_phys_apicid_present = es7000_check_phys_apicid_present,
124 .enable_apic_mode = es7000_enable_apic_mode, 124 .enable_apic_mode = es7000_enable_apic_mode,
125 .phys_pkg_id = phys_pkg_id, 125 .phys_pkg_id = es7000_phys_pkg_id,
126 .mps_oem_check = mps_oem_check, 126 .mps_oem_check = mps_oem_check,
127 127
128 .get_apic_id = get_apic_id, 128 .get_apic_id = get_apic_id,
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 8d3358de3fe7..6a1134e6d72d 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -87,7 +87,7 @@ struct genapic apic_numaq = {
87 .setup_portio_remap = numaq_setup_portio_remap, 87 .setup_portio_remap = numaq_setup_portio_remap,
88 .check_phys_apicid_present = numaq_check_phys_apicid_present, 88 .check_phys_apicid_present = numaq_check_phys_apicid_present,
89 .enable_apic_mode = NULL, 89 .enable_apic_mode = NULL,
90 .phys_pkg_id = phys_pkg_id, 90 .phys_pkg_id = numaq_phys_pkg_id,
91 .mps_oem_check = mps_oem_check, 91 .mps_oem_check = mps_oem_check,
92 92
93 .get_apic_id = get_apic_id, 93 .get_apic_id = get_apic_id,
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index cb83bcbb2dec..2d6843a61d97 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -67,7 +67,7 @@ struct genapic apic_summit = {
67 .setup_portio_remap = NULL, 67 .setup_portio_remap = NULL,
68 .check_phys_apicid_present = summit_check_phys_apicid_present, 68 .check_phys_apicid_present = summit_check_phys_apicid_present,
69 .enable_apic_mode = NULL, 69 .enable_apic_mode = NULL,
70 .phys_pkg_id = phys_pkg_id, 70 .phys_pkg_id = summit_phys_pkg_id,
71 .mps_oem_check = mps_oem_check, 71 .mps_oem_check = mps_oem_check,
72 72
73 .get_apic_id = get_apic_id, 73 .get_apic_id = get_apic_id,