summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/memrange.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/memrange.h b/src/include/memrange.h
index a4f7742c5b..759f8f5152 100644
--- a/src/include/memrange.h
+++ b/src/include/memrange.h
@@ -37,6 +37,18 @@ struct range_entry {
struct range_entry *next;
};
+/* Initialize a range_entry with inclusive beginning address and exclusive
+ * end address along with the appropriate tag. */
+static inline void range_entry_init(struct range_entry *re,
+ resource_t incl_begin, resource_t excl_end,
+ unsigned long tag)
+{
+ re->begin = incl_begin;
+ re->end = excl_end - 1;
+ re->tag = tag;
+ re->next = NULL;
+}
+
/* Return inclusive base address of memory range. */
static inline resource_t range_entry_base(const struct range_entry *r)
{