x86, apic: refactor ->phys_pkg_id()
authorIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 12:24:54 +0000 (13:24 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 28 Jan 2009 22:20:27 +0000 (23:20 +0100)
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>
13 files changed:
arch/x86/include/asm/bigsmp/apic.h
arch/x86/include/asm/es7000/apic.h
arch/x86/include/asm/mach-default/mach_apic.h
arch/x86/include/asm/mach-generic/mach_apic.h
arch/x86/include/asm/numaq/apic.h
arch/x86/include/asm/summit/apic.h
arch/x86/kernel/cpu/addon_cpuid_features.c
arch/x86/kernel/cpu/common.c
arch/x86/mach-generic/bigsmp.c
arch/x86/mach-generic/default.c
arch/x86/mach-generic/es7000.c
arch/x86/mach-generic/numaq.c
arch/x86/mach-generic/summit.c

index b7cba5b5635b065193741f0c5f4629919d5676d0..1230f5d7a38e6322510f145d152d04cfa28b9914 100644 (file)
@@ -133,7 +133,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
        return BAD_APICID;
 }
 
-static inline int phys_pkg_id(int cpuid_apic, int index_msb)
+static inline int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
 {
        return cpuid_apic >> index_msb;
 }
index d2c6c202e8bddc9c95ef010ab11d9d35599660fa..f183dfb4de4a99910cf81e201b1ab58002f0f620 100644 (file)
@@ -221,7 +221,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
        return apicid;
 }
 
-static inline int phys_pkg_id(int cpuid_apic, int index_msb)
+static inline int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
 {
        return cpuid_apic >> index_msb;
 }
index 55797a35150f018e2368eb90b4cc64c6a9ad6c83..d0605281a6b767195b604a22cf9833618ae64316 100644 (file)
@@ -21,7 +21,6 @@ static inline const struct cpumask *default_target_cpus(void)
 #include <asm/genapic.h>
 #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
 #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
-#define phys_pkg_id    (apic->phys_pkg_id)
 #define read_apic_id()  (GET_APIC_ID(apic_read(APIC_ID)))
 #define send_IPI_self (apic->send_IPI_self)
 #define wakeup_secondary_cpu (apic->wakeup_cpu)
@@ -65,7 +64,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
        return (unsigned int)(mask1 & mask2 & mask3);
 }
 
-static inline int phys_pkg_id(int cpuid_apic, int index_msb)
+static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
 {
        return cpuid_apic >> index_msb;
 }
index 6fed521585c43a9db6581ff422b6a38dd0e3e686..1eeb5b61e488b2b7b74d80b5669fcdbfcb12d4c7 100644 (file)
@@ -5,7 +5,6 @@
 
 #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
 #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
-#define phys_pkg_id (apic->phys_pkg_id)
 #define wakeup_secondary_cpu (apic->wakeup_cpu)
 
 extern void generic_bigsmp_probe(void);
index bc2c8a425c034d2fedaeb0dfdf321795298b5825..765c4d5124cbb9ed59c6bf3f93bd2cd2c85c2b84 100644 (file)
@@ -113,7 +113,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
 }
 
 /* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
-static inline int phys_pkg_id(int cpuid_apic, int index_msb)
+static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
 {
        return cpuid_apic >> index_msb;
 }
index 64cd441ae006050d325992084f4da8745297e3fe..fa6b3b45290dfc16728f02e169f9127e27cd1645 100644 (file)
@@ -182,7 +182,7 @@ static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
  *
  * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
  */
-static inline int phys_pkg_id(int cpuid_apic, int index_msb)
+static inline int summit_phys_pkg_id(int cpuid_apic, int index_msb)
 {
        return hard_smp_processor_id() >> index_msb;
 }
index 84f8e4a5aef7be4aa0400f4fef956344824352c2..e8bb892c09fda6ade7133585e15a5d2384067678 100644 (file)
@@ -116,13 +116,13 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
 
        core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width;
 
-       c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width)
+       c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, ht_mask_width)
                                                 & core_select_mask;
-       c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width);
+       c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, core_plus_mask_width);
        /*
         * Reinit the apicid, now that we have extended initial_apicid.
         */
