x86: Move get/find_smp_config to x86_init_ops
[deliverable/linux.git] / arch / x86 / kernel / apic / numaq_32.c
index ba2fc6465534e1cd588edd124b7943098ed2c4c8..3dd5fd7653412e1e96814397b1bea6a2449a4b92 100644 (file)
@@ -66,7 +66,6 @@ struct mpc_trans {
        unsigned short                  trans_reserved;
 };
 
-/* x86_quirks member */
 static int                             mpc_record;
 
 static struct mpc_trans                        *translation_table[MAX_MPC_ENTRY];
@@ -177,6 +176,19 @@ static void mpc_oem_pci_bus(struct mpc_bus *m)
        quad_local_to_mp_bus_id[quad][local] = m->busid;
 }
 
+/*
+ * Called from mpparse code.
+ * mode = 0: prescan
+ * mode = 1: one mpc entry scanned
+ */
+static void numaq_mpc_record(unsigned int mode)
+{
+       if (!mode)
+               mpc_record = 0;
+       else
+               mpc_record++;
+}
+
 static void __init MP_translation_info(struct mpc_trans *m)
 {
        printk(KERN_INFO
@@ -206,9 +218,9 @@ static int __init mpf_checksum(unsigned char *mp, int len)
 /*
  * Read/parse the MPC oem tables
  */
-static void __init
- smp_read_mpc_oem(struct mpc_oemtable *oemtable, unsigned short oemsize)
+static void __init smp_read_mpc_oem(struct mpc_table *mpc)
 {
+       struct mpc_oemtable *oemtable = (void *)(long)mpc->oemptr;
        int count = sizeof(*oemtable);  /* the header size */
        unsigned char *oemptr = ((unsigned char *)oemtable) + count;
 
@@ -250,27 +262,12 @@ static void __init
        }
 }
 
-static int __init numaq_setup_ioapic_ids(void)
-{
-       /* so can skip it */
-       return 1;
-}
-
 static struct x86_quirks numaq_x86_quirks __initdata = {
        .arch_pre_time_init             = numaq_pre_time_init,
        .arch_time_init                 = NULL,
        .arch_pre_intr_init             = NULL,
-       .arch_memory_setup              = NULL,
        .arch_intr_init                 = NULL,
        .arch_trap_init                 = NULL,
-       .mach_get_smp_config            = NULL,
-       .mach_find_smp_config           = NULL,
-       .mpc_record                     = &mpc_record,
-       .mpc_apic_id                    = mpc_apic_id,
-       .mpc_oem_bus_info               = mpc_oem_bus_info,
-       .mpc_oem_pci_bus                = mpc_oem_pci_bus,
-       .smp_read_mpc_oem               = smp_read_mpc_oem,
-       .setup_ioapic_ids               = numaq_setup_ioapic_ids,
 };
 
 static __init void early_check_numaq(void)
@@ -286,8 +283,15 @@ static __init void early_check_numaq(void)
        if (smp_found_config)
                early_get_smp_config();
 
-       if (found_numaq)
+       if (found_numaq) {
                x86_quirks = &numaq_x86_quirks;
+               x86_init.mpparse.mpc_record = numaq_mpc_record;
+               x86_init.mpparse.setup_ioapic_ids = x86_init_noop;
+               x86_init.mpparse.mpc_apic_id = mpc_apic_id;
+               x86_init.mpparse.smp_read_mpc_oem = smp_read_mpc_oem;
+               x86_init.mpparse.mpc_oem_pci_bus = mpc_oem_pci_bus;
+               x86_init.mpparse.mpc_oem_bus_info = mpc_oem_bus_info;
+       }
 }
 
 int __init get_memcfg_numaq(void)
@@ -334,9 +338,9 @@ static inline void numaq_smp_callin_clear_local_apic(void)
        clear_local_APIC();
 }
 
-static inline const cpumask_t *numaq_target_cpus(void)
+static inline const struct cpumask *numaq_target_cpus(void)
 {
-       return &CPU_MASK_ALL;
+       return cpu_all_mask;
 }
 
 static inline unsigned long
@@ -427,7 +431,7 @@ static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
  * We use physical apicids here, not logical, so just return the default
  * physical broadcast to stop people from breaking us
  */
-static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
+static unsigned int numaq_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
        return 0x0F;
 }
@@ -462,7 +466,7 @@ static int probe_numaq(void)
        return found_numaq;
 }
 
-static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
+static void numaq_vector_allocation_domain(int cpu, struct cpumask *retmask)
 {
        /* Careful. Some cpus do not strictly honor the set of cpus
         * specified in the interrupt destination when using lowest
@@ -472,7 +476,8 @@ static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
         * deliver interrupts to the wrong hyperthread when only one
         * hyperthread was specified in the interrupt desitination.
         */
-       *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
+       cpumask_clear(retmask);
+       cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
 }
 
 static void numaq_setup_portio_remap(void)
@@ -492,7 +497,8 @@ static void numaq_setup_portio_remap(void)
                (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
 }
 
-struct apic apic_numaq = {
+/* Use __refdata to keep false positive warning calm.  */
+struct apic __refdata apic_numaq = {
 
        .name                           = "NUMAQ",
        .probe                          = probe_numaq,
This page took 0.026402 seconds and 5 git commands to generate.