summaryrefslogtreecommitdiff
path: root/include/bloblist.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-07-22 11:15:52 -0400
committerTom Rini <trini@konsulko.com>2021-07-22 11:15:52 -0400
commita15fa1ba67d7b3c8061b515e7713f733fa328018 (patch)
treef7746e2e7a3410043e9ea3f3f7c0a97e2c5e6dbb /include/bloblist.h
parent806734f41b25931798fdf667b5a2ae830229c13f (diff)
parent1b098b3e655451572054ce933a87231ee16f7133 (diff)
Merge tag 'dm-pull-21jul21' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
dtoc improvements to show better warnings minor test build fixes sandbox fixes for SDL2 and running TPL bloblist resize feature binman multithreading
Diffstat (limited to 'include/bloblist.h')
-rw-r--r--include/bloblist.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/bloblist.h b/include/bloblist.h
index 964b974fdaf..9f007c7a94d 100644
--- a/include/bloblist.h
+++ b/include/bloblist.h
@@ -64,10 +64,10 @@ enum bloblist_tag_t {
* first bloblist_rec starts at this offset from the start of the header
* @flags: Space for BLOBLISTF_... flags (none yet)
* @magic: BLOBLIST_MAGIC
- * @size: Total size of all records (non-zero if valid) including this header.
+ * @size: Total size of the bloblist (non-zero if valid) including this header.
* The bloblist extends for this many bytes from the start of this header.
- * @alloced: Total size allocated for this bloblist. When adding new records,
- * the bloblist can grow up to this size. This starts out as
+ * When adding new records, the bloblist can grow up to this size.
+ * @alloced: Total size allocated so far for this bloblist. This starts out as
* sizeof(bloblist_hdr) since we need at least that much space to store a
* valid bloblist
* @spare: Spare space (for future use)
@@ -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
@@ -217,6 +230,10 @@ int bloblist_finish(void);
* bloblist_get_stats() - Get information about the bloblist
*
* This returns useful information about the bloblist
+ *
+ * @basep: Returns base address of bloblist
+ * @sizep: Returns the number of bytes used in the bloblist
+ * @allocedp: Returns the total space allocated to the bloblist
*/
void bloblist_get_stats(ulong *basep, ulong *sizep, ulong *allocedp);