summaryrefslogtreecommitdiff
path: root/include/bloblist.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-06 01:32:53 +0300
committerSimon Glass <sjg@chromium.org>2021-07-21 19:27:34 +0300
commit1fe59375498fb84cd9ab72cf1f7f89437cd24cf4 (patch)
tree89be56988d867198dec854907c36e764010ce6be /include/bloblist.h
parent56dae9ef3c56a7de6ed4af5efb82e661329d4738 (diff)
downloadu-boot-1fe59375498fb84cd9ab72cf1f7f89437cd24cf4.tar.xz
bloblist: Support resizing a blob
Sometimes a blob needs to expand, e.g. because it needs to hold more log data. Add support for this. Note that the bloblist must have sufficient spare space for this to work. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bloblist.h')
-rw-r--r--include/bloblist.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/bloblist.h b/include/bloblist.h
index 964b974fda..b659d2bc93 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -180,6 +180,19 @@ void *bloblist_ensure(uint tag, int size);
int bloblist_ensure_size_ret(uint tag, int *sizep, void **blobp);
/**
+ * bloblist_resize() - resize a blob
+ *
+ * Any blobs above this one are relocated up or down. The resized blob remains
+ * in the same place.
+ *
+ * @tag: Tag to add (enum bloblist_tag_t)
+ * @new_size: New size of the blob (>0 to expand, <0 to contract)
+ * @return 0 if OK, -ENOSPC if the bloblist does not have enough space, -ENOENT
+ * if the tag is not found
+ */
+int bloblist_resize(uint tag, int new_size);
+
+/**
* bloblist_new() - Create a new, empty bloblist of a given size
*
* @addr: Address of bloblist