cpqarray: switch to seq_file
[safe/jmp/linux-2.6] / drivers / pci / dmar.c
index 3264b62..14bbaa1 100644 (file)
 #include <linux/timer.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/tboot.h>
+#include <linux/dmi.h>
 
-#undef PREFIX
-#define PREFIX "DMAR:"
+#define PREFIX "DMAR: "
 
 /* No locks are needed as DMA remapping hardware unit
  * list is constructed at boot time and hotplug of
@@ -413,6 +414,12 @@ parse_dmar_table(void)
         */
        dmar_table_detect();
 
+       /*
+        * ACPI tables may not be DMA protected by tboot, so use DMAR copy
+        * SINIT saved in SinitMleData in TXT heap (which is DMA protected)
+        */
+       dmar_tbl = tboot_get_dmar_table(dmar_tbl);
+
        dmar = (struct acpi_table_dmar *)dmar_tbl;
        if (!dmar)
                return -ENODEV;
@@ -570,9 +577,6 @@ int __init dmar_table_init(void)
                printk(KERN_INFO PREFIX "No ATSR found\n");
 #endif
 
-#ifdef CONFIG_INTR_REMAP
-       parse_ioapics_under_ir();
-#endif
        return 0;
 }
 
@@ -1319,3 +1323,13 @@ int dmar_reenable_qi(struct intel_iommu *iommu)
 
        return 0;
 }
+
+/*
+ * Check interrupt remapping support in DMAR table description.
+ */
+int dmar_ir_support(void)
+{
+       struct acpi_table_dmar *dmar;
+       dmar = (struct acpi_table_dmar *)dmar_tbl;
+       return dmar->flags & 0x1;
+}