Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13956
-gerrit
commit 4d252e6c06782a7d0739ae5191752228d85d9680 Author: Aaron Durbin adurbin@chromium.org Date: Tue Mar 8 10:47:18 2016 -0600
lib/memrange: add function to initialize range_entry
In order to enforce the semantics of struct range_entry provide an init function, range_entry_init(), which performs the field initialization to adhere to the internal struture's assumptions.
Change-Id: I24b9296e5bcf4775974c9a8d6326717608190215 Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/include/memrange.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/src/include/memrange.h b/src/include/memrange.h index a4f7742..759f8f5 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) {