aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/memrange.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/include/memrange.h b/src/include/memrange.h
index 4f094f593e..ba85bef4d9 100644
--- a/src/include/memrange.h
+++ b/src/include/memrange.h
@@ -94,6 +94,19 @@ void memranges_add_resources(struct memranges *ranges,
unsigned long mask, unsigned long match,
unsigned long tag);
+/* Add memory resources that match with the corresponding mask and match but
+ * also provide filter as additional check. The filter will return non-zero
+ * to add the resource or zero to not add the resource. Each entry will be
+ * tagged with the provided tag. e.g. To populate all cacheable memory
+ * resources in the range with a filter:
+ * memranges_add_resources_filter(range, IORESOURCE_CACHEABLE,
+ * IORESROUCE_CACHEABLE, my_cacheable_tag, filter); */
+typedef int (*memrange_filter_t)(struct device *dev, struct resource *res);
+void memranges_add_resources_filter(struct memranges *ranges,
+ unsigned long mask, unsigned long match,
+ unsigned long tag,
+ memrange_filter_t filter);
+
/* Fill all address ranges up to limit (exclusive) not covered by an entry by
* inserting new entries with the provided tag. */
void memranges_fill_holes_up_to(struct memranges *ranges,