vserver 1.9.3
[linux-2.6.git] / arch / i386 / kernel / acpi / boot.c
index 2c53ca5..8a05362 100644 (file)
@@ -28,7 +28,9 @@
 #include <linux/acpi.h>
 #include <linux/efi.h>
 #include <linux/irq.h>
-#include <asm/pgalloc.h>
+#include <linux/module.h>
+
+#include <asm/pgtable.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
 #include <asm/io.h>
@@ -69,6 +71,7 @@ int acpi_ht __initdata = 1;   /* enable HT */
 int acpi_lapic;
 int acpi_ioapic;
 int acpi_strict;
+EXPORT_SYMBOL(acpi_strict);
 
 acpi_interrupt_flags acpi_sci_flags __initdata;
 int acpi_sci_override_gsi __initdata;
@@ -82,6 +85,11 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 #warning ACPI uses CMPXCHG, i486 and later hardware
 #endif
 
+#define MAX_MADT_ENTRIES       256
+u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
+                       { [0 ... MAX_MADT_ENTRIES-1] = 0xff };
+EXPORT_SYMBOL(x86_acpiid_to_apicid);
+
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -139,7 +147,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
        idx = FIX_ACPI_END;
        while (mapped_size < size) {
                if (--idx < FIX_ACPI_BEGIN)
-                       return 0;       /* cannot handle this */
+                       return NULL;    /* cannot handle this */
                phys += PAGE_SIZE;
                set_fixmap(idx, phys);
                mapped_size += PAGE_SIZE;
@@ -223,6 +231,8 @@ acpi_parse_lapic (
        if (processor->flags.enabled == 0)
                return 0;
 
+       x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
+
        mp_register_lapic (
                processor->id,                                     /* APIC ID */
                processor->flags.enabled);                        /* Enabled? */
@@ -437,6 +447,38 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
        return 0;
 }
 
+unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
+{
+       unsigned int irq;
+
+#ifdef CONFIG_PCI
+       /*
+        * Make sure all (legacy) PCI IRQs are set as level-triggered.
+        */
+       if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
+               static u16 irq_mask;
+               extern void eisa_set_level_irq(unsigned int irq);
+
+               if (edge_level == ACPI_LEVEL_SENSITIVE) {
+                       if ((gsi < 16) && !((1 << gsi) & irq_mask)) {
+                               Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi);
+                               irq_mask |= (1 << gsi);
+                               eisa_set_level_irq(gsi);
+                       }
+               }
+       }
+#endif
+
+#ifdef CONFIG_X86_IO_APIC
+       if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) {
+               mp_register_gsi(gsi, edge_level, active_high_low);
+       }
+#endif
+       acpi_gsi_to_irq(gsi, &irq);
+       return irq;
+}
+EXPORT_SYMBOL(acpi_register_gsi);
+
 static unsigned long __init
 acpi_scan_rsdp (
        unsigned long           start,
@@ -526,7 +568,7 @@ extern u32 pmtmr_ioport;
 
 static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
 {
-       struct fadt_descriptor_rev2 *fadt =0;
+       struct fadt_descriptor_rev2 *fadt = NULL;
 
        fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
        if(!fadt) {
@@ -788,9 +830,15 @@ acpi_boot_init (void)
         */
        error = acpi_blacklisted();
        if (error) {
-               printk(KERN_WARNING PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
-               disable_acpi();
-               return error;
+               extern int acpi_force;
+
+               if (acpi_force) {
+                       printk(KERN_WARNING PREFIX "acpi=force override\n");
+               } else {
+                       printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
+                       disable_acpi();
+                       return error;
+               }
        }
 
        /*