summaryrefslogtreecommitdiff
path: root/include/lmb.h
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2021-05-07 15:50:30 +0300
committerTom Rini <trini@konsulko.com>2021-06-07 17:48:40 +0300
commite359a4a5c1f01add83b8f39f5da0c61ce51e918a (patch)
tree90fcf2541a1902a7a3be3ec425ffbeb517c8f9b9 /include/lmb.h
parent59c0ea5df33fc4d9b62226d29e3b5c61d639303f (diff)
downloadu-boot-e359a4a5c1f01add83b8f39f5da0c61ce51e918a.tar.xz
lmb: add lmb_is_reserved_flags
Add a new function lmb_is_reserved_flags to check if an address is reserved with a specific flags. This function can be used to check if an address was reserved with no-map flags with: lmb_is_reserved_flags(lmb, addr, LMB_NOMAP); Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'include/lmb.h')
-rw-r--r--include/lmb.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/lmb.h b/include/lmb.h
index e900b3dd65..3c4afdf9f0 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -100,6 +100,15 @@ extern phys_addr_t lmb_alloc_addr(struct lmb *lmb, phys_addr_t base,
phys_size_t size);
extern phys_size_t lmb_get_free_size(struct lmb *lmb, phys_addr_t addr);
extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr);
+/**
+ * lmb_is_reserved_flags - test if tha address is in reserved region with a bitfield flag
+ *
+ * @lmb the logical memory block struct
+ * @addr address to be tested
+ * @flags flags bitfied to be tested
+ * @return 0 if not reserved or reserved without the requested flag else 1
+ */
+int lmb_is_reserved_flags(struct lmb *lmb, phys_addr_t addr, int flags);
extern long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size);
extern void lmb_dump_all(struct lmb *lmb);