]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/kernel/acpi.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / arch / ia64 / kernel / acpi.c
index ca16d9556bdefa0a96ed5d60992955b407b42cb9..29f05d4b68cdd7f17911f8b840838faa795be2c4 100644 (file)
@@ -32,7 +32,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -56,7 +55,7 @@
 
 #define BAD_MADT_ENTRY(entry, end) (                                        \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
-               ((acpi_table_entry_header *)entry)->length != sizeof(*entry))
+               ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
 
 #define PREFIX                 "ACPI: "
 
@@ -65,9 +64,6 @@ EXPORT_SYMBOL(pm_idle);
 void (*pm_power_off) (void);
 EXPORT_SYMBOL(pm_power_off);
 
-unsigned char acpi_kbd_controller_present = 1;
-unsigned char acpi_legacy_devices;
-
 unsigned int acpi_cpei_override;
 unsigned int acpi_cpei_phys_cpuid;
 
@@ -594,6 +590,9 @@ void __init acpi_numa_arch_fixup(void)
  */
 int acpi_register_gsi(u32 gsi, int triggering, int polarity)
 {
+       if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM)
+               return gsi;
+
        if (has_8259 && gsi < 16)
                return isa_irq_to_vector(gsi);
 
@@ -610,6 +609,9 @@ EXPORT_SYMBOL(acpi_register_gsi);
 
 void acpi_unregister_gsi(u32 gsi)
 {
+       if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM)
+               return;
+
        iosapic_unregister_intr(gsi);
 }
 
@@ -629,12 +631,6 @@ static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
 
        fadt = (struct fadt_descriptor *)fadt_header;
 
-       if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
-               acpi_kbd_controller_present = 0;
-
-       if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
-               acpi_legacy_devices = 1;
-
        acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
        return 0;
 }
@@ -772,16 +768,19 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
 {
 #ifdef CONFIG_ACPI_NUMA
        int pxm_id;
+       int nid;
 
        pxm_id = acpi_get_pxm(handle);
-
        /*
-        * Assuming that the container driver would have set the proximity
-        * domain and would have initialized pxm_to_node(pxm_id) && pxm_flag
+        * We don't have cpu-only-node hotadd. But if the system equips
+        * SRAT table, pxm is already found and node is ready.
+        * So, just pxm_to_nid(pxm) is OK.
+        * This code here is for the system which doesn't have full SRAT
+        * table for possible cpus.
         */
-       node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_node(pxm_id);
-
+       nid = acpi_map_pxm_to_node(pxm_id);
        node_cpuid[cpu].phys_id = physid;
+       node_cpuid[cpu].nid = nid;
 #endif
        return (0);
 }
@@ -857,7 +856,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*lsapic)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return -EINVAL;
        }
 
@@ -865,13 +864,13 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 
        if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
            (!lsapic->flags.enabled)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return -EINVAL;
        }
 
        physid = ((lsapic->id << 8) | (lsapic->eid));
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
        buffer.length = ACPI_ALLOCATE_BUFFER;
        buffer.pointer = NULL;
 
@@ -935,20 +934,20 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*iosapic)) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return AE_OK;
        }
 
        iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer;
 
        if (iosapic->header.type != ACPI_MADT_IOSAPIC) {
-               acpi_os_free(buffer.pointer);
+               kfree(buffer.pointer);
                return AE_OK;
        }
 
        gsi_base = iosapic->global_irq_base;
 
-       acpi_os_free(buffer.pointer);
+       kfree(buffer.pointer);
 
        /*
         * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell