From patchwork Mon Apr 25 20:07:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66614 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1233326qge; Mon, 25 Apr 2016 13:08:36 -0700 (PDT) X-Received: by 10.66.15.106 with SMTP id w10mr8656264pac.32.1461614914037; Mon, 25 Apr 2016 13:08:34 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si3194971pfs.107.2016.04.25.13.08.33; Mon, 25 Apr 2016 13:08:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965074AbcDYUI0 (ORCPT + 29 others); Mon, 25 Apr 2016 16:08:26 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37317 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965050AbcDYUIU (ORCPT ); Mon, 25 Apr 2016 16:08:20 -0400 Received: by mail-wm0-f44.google.com with SMTP id n3so145612810wmn.0 for ; Mon, 25 Apr 2016 13:08:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Kkn3dDrZxz0HTvTziugR5pl1R6Z66qkOXhhU7mK34Lw=; b=Sg16byKAwE44mSLTB/2t0UbuJ6I2LuDxP7zQm6TCFsh4wssESeuIvirwPGYu+GmCIz WWRh0mNej0Ak1/m0WlJeQdsu1E/Nzj2x/nJFcMqC3x5lEhYu+v9ATMyBmrSmoFiOSQLa NQSy/ED+J48hlF8my7XXqYFAOEwvX5ocZWd9slviyJ+unwkcVShriTHZio/MMhh45q0f podKHTZgNh5BHEV8Ksg0E1C8jBxNYaUfW4t2icc4+wA+QcgSTDC2yni9XtY03OvDa7G5 G0cbccNyNYHozr9HxFxDa6iZwTBEzrGD5hE/L48BWflLcKd60Mo++wKwMVkIXv/DerXl qTHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Kkn3dDrZxz0HTvTziugR5pl1R6Z66qkOXhhU7mK34Lw=; b=BhTL72ZYQM8aDdnHPf0u/aJol+PzLTtdJDt56n75eefg9fsTBhl73xf732Qx0Dtrgk 1E12TofPReUvuAu5OtGIByRvLHPDpqa5wXmgjFl9X+NVa9je+DnpP0ZA5lYJgAJa3vGf vVezjRKMc1/PXH7eufgk6n4SRshWuLHtlvoawMgASMrYpoVqKJDwWxtmTXiqxlKaI2UQ 4rFsKgM2/fWb64zT+VzFBnwnDCIe5EJVyPlahhHhrbivW9m2Ma9UzUPlhd8ko5OeDY/2 IPM6KqYygJYxcYY9kMjemW/P8un7iAS5UUf/oiebUGm7xj1Q2mGbYvY9jcVUSd29ztyz g1WA== X-Gm-Message-State: AOPr4FW/NDnmDoGqfHOBuRAJwYXAva4cAIbR9zAZ/mVKa3r0m2Voz4bBkERRyKG0gqiAaQ== X-Received: by 10.28.48.145 with SMTP id w139mr13535321wmw.51.1461614899672; Mon, 25 Apr 2016 13:08:19 -0700 (PDT) Received: from localhost (bcdc58e5.skybroadband.com. [188.220.88.229]) by smtp.gmail.com with ESMTPSA id o128sm20304093wmb.19.2016.04.25.13.08.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 13:08:19 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Mark Rutland , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Catalin Marinas , Colin Ian King , Leif Lindholm , Russell King , Will Deacon Subject: [PATCH 33/40] arm/efi: Move to generic {__,}efi_call_virt Date: Mon, 25 Apr 2016 21:07:05 +0100 Message-Id: <1461614832-17633-34-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland Now there's a common template for {__,}efi_call_virt, remove the duplicate logic from the arm efi code. Signed-off-by: Mark Rutland Reviewed-by: Ard Biesheuvel Cc: Leif Lindholm Cc: Matt Fleming Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Catalin Marinas Cc: "H. Peter Anvin" Cc: Thomas Gleixner Cc: Will Deacon Cc: Colin Ian King Signed-off-by: Matt Fleming --- arch/arm/include/asm/efi.h | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) -- 2.7.3 diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h index b45fe39bf35b..5f273b43d704 100644 --- a/arch/arm/include/asm/efi.h +++ b/arch/arm/include/asm/efi.h @@ -24,26 +24,14 @@ void efi_init(void); int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md); -#define efi_call_virt(f, ...) \ -({ \ - efi_##f##_t *__f; \ - efi_status_t __s; \ - \ - efi_virtmap_load(); \ - __f = efi.systab->runtime->f; \ - __s = __f(__VA_ARGS__); \ - efi_virtmap_unload(); \ - __s; \ -}) +#define arch_efi_call_virt_setup() efi_virtmap_load() +#define arch_efi_call_virt_teardown() efi_virtmap_unload() -#define __efi_call_virt(f, ...) \ +#define arch_efi_call_virt(f, args...) \ ({ \ efi_##f##_t *__f; \ - \ - efi_virtmap_load(); \ __f = efi.systab->runtime->f; \ - __f(__VA_ARGS__); \ - efi_virtmap_unload(); \ + __f(args); \ }) static inline void efi_set_pgd(struct mm_struct *mm)