From: David Woodhouse Date: Fri, 3 Apr 2009 14:19:32 +0000 (+0100) Subject: intel-iommu: Add for_each_iommu() and for_each_active_iommu() macros X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=8f912ba4d7cdaf7d31cf39fe5a9b7732308a256d;p=deliverable%2Flinux.git intel-iommu: Add for_each_iommu() and for_each_active_iommu() macros Signed-off-by: David Woodhouse Acked-by: Ingo Molnar --- diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 2f3427468956..0b4aa8069985 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h @@ -44,6 +44,14 @@ extern struct list_head dmar_drhd_units; #define for_each_drhd_unit(drhd) \ 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_dev_scope_init(void);