-       c->apicid = phys_pkg_id(c->initial_apicid, 0);
+       c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
 
        c->x86_max_cores = (core_level_siblings / smp_num_siblings);
 
index 93c491c4fe7fd75c20a63be9971296bbb98f81eb..055b9c3a660005fab8be6bec1e083379fae46192 100644 (file)
@@ -442,7 +442,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
                }
 
                index_msb = get_count_order(smp_num_siblings);
-               c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
+               c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb);
 
                smp_num_siblings = smp_num_siblings / c->x86_max_cores;
 
@@ -450,7 +450,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
                core_bits = get_count_order(c->x86_max_cores);
 
-               c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
+               c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, index_msb) &
                                               ((1 << core_bits) - 1);
        }
 
@@ -686,7 +686,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
                c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
 #ifdef CONFIG_X86_32
 # ifdef CONFIG_X86_HT
-               c->apicid = phys_pkg_id(c->initial_apicid, 0);
+               c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
 # else
                c->apicid = c->initial_apicid;
 # endif
@@ -733,7 +733,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
                this_cpu->c_identify(c);
 
 #ifdef CONFIG_X86_64
-       c->apicid = phys_pkg_id(c->initial_apicid, 0);
+       c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
 #endif
 
        /*
index e151b472456fede4eb5a0c4a9a0512c2983d5a8b..d04b38954df3f361534189745e60ca4218518117 100644 (file)
@@ -87,7 +87,7 @@ struct genapic apic_bigsmp = {
        .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = bigsmp_check_phys_apicid_present,
        .enable_apic_mode               = NULL,
-       .phys_pkg_id                    = phys_pkg_id,
+       .phys_pkg_id                    = bigsmp_phys_pkg_id,
        .mps_oem_check                  = mps_oem_check,
 
        .get_apic_id                    = get_apic_id,
index ac6be195b977f3eb80e257b03f17b1cd748a832c..5c9266f756e0c2ba05e82114afab5cc3bc419146 100644 (file)
@@ -68,7 +68,7 @@ struct genapic apic_default = {
        .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = default_check_phys_apicid_present,
        .enable_apic_mode               = NULL,
-       .phys_pkg_id                    = phys_pkg_id,
+       .phys_pkg_id                    = default_phys_pkg_id,
        .mps_oem_check                  = mps_oem_check,
 
        .get_apic_id                    = get_apic_id,
index 1185964b7a336fbec1e719f434eb473c0dd4362f..52787e34c9cc11a31326481dfee596bc0203d162 100644 (file)
@@ -122,7 +122,7 @@ struct genapic apic_es7000 = {
        .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = es7000_check_phys_apicid_present,
        .enable_apic_mode               = es7000_enable_apic_mode,
-       .phys_pkg_id                    = phys_pkg_id,
+       .phys_pkg_id                    = es7000_phys_pkg_id,
        .mps_oem_check                  = mps_oem_check,
 
        .get_apic_id                    = get_apic_id,
index 8d3358de3fe7d2ee1f4fc662a51f480725ec3d59..6a1134e6d72d8c361b004a98264f7cd6d34ffd40 100644 (file)
@@ -87,7 +87,7 @@ struct genapic apic_numaq = {
        .setup_portio_remap             = numaq_setup_portio_remap,
        .check_phys_apicid_present      = numaq_check_phys_apicid_present,
        .enable_apic_mode               = NULL,
-       .phys_pkg_id                    = phys_pkg_id,
+       .phys_pkg_id                    = numaq_phys_pkg_id,
        .mps_oem_check                  = mps_oem_check,
 
        .get_apic_id                    = get_apic_id,
index cb83bcbb2dece852e61f2e5409e9de6858a4f3c4..2d6843a61d97223e7105bdc889ca0c33a9e4dca2 100644 (file)
@@ -67,7 +67,7 @@ struct genapic apic_summit = {
        .setup_portio_remap             = NULL,
        .check_phys_apicid_present      = summit_check_phys_apicid_present,
        .enable_apic_mode               = NULL,
-       .phys_pkg_id                    = phys_pkg_id,
+       .phys_pkg_id                    = summit_phys_pkg_id,
        .mps_oem_check                  = mps_oem_check,
 
        .get_apic_id                    = get_apic_id,