]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/genx2apic_cluster.c
x86/Voyager: remove power management Kconfig quirk
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / genx2apic_cluster.c
index 18b6f14376eb2f2078c67c72e1ad0a5d412d5c93..7c87156b641189e43ba79c435c180297fd3a4b36 100644 (file)
@@ -36,8 +36,8 @@ static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
        cpumask_set_cpu(cpu, retmask);
 }
 
-static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
                                 unsigned int dest)
+static void
__x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
 {
        unsigned long cfg;
 
@@ -57,45 +57,50 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
  */
 static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
 {
-       unsigned long flags;
        unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
+       for_each_cpu(query_cpu, mask) {
                __x2apic_send_IPI_dest(
                        per_cpu(x86_cpu_to_logical_apicid, query_cpu),
                        vector, apic->dest_logical);
+       }
        local_irq_restore(flags);
 }
 
-static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
                                          int vector)
+static void
x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
 {
-       unsigned long flags;
-       unsigned long query_cpu;
        unsigned long this_cpu = smp_processor_id();
+       unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_cpu(query_cpu, mask)
-               if (query_cpu != this_cpu)
-                       __x2apic_send_IPI_dest(
+       for_each_cpu(query_cpu, mask) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __x2apic_send_IPI_dest(
                                per_cpu(x86_cpu_to_logical_apicid, query_cpu),
                                vector, apic->dest_logical);
+       }
        local_irq_restore(flags);
 }
 
 static void x2apic_send_IPI_allbutself(int vector)
 {
-       unsigned long flags;
-       unsigned long query_cpu;
        unsigned long this_cpu = smp_processor_id();
+       unsigned long query_cpu;
+       unsigned long flags;
 
        local_irq_save(flags);
-       for_each_online_cpu(query_cpu)
-               if (query_cpu != this_cpu)
-                       __x2apic_send_IPI_dest(
+       for_each_online_cpu(query_cpu) {
+               if (query_cpu == this_cpu)
+                       continue;
+               __x2apic_send_IPI_dest(
                                per_cpu(x86_cpu_to_logical_apicid, query_cpu),
                                vector, apic->dest_logical);
+       }
        local_irq_restore(flags);
 }
 
@@ -111,21 +116,21 @@ static int x2apic_apic_id_registered(void)
 
 static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
-       int cpu;
-
        /*
         * We're using fixed IRQ delivery, can only return one logical APIC ID.
         * May as well be the first.
         */
-       cpu = cpumask_first(cpumask);
+       int cpu = cpumask_first(cpumask);
+
        if ((unsigned)cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_logical_apicid, cpu);
        else
                return BAD_APICID;
 }
 
-static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                                 const struct cpumask *andmask)
+static unsigned int
+x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                             const struct cpumask *andmask)
 {
        int cpu;
 
@@ -133,15 +138,18 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one logical APIC ID.
         * May as well be the first.
         */
-       for_each_cpu_and(cpu, cpumask, andmask)
+       for_each_cpu_and(cpu, cpumask, andmask) {
                if (cpumask_test_cpu(cpu, cpu_online_mask))
                        break;
+       }
+
        if (cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_logical_apicid, cpu);
+
        return BAD_APICID;
 }
 
-static unsigned int get_apic_id(unsigned long x)
+static unsigned int x2apic_cluster_phys_get_apic_id(unsigned long x)
 {
        unsigned int id;
 
@@ -172,7 +180,6 @@ static void init_x2apic_ldr(void)
        int cpu = smp_processor_id();
 
        per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR);
-       return;
 }
 
 struct genapic apic_x2apic_cluster = {
@@ -207,7 +214,7 @@ struct genapic apic_x2apic_cluster = {
        .phys_pkg_id                    = x2apic_cluster_phys_pkg_id,
        .mps_oem_check                  = NULL,
 
-       .get_apic_id                    = get_apic_id,
+       .get_apic_id                    = x2apic_cluster_phys_get_apic_id,
        .set_apic_id                    = set_apic_id,
        .apic_id_mask                   = 0xFFFFFFFFu,
 
@@ -221,11 +228,10 @@ struct genapic apic_x2apic_cluster = {
        .send_IPI_self                  = x2apic_send_IPI_self,
 
        .wakeup_cpu                     = NULL,
-       .trampoline_phys_low            = 0,
-       .trampoline_phys_high           = 0,
+       .trampoline_phys_low            = DEFAULT_TRAMPOLINE_PHYS_LOW,
+       .trampoline_phys_high           = DEFAULT_TRAMPOLINE_PHYS_HIGH,
        .wait_for_init_deassert         = NULL,
        .smp_callin_clear_local_apic    = NULL,
        .store_NMI_vector               = NULL,
-       .restore_NMI_vector             = NULL,
        .inquire_remote_apic            = NULL,
 };