mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
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>
This commit is contained in:
@@ -151,6 +151,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
|
||||
*
|
||||
|
Reference in New Issue
Block a user