瀏覽代碼

intel-iommu: Add for_each_iommu() and for_each_active_iommu() macros

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
David Woodhouse 16 年之前
父節點
當前提交
8f912ba4d7
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      include/linux/dmar.h

+ 8 - 0
include/linux/dmar.h

@@ -44,6 +44,14 @@ extern struct list_head dmar_drhd_units;
 #define for_each_drhd_unit(drhd) \
 #define for_each_drhd_unit(drhd) \
 	list_for_each_entry(drhd, &dmar_drhd_units, list)
 	list_for_each_entry(drhd, &dmar_drhd_units, list)
 
 
+#define for_each_active_iommu(i, drhd)					\
+	list_for_each_entry(drhd, &dmar_drhd_units, list)		\
+		if (i=drhd->iommu, drhd->ignored) {} else
+
+#define for_each_iommu(i, drhd)						\
+	list_for_each_entry(drhd, &dmar_drhd_units, list)		\
+		if (i=drhd->iommu, 0) {} else 
+
 extern int dmar_table_init(void);
 extern int dmar_table_init(void);
 extern int dmar_dev_scope_init(void);
 extern int dmar_dev_scope_init(void);