* [PATCH] efi_loader: move asm/setjmp.h to efi_loader.h
@ 2021-05-10 8:21 AKASHI Takahiro
2021-05-20 2:48 ` Heinrich Schuchardt
0 siblings, 1 reply; 3+ messages in thread
From: AKASHI Takahiro @ 2021-05-10 8:21 UTC (permalink / raw)
To: u-boot
In the commit c982874e930d ("efi_loader: refactor
efi_setup_loaded_image()"), setjmp-related definitions were moved to
efi_loaded_image_obj in efi_loader.h. So setjmp.h is no longer
refererenced in efi_api.h.
This also fixes some error when efi_api.h will be included in
mkeficapsule.c.
On the other hand, a tweak will be necessary in common/main.c as
some architectures have no setjmp support.
Fixes: c982874e930d ("efi_loader: refactor efi_setup_loaded_image()")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
common/main.c | 6 ++++++
include/efi_api.h | 4 ----
include/efi_loader.h | 1 +
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/common/main.c b/common/main.c
index ae5bcdb32f8b..a41c57c26611 100644
--- a/common/main.c
+++ b/common/main.c
@@ -16,7 +16,13 @@
#include <init.h>
#include <net.h>
#include <version.h>
+#ifdef CONFIG_EFI_LOADER
+/*
+ * Unfortunately, efi_loader requires setjmp.h, but there are
+ * some architectures which have no support for setjmp.
+ */
#include <efi_loader.h>
+#endif
static void run_preboot_environment_command(void)
{
diff --git a/include/efi_api.h b/include/efi_api.h
index 18a1adf02390..e854a8b3a112 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -20,10 +20,6 @@
#include <charset.h>
#include <pe.h>
-#ifdef CONFIG_EFI_LOADER
-#include <asm/setjmp.h>
-#endif
-
/* UEFI spec version 2.8 */
#define EFI_SPECIFICATION_VERSION (2 << 16 | 80)
diff --git a/include/efi_loader.h b/include/efi_loader.h
index de1a496a9726..6994a951bc19 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -15,6 +15,7 @@
#include <efi_api.h>
#include <image.h>
#include <pe.h>
+#include <asm/setjmp.h>
struct blk_desc;
--
2.31.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] efi_loader: move asm/setjmp.h to efi_loader.h
2021-05-10 8:21 [PATCH] efi_loader: move asm/setjmp.h to efi_loader.h AKASHI Takahiro
@ 2021-05-20 2:48 ` Heinrich Schuchardt
2021-07-20 2:29 ` AKASHI Takahiro
0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2021-05-20 2:48 UTC (permalink / raw)
To: u-boot
On 5/10/21 10:21 AM, AKASHI Takahiro wrote:
> In the commit c982874e930d ("efi_loader: refactor
> efi_setup_loaded_image()"), setjmp-related definitions were moved to
> efi_loaded_image_obj in efi_loader.h. So setjmp.h is no longer
> refererenced in efi_api.h.
>
> This also fixes some error when efi_api.h will be included in
> mkeficapsule.c.
>
> On the other hand, a tweak will be necessary in common/main.c as
> some architectures have no setjmp support.
>
> Fixes: c982874e930d ("efi_loader: refactor efi_setup_loaded_image()")
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
> common/main.c | 6 ++++++
> include/efi_api.h | 4 ----
> include/efi_loader.h | 1 +
> 3 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/common/main.c b/common/main.c
> index ae5bcdb32f8b..a41c57c26611 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -16,7 +16,13 @@
> #include <init.h>
> #include <net.h>
> #include <version.h>
> +#ifdef CONFIG_EFI_LOADER
> +/*
> + * Unfortunately, efi_loader requires setjmp.h, but there are
> + * some architectures which have no support for setjmp.
> + */
> #include <efi_loader.h>
Your patch results in build failures for qemu_mips64_defconfig like:
In file included from cmd/load.c:14:
include/efi_loader.h:18:10: fatal error: asm/setjmp.h: No such file or
directory
18 | #include <asm/setjmp.h>
| ^~~~~~~~~~~~~~
If there is a problem with mkeficapsule, you can fix it there.
Best regards
Heinrich
> +#endif
>
> static void run_preboot_environment_command(void)
> {
> diff --git a/include/efi_api.h b/include/efi_api.h
> index 18a1adf02390..e854a8b3a112 100644
> --- a/include/efi_api.h
> +++ b/include/efi_api.h
> @@ -20,10 +20,6 @@
> #include <charset.h>
> #include <pe.h>
>
> -#ifdef CONFIG_EFI_LOADER
> -#include <asm/setjmp.h>
> -#endif
> -
> /* UEFI spec version 2.8 */
> #define EFI_SPECIFICATION_VERSION (2 << 16 | 80)
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index de1a496a9726..6994a951bc19 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -15,6 +15,7 @@
> #include <efi_api.h>
> #include <image.h>
> #include <pe.h>
> +#include <asm/setjmp.h>
>
> struct blk_desc;
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] efi_loader: move asm/setjmp.h to efi_loader.h
2021-05-20 2:48 ` Heinrich Schuchardt
@ 2021-07-20 2:29 ` AKASHI Takahiro
0 siblings, 0 replies; 3+ messages in thread
From: AKASHI Takahiro @ 2021-07-20 2:29 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: u-boot, Alexander Graf, Sughosh Ganu
On Thu, May 20, 2021 at 04:48:23AM +0200, Heinrich Schuchardt wrote:
> On 5/10/21 10:21 AM, AKASHI Takahiro wrote:
> > In the commit c982874e930d ("efi_loader: refactor
> > efi_setup_loaded_image()"), setjmp-related definitions were moved to
> > efi_loaded_image_obj in efi_loader.h. So setjmp.h is no longer
> > refererenced in efi_api.h.
> >
> > This also fixes some error when efi_api.h will be included in
> > mkeficapsule.c.
> >
> > On the other hand, a tweak will be necessary in common/main.c as
> > some architectures have no setjmp support.
> >
> > Fixes: c982874e930d ("efi_loader: refactor efi_setup_loaded_image()")
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> > common/main.c | 6 ++++++
> > include/efi_api.h | 4 ----
> > include/efi_loader.h | 1 +
> > 3 files changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/common/main.c b/common/main.c
> > index ae5bcdb32f8b..a41c57c26611 100644
> > --- a/common/main.c
> > +++ b/common/main.c
> > @@ -16,7 +16,13 @@
> > #include <init.h>
> > #include <net.h>
> > #include <version.h>
> > +#ifdef CONFIG_EFI_LOADER
> > +/*
> > + * Unfortunately, efi_loader requires setjmp.h, but there are
> > + * some architectures which have no support for setjmp.
> > + */
> > #include <efi_loader.h>
>
> Your patch results in build failures for qemu_mips64_defconfig like:
>
> In file included from cmd/load.c:14:
> include/efi_loader.h:18:10: fatal error: asm/setjmp.h: No such file or
> directory
> 18 | #include <asm/setjmp.h>
> | ^~~~~~~~~~~~~~
>
> If there is a problem with mkeficapsule, you can fix it there.
My whole intent is to remove asm/setjmp.h from efi_api.h
as it doesn't make sense to include it there.
In efi_loader.h, we need asm/setjmp.h only for the definition
of struct jmp_buf_data. We can remove the include file here by
adding "struct jmp_buf_data;" line.
Will repost the patch.
-Takahiro Akashi
> Best regards
>
> Heinrich
>
> > +#endif
> >
> > static void run_preboot_environment_command(void)
> > {
> > diff --git a/include/efi_api.h b/include/efi_api.h
> > index 18a1adf02390..e854a8b3a112 100644
> > --- a/include/efi_api.h
> > +++ b/include/efi_api.h
> > @@ -20,10 +20,6 @@
> > #include <charset.h>
> > #include <pe.h>
> >
> > -#ifdef CONFIG_EFI_LOADER
> > -#include <asm/setjmp.h>
> > -#endif
> > -
> > /* UEFI spec version 2.8 */
> > #define EFI_SPECIFICATION_VERSION (2 << 16 | 80)
> >
> > diff --git a/include/efi_loader.h b/include/efi_loader.h
> > index de1a496a9726..6994a951bc19 100644
> > --- a/include/efi_loader.h
> > +++ b/include/efi_loader.h
> > @@ -15,6 +15,7 @@
> > #include <efi_api.h>
> > #include <image.h>
> > #include <pe.h>
> > +#include <asm/setjmp.h>
> >
> > struct blk_desc;
> >
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-20 2:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 8:21 [PATCH] efi_loader: move asm/setjmp.h to efi_loader.h AKASHI Takahiro
2021-05-20 2:48 ` Heinrich Schuchardt
2021-07-20 2:29 ` AKASHI Takahiro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.