summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRaymond Mao <[email protected]>2025-07-18 07:16:17 -0700
committerTom Rini <[email protected]>2026-04-27 09:42:36 -0600
commit25baace94298bbe50a91f7b1b7470bf0eb5688fa (patch)
tree6334be35c79838b2293170f8f2a2ae4671d014c9 /include
parent63cc797a7e89a2543c9997a271ad8f02b04a6777 (diff)
bloblist: add API for applying blobs with specified tag
Add an API to search for the blobs with specified tag and use the hook function to apply the blob data. Add a helper function to return the inline header size as according to recent spec[1] updates, the actual data can be following an inline header instead of following the TE header immediately. [1] Firmware Handoff spec: https://github.com/FirmwareHandoff/firmware_handoff Signed-off-by: Raymond Mao <[email protected]> Reviewed-by: Tom Rini <[email protected]> Tested-by: Michal Simek <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/bloblist.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/bloblist.h b/include/bloblist.h
index c2d3065a43c..e67b2a76358 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -73,6 +73,7 @@
#define __BLOBLIST_H
#include <mapmem.h>
+#include <linux/errno.h>
enum {
BLOBLIST_VERSION = 1,
@@ -279,6 +280,26 @@ static inline void *bloblist_get_blob(uint tag, int *sizep)
}
#endif
+#if CONFIG_IS_ENABLED(BLOBLIST)
+/**
+ * bloblist_apply_blobs() - Apply the data of blobs by tag
+ *
+ * Scan the bloblist, find the blobs with the matching tag and apply the data
+ * of blobs
+ *
+ * @tag: Tag to search for (enum bloblist_tag_t)
+ * @func: Function to apply the data of blobs
+ * Return: 0 if OK, otherwise error.
+ */
+int bloblist_apply_blobs(uint tag, int (*func)(void **data, int size));
+#else
+static inline int bloblist_apply_blobs(uint tag,
+ int (*func)(void **data, int size))
+{
+ return -EPERM;
+}
+#endif
+
/**
* bloblist_find() - Find a blob
*