public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] efi_loader: Always use EFIAPI instead of asmlinkage
Date: Wed, 24 Jan 2018 15:21:38 +0100	[thread overview]
Message-ID: <20180124142138.1988-1-agraf@suse.de> (raw)
In-Reply-To: <20180124140454.82768-2-agraf@suse.de>

EFI calls are usually defined as asmlinkage. That means we pass all parameters
to functions via the stack x86_32.

On x86_64 however, we need to also stick to the MS ABI calling conventions,
which the EFIAPI define conveniently handles for us. Most EFI functions were
also marked with EFIAPI, except for the entry call.

So this patch adjusts all entry calls to use EFIAPI instead of the manual
asmlinkage attribute.

While at it, we also change the prototype of the entry point to return
efi_status_t instead of ulong, as this is the correct prototype definition.

Signed-off-by: Alexander Graf <agraf@suse.de>

---

v1 -> v2:

  - Use efi_status_t in all occurences
---
 cmd/bootefi.c                 | 11 ++++++-----
 lib/efi_loader/efi_boottime.c |  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 51213c0293..545cfecc12 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -126,8 +126,9 @@ static void *copy_fdt(void *fdt)
 
 static efi_status_t efi_do_enter(
 			efi_handle_t image_handle, struct efi_system_table *st,
-			asmlinkage ulong (*entry)(efi_handle_t image_handle,
-						  struct efi_system_table *st))
+			EFIAPI efi_status_t (*entry)(
+				efi_handle_t image_handle,
+				struct efi_system_table *st))
 {
 	efi_status_t ret = EFI_LOAD_ERROR;
 
@@ -138,7 +139,7 @@ static efi_status_t efi_do_enter(
 }
 
 #ifdef CONFIG_ARM64
-static efi_status_t efi_run_in_el2(asmlinkage ulong (*entry)(
+static efi_status_t efi_run_in_el2(EFIAPI efi_status_t (*entry)(
 			efi_handle_t image_handle, struct efi_system_table *st),
 			efi_handle_t image_handle, struct efi_system_table *st)
 {
@@ -162,8 +163,8 @@ static efi_status_t do_bootefi_exec(void *efi, void *fdt,
 	struct efi_device_path *memdp = NULL;
 	ulong ret;
 
-	ulong (*entry)(efi_handle_t image_handle, struct efi_system_table *st)
-		asmlinkage;
+	EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
+				     struct efi_system_table *st);
 	ulong fdt_pages, fdt_size, fdt_start, fdt_end;
 	const efi_guid_t fdt_guid = EFI_FDT_GUID;
 	bootm_headers_t img = { 0 };
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 39d8511fe3..27c94e4474 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1534,8 +1534,8 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
 					   unsigned long *exit_data_size,
 					   s16 **exit_data)
 {
-	asmlinkage ulong (*entry)(efi_handle_t image_handle,
-				  struct efi_system_table *st);
+	EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
+				     struct efi_system_table *st);
 	struct efi_loaded_image *info = image_handle;
 	efi_status_t ret;
 
-- 
2.12.3

      reply	other threads:[~2018-01-24 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 14:04 [U-Boot] [PATCH 1/2] efi: Conflict efi_loader with different stub bitness Alexander Graf
2018-01-24 14:04 ` [U-Boot] [PATCH 2/2] efi_loader: Always use EFIAPI instead of asmlinkage Alexander Graf
2018-01-24 14:21   ` Alexander Graf [this message]

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=20180124142138.1988-1-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.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