summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-03-12 16:43:49 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-03-17 08:18:52 +0000
commit2190a632e0942455f572bb408077670e3280c4e5 (patch)
treea0a9fa1cfa8a1bdc5f89d40019e44d24f07ed56d /src/include
parent9c6274cd8fb1c9ee0eb674ce5945a05f818cb32e (diff)
downloadcoreboot-2190a632e0942455f572bb408077670e3280c4e5.tar.xz
memrange: Add a helper function to determine if memranges is empty
This change adds a helper function memranges_is_empty() which returns true if there are no entries in memranges. BUG=b:149186922 Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: If841c42a9722cbc73ef321568928bc175bf88fd5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/39485 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/memrange.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/memrange.h b/src/include/memrange.h
index f8fa033cee..ea3b118d41 100644
--- a/src/include/memrange.h
+++ b/src/include/memrange.h
@@ -81,6 +81,11 @@ static inline void range_entry_update_tag(struct range_entry *r,
r->tag = new_tag;
}
+static inline bool memranges_is_empty(struct memranges *ranges)
+{
+ return ranges->entries == NULL;
+}
+
/* Iterate over each entry in a memranges structure. Ranges cannot
* be deleted while processing each entry as the list cannot be safely
* traversed after such an operation.