From 9f00d38ce7600a162e37156ee6d5a050857a3a9f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 17 Jan 2025 01:09:51 +0100 Subject: efi_loader: correct logging StartImage() When logging running an image, e.g. `bootefi hello` the indent is not correctly reset. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 0d858c1e12e..5bf271afaad 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -245,6 +245,18 @@ const char *__efi_nesting_dec(void); _r; \ }) +/** + * define EFI_RETURN() - return from EFI_CALL in efi_start_image() + * + * @ret: status code + */ +#define EFI_RETURN(ret) ({ \ + typeof(ret) _r = ret; \ + assert(__efi_entry_check()); \ + debug("%sEFI: %lu returned by started image", __efi_nesting_dec(), \ + (unsigned long)((uintptr_t)_r & ~EFI_ERROR_MASK)); \ +}) + /* * Call void UEFI function from u-boot: */ -- cgit v1.2.3 From 1daacb92757e0c2e7b5155613ad9b1334545eb86 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 17 Jan 2025 01:09:52 +0100 Subject: log: make log_has_file() static Function log_has_file() is not used externally. Make it static. Rename the function to log_has_member() as we can reuse for filtering other strings. Signed-off-by: Heinrich Schuchardt --- include/log.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include') diff --git a/include/log.h b/include/log.h index 4f6d6a2c2cf..3f9023ae0d2 100644 --- a/include/log.h +++ b/include/log.h @@ -571,18 +571,6 @@ struct log_device *log_device_find_by_name(const char *drv_name); */ bool log_has_cat(enum log_category_t cat_list[], enum log_category_t cat); -/** - * log_has_file() - check if a file is with a list - * - * @file_list: List of files to check, separated by comma - * @file: File to check for. This string is matched against the end of each - * file in the list, i.e. ignoring any preceding path. The list is - * intended to consist of relative pathnames, e.g. common/main.c,cmd/log.c - * - * Return: ``true`` if @file is in @file_list, else ``false`` - */ -bool log_has_file(const char *file_list, const char *file); - /* Log format flags (bit numbers) for gd->log_fmt. See log_fmt_chars */ enum log_fmt { LOGF_CAT = 0, -- cgit v1.2.3 From cb43e3e427769f5dcbb1ffda155198f38fb7375c Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 17 Jan 2025 01:09:53 +0100 Subject: log: enable filtering on functions Up to now we could only use log level, category, and file for filtering. Allow filtering on a list of functions. Signed-off-by: Heinrich Schuchardt --- include/log.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/log.h b/include/log.h index 3f9023ae0d2..dd44badc361 100644 --- a/include/log.h +++ b/include/log.h @@ -500,6 +500,7 @@ enum log_filter_flags { * @level: Maximum (or minimum, if %LOGFF_MIN_LEVEL) log level to allow * @file_list: List of files to allow, separated by comma. If NULL then all * files are permitted + * @func_list: Comma separated list of functions or NULL. * @sibling_node: Next filter in the list of filters for this log device */ struct log_filter { @@ -508,6 +509,7 @@ struct log_filter { enum log_category_t cat_list[LOGF_MAX_CATEGORIES]; enum log_level_t level; const char *file_list; + const char *func_list; struct list_head sibling_node; }; @@ -599,13 +601,14 @@ int do_log_test(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); * @level: Maximum (or minimum, if %LOGFF_LEVEL_MIN) log level to allow * @file_list: List of files to allow, separated by comma. If NULL then all * files are permitted + * @func_list: Comma separated list of functions or NULL. * Return: * the sequence number of the new filter (>=0) if the filter was added, or a * -ve value on error */ int log_add_filter_flags(const char *drv_name, enum log_category_t cat_list[], enum log_level_t level, const char *file_list, - int flags); + const char *func_list, int flags); /** * log_add_filter() - Add a new filter to a log device @@ -628,7 +631,7 @@ static inline int log_add_filter(const char *drv_name, const char *file_list) { return log_add_filter_flags(drv_name, cat_list, max_level, file_list, - 0); + NULL, 0); } /** -- cgit v1.2.3 From a2338955fc1d3bb6de86ab4fb6e7c55ff189f4f0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 23 Jan 2025 15:07:23 -0700 Subject: efi_loader: Pass in the required parameters from EFI bootmeth Rather than setting up the global variables and then making the call, pass them into function directly. This cleans up the code and makes it all a bit easier to understand. Signed-off-by: Simon Glass --- include/efi_loader.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 5bf271afaad..dcae6a731a0 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -20,6 +20,7 @@ #include struct blk_desc; +struct bootflow; struct jmp_buf_data; #if CONFIG_IS_ENABLED(EFI_LOADER) @@ -590,6 +591,15 @@ efi_status_t efi_install_fdt(void *fdt); efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options); /* Run loaded UEFI image with given fdt */ efi_status_t efi_binary_run(void *image, size_t size, void *fdt); + +/** + * efi_bootflow_run() - Run a bootflow containing an EFI application + * + * @bootflow: Bootflow to run + * Return: Status code, something went wrong + */ +efi_status_t efi_bootflow_run(struct bootflow *bootflow); + /* Initialize variable services */ efi_status_t efi_init_variables(void); /* Notify ExitBootServices() is called */ -- cgit v1.2.3