]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/genx2apic_uv_x.c
Merge branch 'linus' into x86/apic
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / genx2apic_uv_x.c
index c8a89158679967b8a5bd24e785ebcd0cda59aafa..6adb5e6f4d92ccb4472927b0ec571888f9590be2 100644 (file)
@@ -118,12 +118,13 @@ static void uv_send_IPI_one(int cpu, int vector)
        int pnode;
 
        apicid = per_cpu(x86_cpu_to_apicid, cpu);
-       lapicid = apicid & 0x3f;                /* ZZZ macro needed */
+       lapicid = apicid & 0x3f; /* ZZZ macro needed */
        pnode = uv_apicid_to_pnode(apicid);
-       val =
-           (1UL << UVH_IPI_INT_SEND_SHFT) | (lapicid <<
-                                             UVH_IPI_INT_APIC_ID_SHFT) |
-           (vector << UVH_IPI_INT_VECTOR_SHFT);
+
+       val = (     1UL << UVH_IPI_INT_SEND_SHFT    ) |
+             ( lapicid << UVH_IPI_INT_APIC_ID_SHFT ) |
+             (  vector << UVH_IPI_INT_VECTOR_SHFT  );
+
        uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
 }
 
@@ -137,22 +138,24 @@ static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
 
 static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
 {
-       unsigned int cpu;
        unsigned int this_cpu = smp_processor_id();
+       unsigned int cpu;
 
-       for_each_cpu(cpu, mask)
+       for_each_cpu(cpu, mask) {
                if (cpu != this_cpu)
                        uv_send_IPI_one(cpu, vector);
+       }
 }
 
 static void uv_send_IPI_allbutself(int vector)
 {
-       unsigned int cpu;
        unsigned int this_cpu = smp_processor_id();
+       unsigned int cpu;
 
-       for_each_online_cpu(cpu)
+       for_each_online_cpu(cpu) {
                if (cpu != this_cpu)
                        uv_send_IPI_one(cpu, vector);
+       }
 }
 
 static void uv_send_IPI_all(int vector)
@@ -171,21 +174,21 @@ static void uv_init_apic_ldr(void)
 
 static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
-       int cpu;
-
        /*
         * We're using fixed IRQ delivery, can only return one phys 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_apicid, cpu);
        else
                return BAD_APICID;
 }
 
-static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
-                                             const struct cpumask *andmask)
+static unsigned int
+uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
+                         const struct cpumask *andmask)
 {
        int cpu;
 
@@ -193,15 +196,17 @@ static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one phys 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_apicid, cpu);
+
        return BAD_APICID;
 }
 
-static unsigned int get_apic_id(unsigned long x)
+static unsigned int x2apic_get_apic_id(unsigned long x)
 {
        unsigned int id;
 
@@ -223,10 +228,10 @@ static unsigned long set_apic_id(unsigned int id)
 static unsigned int uv_read_apic_id(void)
 {
 
-       return get_apic_id(apic_read(APIC_ID));
+       return x2apic_get_apic_id(apic_read(APIC_ID));
 }
 
-static unsigned int phys_pkg_id(int index_msb)
+static int uv_phys_pkg_id(int initial_apicid, int index_msb)
 {
        return uv_read_apic_id() >> index_msb;
 }
@@ -252,9 +257,6 @@ struct genapic apic_x2apic_uv_x = {
        .check_apicid_used              = NULL,
        .check_apicid_present           = NULL,
 
-       .no_balance_irq                 = 0,
-       .no_ioapic_check                = 0,
-
        .vector_allocation_domain       = uv_vector_allocation_domain,
        .init_apic_ldr                  = uv_init_apic_ldr,
 
@@ -263,15 +265,15 @@ struct genapic apic_x2apic_uv_x = {
        .multi_timer_check              = NULL,
        .apicid_to_node                 = NULL,
        .cpu_to_logical_apicid          = NULL,
-       .cpu_present_to_apicid          = NULL,
+       .cpu_present_to_apicid          = default_cpu_present_to_apicid,
        .apicid_to_cpu_present          = NULL,
        .setup_portio_remap             = NULL,
-       .check_phys_apicid_present      = NULL,
+       .check_phys_apicid_present      = default_check_phys_apicid_present,
        .enable_apic_mode               = NULL,
-       .phys_pkg_id                    = phys_pkg_id,
+       .phys_pkg_id                    = uv_phys_pkg_id,
        .mps_oem_check                  = NULL,
 
-       .get_apic_id                    = get_apic_id,
+       .get_apic_id                    = x2apic_get_apic_id,
        .set_apic_id                    = set_apic_id,
        .apic_id_mask                   = 0xFFFFFFFFu,
 
@@ -285,12 +287,11 @@ struct genapic apic_x2apic_uv_x = {
        .send_IPI_self                  = uv_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,
 };