diff options
author | Simon Glass <sjg@chromium.org> | 2020-09-19 18:49:29 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-10-06 09:07:54 -0600 |
commit | 4c1497e77661eea47d3dbb9bee029532cc0da198 (patch) | |
tree | 74370564fedab53ab0b2dfc367acd80a836b87de /include | |
parent | 751b7c79634003b4cb326b79e80202ea45b75fc8 (diff) | |
download | u-boot-4c1497e77661eea47d3dbb9bee029532cc0da198.zip u-boot-4c1497e77661eea47d3dbb9bee029532cc0da198.tar.gz u-boot-4c1497e77661eea47d3dbb9bee029532cc0da198.tar.bz2 |
bloblist: Allow custom alignment for blobs
Some blobs need a larger alignment than the default. For example, ACPI
tables often start at a 4KB boundary. Add support for this.
Update the size of the test blob to allow these larger records.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/bloblist.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/bloblist.h b/include/bloblist.h index 6c37cd2..965d8e9 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -132,10 +132,11 @@ void *bloblist_find(uint tag, int size); * * @tag: Tag to add (enum bloblist_tag_t) * @size: Size of the blob + * @align: Alignment of the blob (in bytes), 0 for default * @return pointer to the newly added block, or NULL if there is not enough * space for the blob */ -void *bloblist_add(uint tag, int size); +void *bloblist_add(uint tag, int size, int align); /** * bloblist_ensure_size() - Find or add a blob @@ -145,10 +146,11 @@ void *bloblist_add(uint tag, int size); * @tag: Tag to add (enum bloblist_tag_t) * @size: Size of the blob * @blobp: Returns a pointer to blob on success + * @align: Alignment of the blob (in bytes), 0 for default * @return 0 if OK, -ENOSPC if it is missing and could not be added due to lack * of space, or -ESPIPE it exists but has the wrong size */ -int bloblist_ensure_size(uint tag, int size, void **blobp); +int bloblist_ensure_size(uint tag, int size, int align, void **blobp); /** * bloblist_ensure() - Find or add a blob |