* [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI
@ 2017-09-18 17:47 Rob Clark
2017-09-18 18:27 ` Rob Clark
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Rob Clark @ 2017-09-18 17:47 UTC (permalink / raw)
To: u-boot
This is needed to run 'bootefi' from sandbox. I suspect StartImage()
must have been broken too on x86.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
cmd/bootefi.c | 2 +-
include/efi.h | 2 +-
lib/efi_loader/efi_boottime.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index fb8ba9be6a..3c9a466e20 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -96,7 +96,7 @@ static void *copy_fdt(void *fdt)
static ulong efi_do_enter(void *image_handle,
struct efi_system_table *st,
- asmlinkage ulong (*entry)(void *image_handle,
+ EFIAPI ulong (*entry)(void *image_handle,
struct efi_system_table *st))
{
efi_status_t ret = EFI_LOAD_ERROR;
diff --git a/include/efi.h b/include/efi.h
index 04e83220b4..47c2c8f398 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -19,7 +19,7 @@
#include <linux/string.h>
#include <linux/types.h>
-#ifdef CONFIG_EFI_STUB_64BIT
+#if defined(CONFIG_EFI_STUB_64BIT) || defined(CONFIG_SANDBOX)
/* EFI uses the Microsoft ABI which is not the default for GCC */
#define EFIAPI __attribute__((ms_abi))
#else
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 22bb95d738..3e10e6f6b5 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -950,7 +950,7 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
unsigned long *exit_data_size,
s16 **exit_data)
{
- ulong (*entry)(void *image_handle, struct efi_system_table *st);
+ EFIAPI ulong (*entry)(void *image_handle, struct efi_system_table *st);
struct efi_loaded_image *info = image_handle;
EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
--
2.13.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI
2017-09-18 17:47 [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI Rob Clark
@ 2017-09-18 18:27 ` Rob Clark
2017-09-18 20:59 ` Alexander Graf
2017-09-18 20:58 ` Alexander Graf
2017-09-25 2:12 ` Simon Glass
2 siblings, 1 reply; 5+ messages in thread
From: Rob Clark @ 2017-09-18 18:27 UTC (permalink / raw)
To: u-boot
On Mon, Sep 18, 2017 at 1:47 PM, Rob Clark <robdclark@gmail.com> wrote:
> This is needed to run 'bootefi' from sandbox. I suspect StartImage()
> must have been broken too on x86.
>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
> cmd/bootefi.c | 2 +-
> include/efi.h | 2 +-
> lib/efi_loader/efi_boottime.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index fb8ba9be6a..3c9a466e20 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -96,7 +96,7 @@ static void *copy_fdt(void *fdt)
>
> static ulong efi_do_enter(void *image_handle,
> struct efi_system_table *st,
> - asmlinkage ulong (*entry)(void *image_handle,
> + EFIAPI ulong (*entry)(void *image_handle,
> struct efi_system_table *st))
> {
> efi_status_t ret = EFI_LOAD_ERROR;
> diff --git a/include/efi.h b/include/efi.h
> index 04e83220b4..47c2c8f398 100644
> --- a/include/efi.h
> +++ b/include/efi.h
> @@ -19,7 +19,7 @@
> #include <linux/string.h>
> #include <linux/types.h>
>
> -#ifdef CONFIG_EFI_STUB_64BIT
> +#if defined(CONFIG_EFI_STUB_64BIT) || defined(CONFIG_SANDBOX)
btw, maybe we should have CONFIG_SANDBOX_$arch somehow so we don't
have to assume SANDBOX==X86 (but I guess at least just having
efi_loader work in sandbox on x86 is a nice first step)
BR,
-R
> /* EFI uses the Microsoft ABI which is not the default for GCC */
> #define EFIAPI __attribute__((ms_abi))
> #else
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 22bb95d738..3e10e6f6b5 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -950,7 +950,7 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
> unsigned long *exit_data_size,
> s16 **exit_data)
> {
> - ulong (*entry)(void *image_handle, struct efi_system_table *st);
> + EFIAPI ulong (*entry)(void *image_handle, struct efi_system_table *st);
> struct efi_loaded_image *info = image_handle;
>
> EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
> --
> 2.13.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI
2017-09-18 17:47 [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI Rob Clark
2017-09-18 18:27 ` Rob Clark
@ 2017-09-18 20:58 ` Alexander Graf
2017-09-25 2:12 ` Simon Glass
2 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2017-09-18 20:58 UTC (permalink / raw)
To: u-boot
On 18.09.17 19:47, Rob Clark wrote:
> This is needed to run 'bootefi' from sandbox. I suspect StartImage()
> must have been broken too on x86.
>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
> cmd/bootefi.c | 2 +-
> include/efi.h | 2 +-
> lib/efi_loader/efi_boottime.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index fb8ba9be6a..3c9a466e20 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -96,7 +96,7 @@ static void *copy_fdt(void *fdt)
>
> static ulong efi_do_enter(void *image_handle,
> struct efi_system_table *st,
> - asmlinkage ulong (*entry)(void *image_handle,
> + EFIAPI ulong (*entry)(void *image_handle,
> struct efi_system_table *st))
> {
> efi_status_t ret = EFI_LOAD_ERROR;
> diff --git a/include/efi.h b/include/efi.h
> index 04e83220b4..47c2c8f398 100644
> --- a/include/efi.h
> +++ b/include/efi.h
> @@ -19,7 +19,7 @@
> #include <linux/string.h>
> #include <linux/types.h>
>
> -#ifdef CONFIG_EFI_STUB_64BIT
> +#if defined(CONFIG_EFI_STUB_64BIT) || defined(CONFIG_SANDBOX)
This is incorrect for sandbox on non-x86_64 hosts. We should rather fix
it in Kconfig I guess.
Alex
> /* EFI uses the Microsoft ABI which is not the default for GCC */
> #define EFIAPI __attribute__((ms_abi))
> #else
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 22bb95d738..3e10e6f6b5 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -950,7 +950,7 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
> unsigned long *exit_data_size,
> s16 **exit_data)
> {
> - ulong (*entry)(void *image_handle, struct efi_system_table *st);
> + EFIAPI ulong (*entry)(void *image_handle, struct efi_system_table *st);
> struct efi_loaded_image *info = image_handle;
>
> EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI
2017-09-18 18:27 ` Rob Clark
@ 2017-09-18 20:59 ` Alexander Graf
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2017-09-18 20:59 UTC (permalink / raw)
To: u-boot
On 18.09.17 20:27, Rob Clark wrote:
> On Mon, Sep 18, 2017 at 1:47 PM, Rob Clark <robdclark@gmail.com> wrote:
>> This is needed to run 'bootefi' from sandbox. I suspect StartImage()
>> must have been broken too on x86.
>>
>> Signed-off-by: Rob Clark <robdclark@gmail.com>
>> ---
>> cmd/bootefi.c | 2 +-
>> include/efi.h | 2 +-
>> lib/efi_loader/efi_boottime.c | 2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
>> index fb8ba9be6a..3c9a466e20 100644
>> --- a/cmd/bootefi.c
>> +++ b/cmd/bootefi.c
>> @@ -96,7 +96,7 @@ static void *copy_fdt(void *fdt)
>>
>> static ulong efi_do_enter(void *image_handle,
>> struct efi_system_table *st,
>> - asmlinkage ulong (*entry)(void *image_handle,
>> + EFIAPI ulong (*entry)(void *image_handle,
>> struct efi_system_table *st))
>> {
>> efi_status_t ret = EFI_LOAD_ERROR;
>> diff --git a/include/efi.h b/include/efi.h
>> index 04e83220b4..47c2c8f398 100644
>> --- a/include/efi.h
>> +++ b/include/efi.h
>> @@ -19,7 +19,7 @@
>> #include <linux/string.h>
>> #include <linux/types.h>
>>
>> -#ifdef CONFIG_EFI_STUB_64BIT
>> +#if defined(CONFIG_EFI_STUB_64BIT) || defined(CONFIG_SANDBOX)
>
> btw, maybe we should have CONFIG_SANDBOX_$arch somehow so we don't
> have to assume SANDBOX==X86 (but I guess at least just having
> efi_loader work in sandbox on x86 is a nice first step)
Ah, sorry, read that too late. I use aarch64 systems productively these
days, so I would certainly prefer if we could not block ourselves in on
any x86_64 host dependency - even if it's just for make test :)
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI
2017-09-18 17:47 [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI Rob Clark
2017-09-18 18:27 ` Rob Clark
2017-09-18 20:58 ` Alexander Graf
@ 2017-09-25 2:12 ` Simon Glass
2 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2017-09-25 2:12 UTC (permalink / raw)
To: u-boot
On 18 September 2017 at 11:47, Rob Clark <robdclark@gmail.com> wrote:
> This is needed to run 'bootefi' from sandbox. I suspect StartImage()
> must have been broken too on x86.
>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
> cmd/bootefi.c | 2 +-
> include/efi.h | 2 +-
> lib/efi_loader/efi_boottime.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-09-25 2:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-18 17:47 [U-Boot] [PATCH] efi_loader: EFI entry point should be EFIAPI Rob Clark
2017-09-18 18:27 ` Rob Clark
2017-09-18 20:59 ` Alexander Graf
2017-09-18 20:58 ` Alexander Graf
2017-09-25 2:12 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox