On Sun, 2 Mar 2025 at 14:22, Heinrich Schuchardt
<heinrich.schucha...@canonical.com> wrote:
>
> From: Yao Zi <zi...@disroot.org>
>
> Structure jmp_buf_data provides the underlying format of jmp_buf, which
> we actually don't care about. Clean up existing code to use the standard
> jmp_buf type. This introduces no functional change.
>
> Signed-off-by: Yao Zi <zi...@disroot.org>
> ---
>  include/efi_loader.h          | 4 ++--
>  lib/efi_loader/efi_boottime.c | 9 ++++-----
>  2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index 1d75d97ebbc..22b724f311a 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -15,13 +15,13 @@
>  #include <efi_api.h>
>  #include <image.h>
>  #include <pe.h>
> +#include <setjmp.h>
>  #include <linux/list.h>
>  #include <linux/sizes.h>
>  #include <linux/oid_registry.h>
>
>  struct blk_desc;
>  struct bootflow;
> -struct jmp_buf_data;
>
>  #if CONFIG_IS_ENABLED(EFI_LOADER)
>
> @@ -485,7 +485,7 @@ struct efi_loaded_image_obj {
>         efi_status_t *exit_status;
>         efi_uintn_t *exit_data_size;
>         u16 **exit_data;
> -       struct jmp_buf_data *exit_jmp;
> +       jmp_buf *exit_jmp;
>         EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
>                                      struct efi_system_table *st);
>         u16 image_type;
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index bdf9e7e8066..853a1c8c097 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -21,7 +21,6 @@
>  #include <usb.h>
>  #include <watchdog.h>
>  #include <asm/global_data.h>
> -#include <setjmp.h>
>  #include <linux/libfdt_env.h>
>
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -3199,7 +3198,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t 
> image_handle,
>         void *info;
>         efi_handle_t parent_image = current_image;
>         efi_status_t exit_status;
> -       struct jmp_buf_data exit_jmp;
> +       jmp_buf exit_jmp;
>
>         EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
>
> @@ -3238,7 +3237,7 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t 
> image_handle,
>         }
>
>         /* call the image! */
> -       if (setjmp(&exit_jmp)) {
> +       if (setjmp(exit_jmp)) {
>                 /*
>                  * We called the entry point of the child image with EFI_CALL
>                  * in the lines below. The child image called the Exit() boot
> @@ -3444,7 +3443,7 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t 
> image_handle,
>         struct efi_loaded_image *loaded_image_protocol;
>         struct efi_loaded_image_obj *image_obj =
>                 (struct efi_loaded_image_obj *)image_handle;
> -       struct jmp_buf_data *exit_jmp;
> +       jmp_buf *exit_jmp;
>
>         EFI_ENTRY("%p, %ld, %zu, %p", image_handle, exit_status,
>                   exit_data_size, exit_data);
> @@ -3511,7 +3510,7 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t 
> image_handle,
>          */
>         efi_restore_gd();
>
> -       longjmp(exit_jmp, 1);
> +       longjmp(*exit_jmp, 1);
>
>         panic("EFI application exited");
>  out:
> --
> 2.48.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodi...@linaro.org>

Reply via email to