diff options
| author | Raymond Mao <[email protected]> | 2025-07-18 07:16:15 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-27 09:42:36 -0600 |
| commit | ad82e750fd2af6d7f098e78e70cbba1678e84b2f (patch) | |
| tree | 54e0fbe0147dabc8cb884fd05678cd94838019ef /common | |
| parent | 9d89fc4054faa7b5a9422b97b756b2cf63a91ad8 (diff) | |
bloblist: add helper functions
Add two helper functions for:
1. marking a blob void
2. getting blob record from a given blob data pointer.
Signed-off-by: Raymond Mao <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Tested-by: Michal Simek <[email protected]>
Diffstat (limited to 'common')
| -rw-r--r-- | common/bloblist.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/bloblist.c b/common/bloblist.c index 1c690f58b56..488908f605e 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -97,6 +97,19 @@ static inline uint rec_tag(struct bloblist_rec *rec) BLOBLISTR_TAG_SHIFT; } +static inline void void_blob(struct bloblist_rec *rec) +{ + if (rec_tag(rec) == BLOBLISTT_VOID) + return; + rec->tag_and_hdr_size = BLOBLISTT_VOID | + sizeof(*rec) << BLOBLISTR_HDR_SIZE_SHIFT; +} + +static inline struct bloblist_rec *rec_from_blob(void *blob) +{ + return (blob - sizeof(struct bloblist_rec)); +} + static ulong bloblist_blob_end_ofs(struct bloblist_hdr *hdr, struct bloblist_rec *rec) { |
