aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 07:31:22 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:26 -0500
commitd4c9a9f3d416cfa1f5ffbe09d864d069467fe693 (patch)
tree647f78d7d845734fdab95c8a05a20b0a80015709 /arch/x86/include
parentb0b20e5a3a6615ae750804523aeedd32911bb9d6 (diff)
x86, apic: unify phys_pkg_id()
- unify the call signature of 64-bit to that of 32-bit - clean up the types all around - clean up namespace contamination Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include')
-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.h6
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h2
-rw-r--r--arch/x86/include/asm/numaq/apic.h2
-rw-r--r--arch/x86/include/asm/summit/apic.h5
6 files changed, 8 insertions, 11 deletions
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index f49d440862f1..b7cba5b5635b 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 u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 136static inline int 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 038c4f0e480b..d2c6c202e8bd 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 u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 224static inline int 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/genapic.h b/arch/x86/include/asm/genapic.h
index f292fd02ebab..14b19de8cd09 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -48,11 +48,7 @@ struct genapic {
48 void (*setup_portio_remap)(void); 48 void (*setup_portio_remap)(void);
49 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); 49 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
50 void (*enable_apic_mode)(void); 50 void (*enable_apic_mode)(void);
51#ifdef CONFIG_X86_32 51 int (*phys_pkg_id)(int cpuid_apic, int index_msb);
52 u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
53#else
54 unsigned int (*phys_pkg_id)(int index_msb);
55#endif
56 52
57 /* 53 /*
58 * When one of the next two hooks returns 1 the genapic 54 * When one of the next two hooks returns 1 the genapic
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 3647c92d45e5..55797a35150f 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -65,7 +65,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
65 return (unsigned int)(mask1 & mask2 & mask3); 65 return (unsigned int)(mask1 & mask2 & mask3);
66} 66}
67 67
68static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 68static inline int phys_pkg_id(int cpuid_apic, int index_msb)
69{ 69{
70 return cpuid_apic >> index_msb; 70 return cpuid_apic >> index_msb;
71} 71}
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index dc93c30972e7..bc2c8a425c03 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 u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 116static inline int 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 526d19e79447..64cd441ae006 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -175,13 +175,14 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
175 return apicid; 175 return apicid;
176} 176}
177 177
178/* cpuid returns the value latched in the HW at reset, not the APIC ID 178/*
179 * cpuid returns the value latched in the HW at reset, not the APIC ID
179 * register's value. For any box whose BIOS changes APIC IDs, like 180 * register's value. For any box whose BIOS changes APIC IDs, like
180 * clustered APIC systems, we must use hard_smp_processor_id. 181 * clustered APIC systems, we must use hard_smp_processor_id.
181 * 182 *
182 * 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.
183 */ 184 */
184static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 185static inline int phys_pkg_id(int cpuid_apic, int index_msb)
185{ 186{
186 return hard_smp_processor_id() >> index_msb; 187 return hard_smp_processor_id() >> index_msb;
187} 188}