Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[sfrench/cifs-2.6.git] / arch / i386 / kernel / acpi / boot.c
index 79577f0ace98847ee39a4f7ad4c9842f3ea88ec6..049a25583793a26cd85201a0e69a190880fa24c7 100644 (file)
@@ -215,7 +215,7 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 {
        struct acpi_table_madt *madt = NULL;
 
-       if (!phys_addr || !size)
+       if (!phys_addr || !size || !cpu_has_apic)
                return -EINVAL;
 
        madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
@@ -668,10 +668,10 @@ unsigned long __init acpi_find_rsdp(void)
        unsigned long rsdp_phys = 0;
 
        if (efi_enabled) {
-               if (efi.acpi20)
-                       return __pa(efi.acpi20);
-               else if (efi.acpi)
-                       return __pa(efi.acpi);
+               if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+                       return efi.acpi20;
+               else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+                       return efi.acpi;
        }
        /*
         * Scan memory looking for the RSDP signature. First search EBDA (low
@@ -693,6 +693,9 @@ static int __init acpi_parse_madt_lapic_entries(void)
 {
        int count;
 
+       if (!cpu_has_apic)
+               return -ENODEV;
+
        /* 
         * Note that the LAPIC address is obtained from the MADT (32-bit value)
         * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
@@ -751,6 +754,9 @@ static int __init acpi_parse_madt_ioapic_entries(void)
                return -ENODEV;
        }
 
+       if (!cpu_has_apic)
+               return -ENODEV;
+
        /*
         * if "noapic" boot option, don't look for IO-APICs
         */
@@ -1096,6 +1102,9 @@ int __init acpi_boot_table_init(void)
        dmi_check_system(acpi_dmi_table);
 #endif
 
+       if (!cpu_has_apic)
+               return -ENODEV;
+
        /*
         * If acpi_disabled, bail out
         * One exception: acpi=ht continues far enough to enumerate LAPICs
@@ -1111,9 +1120,6 @@ int __init acpi_boot_table_init(void)
                disable_acpi();
                return error;
        }
-#ifdef __i386__
-       check_acpi_pci();
-#endif
 
        acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);