]> err.no Git - linux-2.6/blobdiff - arch/i386/kernel/acpi/boot.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
[linux-2.6] / arch / i386 / kernel / acpi / boot.c
index 8a6c5b412348385384353dbdca4e867afad25303..92f79cdd9a48c97aebb8a207a211cf28e421707a 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/module.h>
 #include <linux/dmi.h>
 #include <linux/irq.h>
+#include <linux/bootmem.h>
+#include <linux/ioport.h>
 
 #include <asm/pgtable.h>
 #include <asm/io_apic.h>
@@ -60,8 +62,6 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
 #include <mach_mpparse.h>
 #endif                         /* CONFIG_X86_LOCAL_APIC */
 
-static inline int gsi_irq_sharing(int gsi) { return gsi; }
-
 #endif                         /* X86 */
 
 #define BAD_MADT_ENTRY(entry, end) (                                       \
@@ -466,12 +466,7 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
-#ifdef CONFIG_X86_IO_APIC
-       if (use_pci_vector() && !platform_legacy_irq(gsi))
-               *irq = IO_APIC_VECTOR(gsi);
-       else
-#endif
-               *irq = gsi_irq_sharing(gsi);
+       *irq = gsi;
        return 0;
 }
 
@@ -646,6 +641,8 @@ static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
 static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
 {
        struct acpi_table_hpet *hpet_tbl;
+       struct resource *hpet_res;
+       resource_size_t res_start;
 
        if (!phys || !size)
                return -EINVAL;
@@ -661,12 +658,26 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
                       "memory.\n");
                return -1;
        }
+
+#define HPET_RESOURCE_NAME_SIZE 9
+       hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE);
+       if (hpet_res) {
+               memset(hpet_res, 0, sizeof(*hpet_res));
+               hpet_res->name = (void *)&hpet_res[1];
+               hpet_res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+               snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE,
+                        "HPET %u", hpet_tbl->number);
+               hpet_res->end = (1 * 1024) - 1;
+       }
+
 #ifdef CONFIG_X86_64
        vxtime.hpet_address = hpet_tbl->addr.addrl |
            ((long)hpet_tbl->addr.addrh << 32);
 
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
               hpet_tbl->id, vxtime.hpet_address);
+
+       res_start = vxtime.hpet_address;
 #else                          /* X86 */
        {
                extern unsigned long hpet_address;
@@ -674,9 +685,17 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
                hpet_address = hpet_tbl->addr.addrl;
                printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
                       hpet_tbl->id, hpet_address);
+
+               res_start = hpet_address;
        }
 #endif                         /* X86 */
 
+       if (hpet_res) {
+               hpet_res->start = res_start;
+               hpet_res->end += res_start;
+               insert_resource(&iomem_resource, hpet_res);
+       }
+
        return 0;
 }
 #else