[ACPI] Merge acpi-2.6.12 branch into 2.6.13-rc3
[linux-3.10.git] / arch / ia64 / kernel / acpi.c
index 7513ff9361a00bd50b388f838c6f20324171b090..d362ecf5381bc8681d171e8dd922913221cd9192 100644 (file)
@@ -242,9 +242,7 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
        if (BAD_MADT_ENTRY(iosapic, end))
                return -EINVAL;
 
-       iosapic_init(iosapic->address, iosapic->global_irq_base);
-
-       return 0;
+       return iosapic_init(iosapic->address, iosapic->global_irq_base);
 }
 
 
@@ -700,8 +698,10 @@ acpi_boot_init (void)
                        if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
                                node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
        }
-       build_cpu_to_node_map();
 # endif
+#endif
+#ifdef CONFIG_ACPI_NUMA
+       build_cpu_to_node_map();
 #endif
        /* Make boot-up look pretty */
        printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
@@ -830,7 +830,7 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);
  
 
 #ifdef CONFIG_ACPI_NUMA
-acpi_status __init
+acpi_status __devinit
 acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
 {
        struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -883,4 +883,28 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
        return AE_OK;
 }
 #endif /* CONFIG_NUMA */
+
+int
+acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
+{
+       int err;
+
+       if ((err = iosapic_init(phys_addr, gsi_base)))
+               return err;
+
+#if CONFIG_ACPI_NUMA
+       acpi_map_iosapic(handle, 0, NULL, NULL);
+#endif /* CONFIG_ACPI_NUMA */
+
+       return 0;
+}
+EXPORT_SYMBOL(acpi_register_ioapic);
+
+int
+acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
+{
+       return iosapic_remove(gsi_base);
+}
+EXPORT_SYMBOL(acpi_unregister_ioapic);
+
 #endif /* CONFIG_ACPI_BOOT */