From 24d8e1b37b90760a6c9867f37210aa4b1f2e8f63 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Jan 2023 08:52:34 -0600 Subject: bootstd: Allow reading a logo for the OS Some operating systems provide a logo in bmp format. Read this in if present so it can be displayed in the menu. Signed-off-by: Simon Glass --- include/bootmeth.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/bootmeth.h') diff --git a/include/bootmeth.h b/include/bootmeth.h index 50ded055f3f..669b14ce81e 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -265,6 +265,22 @@ int bootmeth_try_file(struct bootflow *bflow, struct blk_desc *desc, */ int bootmeth_alloc_file(struct bootflow *bflow, uint size_limit, uint align); +/** + * bootmeth_alloc_other() - Allocate and read a file for a bootflow + * + * This reads an arbitrary file in the same directory as the bootflow, + * allocating memory for it. The buffer is one byte larger than the file length, + * so that it can be nul-terminated. + * + * @bflow: Information about file to read + * @fname: Filename to read from (within bootflow->subdir) + * @bufp: Returns a pointer to the allocated buffer + * @sizep: Returns the size of the buffer + * Return: 0 if OK, -ENOMEM if out of memory, other -ve on other error + */ +int bootmeth_alloc_other(struct bootflow *bflow, const char *fname, + void **bufp, uint *sizep); + /** * bootmeth_common_read_file() - Common handler for reading a file * -- cgit v1.2.3