]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/genx2apic_cluster.c
Merge branch 'next' into for-linus
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / genx2apic_cluster.c
index ed0fdede800ab4c843de437c43cf0432646c9529..e4bf2cc0d743998b069925574ff93c559f7c24f3 100644 (file)
@@ -4,12 +4,22 @@
 #include <linux/kernel.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
+#include <linux/dmar.h>
+
 #include <asm/smp.h>
 #include <asm/ipi.h>
 #include <asm/genapic.h>
 
 DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid);
 
+static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+       if (cpu_has_x2apic)
+               return 1;
+
+       return 0;
+}
+
 /* Start with all IRQs pointing to boot CPU.  IRQ balancing will shift them. */
 
 static cpumask_t x2apic_target_cpus(void)
@@ -94,14 +104,25 @@ static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask)
                return BAD_APICID;
 }
 
-static unsigned int x2apic_read_id(void)
+static unsigned int get_apic_id(unsigned long x)
 {
-       return apic_read(APIC_ID);
+       unsigned int id;
+
+       id = x;
+       return id;
+}
+
+static unsigned long set_apic_id(unsigned int id)
+{
+       unsigned long x;
+
+       x = id;
+       return x;
 }
 
 static unsigned int phys_pkg_id(int index_msb)
 {
-       return x2apic_read_id() >> index_msb;
+       return current_cpu_data.initial_apicid >> index_msb;
 }
 
 static void x2apic_send_IPI_self(int vector)
@@ -119,6 +140,7 @@ static void init_x2apic_ldr(void)
 
 struct genapic apic_x2apic_cluster = {
        .name = "cluster x2apic",
+       .acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
        .int_delivery_mode = dest_LowestPrio,
        .int_dest_mode = (APIC_DEST_LOGICAL != 0),
        .target_cpus = x2apic_target_cpus,
@@ -131,5 +153,7 @@ struct genapic apic_x2apic_cluster = {
        .send_IPI_self = x2apic_send_IPI_self,
        .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
        .phys_pkg_id = phys_pkg_id,
-       .read_apic_id = x2apic_read_id,
+       .get_apic_id = get_apic_id,
+       .set_apic_id = set_apic_id,
+       .apic_id_mask = (0xFFFFFFFFu),
 };