diff options
author | Simon Glass <sjg@chromium.org> | 2020-01-27 08:49:50 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-02-05 19:33:46 -0700 |
commit | 5b044548f5ae3e5f7cfbd4a6399f0695b4fb709b (patch) | |
tree | 35559c0f03ee22ce6a18199c695fdc9edf18618b /include/bloblist.h | |
parent | 9ff5e0495d4bc8aee79c712a8603ef9bd7c06cd7 (diff) | |
download | u-boot-5b044548f5ae3e5f7cfbd4a6399f0695b4fb709b.tar.gz |
bloblist: Add a new function to add or check size
A common check is to see if a blob is present, create it if not and make
sure that the size is large enough. Add a function to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/bloblist.h')
-rw-r--r-- | include/bloblist.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/bloblist.h b/include/bloblist.h index 85144010ab..8c9ce98a3b 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -152,6 +152,19 @@ int bloblist_ensure_size(uint tag, int size, void **blobp); void *bloblist_ensure(uint tag, int size); /** + * bloblist_ensure_size_ret() - Find or add a blob + * + * Find an existing blob, or add a new one if not found + * + * @tag: Tag to add (enum bloblist_tag_t) + * @sizep: Size of the blob to create; returns size of actual blob + * @blobp: Returns a pointer to blob on success + * @return 0 if OK, -ENOSPC if it is missing and could not be added due to lack + * of space + */ +int bloblist_ensure_size_ret(uint tag, int *sizep, void **blobp); + +/** * bloblist_new() - Create a new, empty bloblist of a given size * * @addr: Address of bloblist |