summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRaymond Mao <[email protected]>2025-01-27 06:49:34 -0800
committerIlias Apalodimas <[email protected]>2025-01-28 08:59:21 +0200
commitbb894c5da5151e0858e217407c0cdeb989725a4a (patch)
tree6910b8f99af21e99e812a1dfe50272e5c0bacba9 /include
parentb8eaa52612bf34164e7f495a094a5a419903a3ed (diff)
bloblist: add api to get blob with size
bloblist_find function only returns the pointer of blob data, which is fine for those self-describing data like FDT. But as a common scenario, an interface is needed to retrieve both the pointer and the size of the blob data. Add a few ut test cases for the new api. Signed-off-by: Raymond Mao <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/bloblist.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/bloblist.h b/include/bloblist.h
index f999391f74b..52ba0ddcf84 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -250,6 +250,24 @@ static inline void *bloblist_check_magic(ulong addr)
return ptr;
}
+#if CONFIG_IS_ENABLED(BLOBLIST)
+/**
+ * bloblist_get_blob() - Find a blob and get the size of it
+ *
+ * Searches the bloblist and returns the blob with the matching tag
+ *
+ * @tag: Tag to search for (enum bloblist_tag_t)
+ * @sizep: Size of the blob found
+ * Return: pointer to bloblist if found, or NULL if not found
+ */
+void *bloblist_get_blob(uint tag, int *sizep);
+#else
+static inline void *bloblist_get_blob(uint tag, int *sizep)
+{
+ return NULL;
+}
+#endif
+
/**
* bloblist_find() - Find a blob
*