u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: u-boot@lists.denx.de,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] efi_loader: Clean up usage of structure jmp_buf_data
Date: Sun, 16 Feb 2025 14:26:31 +0000	[thread overview]
Message-ID: <Z7H1l-UwL-kELhn9@pie.lan> (raw)
In-Reply-To: <a1484035-28d5-4dc8-8eff-d435d50572e7@gmx.de>

On Sat, Feb 15, 2025 at 05:58:18PM +0100, Heinrich Schuchardt wrote:
> On 15.02.25 16:54, Yao Zi wrote:
> > 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 <ziyao@disroot.org>
> > ---
> >   include/efi_loader.h          | 4 ++--
> >   lib/efi_loader/efi_boottime.c | 8 ++++----
> >   2 files changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/include/efi_loader.h b/include/efi_loader.h
> > index dcae6a731a0..4afe8b9c859 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 <asm/setjmp.h>
> 
> Thanks for this suggestion.
> 
> lib/efi_loader/efi_boottime.c already has this include.
> We don't need to include it globally.

We need to include it, or in files that doesn't include asm/setjmp.h
directly, type jmp_buf is unknown, failing the compilation.

> The rest looks fine.
> 
> Best regards
> 
> Heinrich

Thanks,
Yao Zi

> 
> >   #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 5164cb15986..80c56b1ee46 100644
> > --- a/lib/efi_loader/efi_boottime.c
> > +++ b/lib/efi_loader/efi_boottime.c
> > @@ -3199,7 +3199,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 +3238,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 +3444,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 +3511,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:
> 

  reply	other threads:[~2025-02-16 14:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-15 15:54 [PATCH] efi_loader: Clean up usage of structure jmp_buf_data Yao Zi
2025-02-15 16:58 ` Heinrich Schuchardt
2025-02-16 14:26   ` Yao Zi [this message]
2025-02-16 16:50     ` Heinrich Schuchardt
2025-02-16 17:36       ` Yao Zi
2025-02-28 15:50         ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z7H1l-UwL-kELhn9@pie.lan \
    --to=ziyao@disroot.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).