From patchwork Wed Jan 24 14:21:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125666 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp447530ljf; Wed, 24 Jan 2018 06:21:47 -0800 (PST) X-Google-Smtp-Source: AH8x224b5PWNwd5ts8keMM97och5XO1jnkfUOVcrk6iBbEsLNLKH3+CK4Sl4iimNFO2tdshTYcmr X-Received: by 10.80.208.197 with SMTP id g5mr24781954edf.216.1516803707633; Wed, 24 Jan 2018 06:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516803707; cv=none; d=google.com; s=arc-20160816; b=nSbz61AU9iKA+m7NB5hIDWrlq9khRVD2qYolURSH6Na7jQiqipDXIPHHcPFxtOL1ih 4rmOBmhYbLvpf1oeMvfUi9rMLkBLFSG8kwLjhz3A1U8M20rRzfCacogmobMmUXL2YiOm 8y2y8qWwHP86CD85SpI9jQRc5dMxcaf8X3y2IrLN6dQHnJwOdavoL1h6+lyFMjr+FYiR T0eJag19pNLTo3IXc9iIH0WE1bP3Kymnsvac425pcwhyxLNlvQ8d61pPKG/YuhC1+IR+ FatJn8FuTAspP1KVJuGoVY7gAtX9CskwMlpqYO0bRAXt3wvvG4UGnsIaibLRkvisJ2hk g6Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=I2r+LmMlrl4eudCZrdsgKWYPptUbcXRX0XdItgmyNh0=; b=uInYiLE6n68ya5rAXiKRgvNuPq/I4xxM2KvH/zGWud8lh95fuFmVspRDd24bsTvtDF gWrlfqz+XwH50QO1aABK8LPzRWNnt8/lmwsRkq6ShsNAvcZz1mNnBTl6HDfsqPkejMQe 0EwrEcrB+C19psi8T3Qydj8Fwg1dB6TberJb15vAhY2ewJHS4qwFoyRBpLKgIEOPi8dN JQU+/M2yD7nKyzzAcXnLts7c6i71CCvkXNhtQ/rBG7lvaQegU3VQravB0aWet4aTSH/I jNBzGDx2QBmCsaOY0Mfx5jlsqkioSwPgkZndTq/GK+2gF3uF7Ec594SsEXLPeai/wSO3 NiNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id k26si323795edk.219.2018.01.24.06.21.46; Wed, 24 Jan 2018 06:21:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id CEDACC2224A; Wed, 24 Jan 2018 14:21:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0E3C7C21F2B; Wed, 24 Jan 2018 14:21:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D6E10C21F2B; Wed, 24 Jan 2018 14:21:40 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 5BB21C21C93 for ; Wed, 24 Jan 2018 14:21:40 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 07EFEAD00; Wed, 24 Jan 2018 14:21:40 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Wed, 24 Jan 2018 15:21:38 +0100 Message-Id: <20180124142138.1988-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180124140454.82768-2-agraf@suse.de> References: <20180124140454.82768-2-agraf@suse.de> Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH v2 2/2] efi_loader: Always use EFIAPI instead of asmlinkage X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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;