diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-02-19 01:07:32 -0500 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2014-03-04 11:51:04 -0500 |
commit | b683b230a244c3b2b3f6f3292e59d4a63298528b (patch) | |
tree | a63de166724a05b0a5fff0f23ab2dd83ec65d0b7 /include/linux/dmar.h | |
parent | b5f82ddf22725146d926c56ea4cb80df9b34b6b9 (diff) |
iommu/vt-d: Introduce macro for_each_dev_scope() to walk device scope entries
Introduce for_each_dev_scope()/for_each_active_dev_scope() to walk
{active} device scope entries. This will help following RCU lock
related patches.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r-- | include/linux/dmar.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index ea599d4ca9e0..4b77fd8fde76 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -65,6 +65,12 @@ extern struct list_head dmar_drhd_units; | |||
65 | list_for_each_entry(drhd, &dmar_drhd_units, list) \ | 65 | list_for_each_entry(drhd, &dmar_drhd_units, list) \ |
66 | if (i=drhd->iommu, 0) {} else | 66 | if (i=drhd->iommu, 0) {} else |
67 | 67 | ||
68 | #define for_each_dev_scope(a, c, p, d) \ | ||
69 | for ((p) = 0; ((d) = (p) < (c) ? (a)[(p)] : NULL, (p) < (c)); (p)++) | ||
70 | |||
71 | #define for_each_active_dev_scope(a, c, p, d) \ | ||
72 | for_each_dev_scope((a), (c), (p), (d)) if (!(d)) { continue; } else | ||
73 | |||
68 | extern int dmar_table_init(void); | 74 | extern int dmar_table_init(void); |
69 | extern int dmar_dev_scope_init(void); | 75 | extern int dmar_dev_scope_init(void); |
70 | extern int dmar_parse_dev_scope(void *start, void *end, int *cnt, | 76 | extern int dmar_parse_dev_scope(void *start, void *end, int *cnt, |