x86, apic: Introduce the NOOP apic driver
[safe/jmp/linux-2.6] / arch / x86 / kernel / apic / es7000_32.c
index 4d8830f..89174f8 100644 (file)
@@ -145,7 +145,7 @@ es7000_rename_gsi(int ioapic, int gsi)
        return gsi;
 }
 
-static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
+static int __cpuinit wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
 {
        unsigned long vect = 0, psaival = 0;
 
@@ -163,17 +163,17 @@ static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
        return 0;
 }
 
-static int __init es7000_apic_is_cluster(void)
+static int es7000_apic_is_cluster(void)
 {
        /* MPENTIUMIII */
        if (boot_cpu_data.x86 == 6 &&
-           (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11))
+           (boot_cpu_data.x86_model >= 7 && boot_cpu_data.x86_model <= 11))
                return 1;
 
        return 0;
 }
 
-static void __init setup_unisys(void)
+static void setup_unisys(void)
 {
        /*
         * Determine the generation of the ES7000 currently running.
@@ -192,7 +192,7 @@ static void __init setup_unisys(void)
 /*
  * Parse the OEM Table:
  */
-static int __init parse_unisys_oem(char *oemptr)
+static int parse_unisys_oem(char *oemptr)
 {
        int                     i;
        int                     success = 0;
@@ -303,7 +303,7 @@ static int es7000_check_dsdt(void)
        return 0;
 }
 
-static int __initdata es7000_acpi_ret;
+static int es7000_acpi_ret;
 
 /* Hook from generic ACPI tables.c */
 static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
@@ -333,8 +333,7 @@ static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
        return ret && !es7000_apic_is_cluster();
 }
 
-static int __init
-es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
+static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
 {
        int ret = es7000_acpi_ret;
 
@@ -342,13 +341,12 @@ es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
 }
 
 #else /* !CONFIG_ACPI: */
-static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static int es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
        return 0;
 }
 
-static int __init
-es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
+static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
 {
        return 0;
 }
@@ -362,8 +360,7 @@ static void es7000_spin(int n)
                rep_nop();
 }
 
-static int __init
-es7000_mip_write(struct mip_reg *mip_reg)
+static int es7000_mip_write(struct mip_reg *mip_reg)
 {
        int status = 0;
        int spin;
@@ -396,7 +393,7 @@ es7000_mip_write(struct mip_reg *mip_reg)
        return status;
 }
 
-static void __init es7000_enable_apic_mode(void)
+static void es7000_enable_apic_mode(void)
 {
        struct mip_reg es7000_mip_reg;
        int mip_status;
@@ -413,7 +410,7 @@ static void __init es7000_enable_apic_mode(void)
                WARN(1, "Command failed, status = %x\n", mip_status);
 }
 
-static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
+static void es7000_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
@@ -423,7 +420,8 @@ static void es7000_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;
 }
 
 
@@ -458,14 +456,14 @@ static int es7000_apic_id_registered(void)
        return 1;
 }
 
-static const cpumask_t *target_cpus_cluster(void)
+static const struct cpumask *target_cpus_cluster(void)
 {
-       return &CPU_MASK_ALL;
+       return cpu_all_mask;
 }
 
-static const cpumask_t *es7000_target_cpus(void)
+static const struct cpumask *es7000_target_cpus(void)
 {
-       return &cpumask_of_cpu(smp_processor_id());
+       return cpumask_of(smp_processor_id());
 }
 
 static unsigned long
@@ -520,7 +518,7 @@ static void es7000_setup_apic_routing(void)
          "Enabling APIC mode:  %s. Using %d I/O APICs, target cpus %lx\n",
                (apic_version[apic] == 0x14) ?
                        "Physical Cluster" : "Logical Cluster",
-               nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
+               nr_ioapics, cpumask_bits(es7000_target_cpus())[0]);
 }
 
 static int es7000_apicid_to_node(int logical_apicid)
@@ -575,7 +573,7 @@ static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
        return 1;
 }
 
-static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
+static unsigned int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask)
 {
        unsigned int round = 0;
        int cpu, uninitialized_var(apicid);
@@ -627,9 +625,9 @@ static int probe_es7000(void)
        return 0;
 }
 
-static int __initdata es7000_mps_ret;
-static __init int
-es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
+static int es7000_mps_ret;
+static int es7000_mps_oem_check(struct mpc_table *mpc, char *oem,
+               char *productid)
 {
        int ret = 0;
 
@@ -646,15 +644,16 @@ es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
        return ret && !es7000_apic_is_cluster();
 }
 
-static __init int
-es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem, char *productid)
+static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
+               char *productid)
 {
        int ret = es7000_mps_ret;
 
        return ret && es7000_apic_is_cluster();
 }
 
-struct apic apic_es7000_cluster = {
+/* We've been warned by a false positive warning.Use __refdata to keep calm. */
+struct apic __refdata apic_es7000_cluster = {
 
        .name                           = "es7000",
        .probe                          = probe_es7000,
@@ -719,7 +718,7 @@ struct apic apic_es7000_cluster = {
        .safe_wait_icr_idle             = native_safe_apic_wait_icr_idle,
 };
 
-struct apic apic_es7000 = {
+struct apic __refdata apic_es7000 = {
 
        .name                           = "es7000",
        .probe                          = probe_es7000,