From patchwork Mon Jun 16 15:14:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 31973 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 747D120E7A for ; Mon, 16 Jun 2014 15:20:06 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oy12sf17319252veb.10 for ; Mon, 16 Jun 2014 08:20:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=OyrzT3DjFavl7h1tEE5Of+5RdbhH2Jmz8EQfG4FEQ04=; b=Jh0VdoBBN1kfy8jlXPP3OKgHPIZVxo7+DR0ZutCVXVhaWOXm4hr7Ay6zO7J4WEiL7J PPQJ/gqVHnCFtOwhyCVSQeR1GuMLjHkCLQdKVV9JHM6u7TpukTEzY9c6yd4AWlGtTe5F DHnZNccgjlzL2PjrPGc65UKGpwkQTCLS9PEbObeSwWPKr7flqA7cdWRDyWX3BiKADOBn LFWnPOTmiYJapTJi3/vX59YJPn+seLCVBZFdcbxy5AR4XNpJwjk6jGGkpRK4FwxFSc8T U/Behbrxf4X7X+Uxb/FnCvGES8unwEeOwL8dMJ3grura09BhLKHvDwqhdotBlfy2LSaV 55Kg== X-Gm-Message-State: ALoCoQndS3j82HN2RPViIdC1HzB5eVda8XIYKmyhjuKJ1Yyajl/gWUSICoKDKcfZPsKNCQiPUkUx X-Received: by 10.58.134.36 with SMTP id ph4mr9413620veb.27.1402932006195; Mon, 16 Jun 2014 08:20:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.241 with SMTP id g104ls1004962qge.17.gmail; Mon, 16 Jun 2014 08:20:06 -0700 (PDT) X-Received: by 10.220.69.72 with SMTP id y8mr16706926vci.21.1402932006105; Mon, 16 Jun 2014 08:20:06 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id gu7si4215117vdc.22.2014.06.16.08.20.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:20:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so5046743vcb.17 for ; Mon, 16 Jun 2014 08:20:06 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr16970248vcg.16.1402932006031; Mon, 16 Jun 2014 08:20:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp142145vcb; Mon, 16 Jun 2014 08:20:05 -0700 (PDT) X-Received: by 10.140.41.113 with SMTP id y104mr18073659qgy.34.1402932005641; Mon, 16 Jun 2014 08:20:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id m2si13605979qag.32.2014.06.16.08.20.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jun 2014 08:20:05 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwYfk-0002nh-WA; Mon, 16 Jun 2014 15:18:13 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwYcm-0007D2-3l for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2014 15:15:09 +0000 Received: by mail-wi0-f171.google.com with SMTP id n15so4272350wiw.16 for ; Mon, 16 Jun 2014 08:14:43 -0700 (PDT) X-Received: by 10.180.83.200 with SMTP id s8mr28126824wiy.2.1402931683751; Mon, 16 Jun 2014 08:14:43 -0700 (PDT) Received: from ards-macbook-pro.guests.st.com (29-39.80-90.static-ip.oleane.fr. [90.80.39.29]) by mx.google.com with ESMTPSA id wj4sm19157731wjc.23.2014.06.16.08.14.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:14:43 -0700 (PDT) From: Ard Biesheuvel To: matt.fleming@intel.com, x86@kernel.org Subject: [RFC PATCH 1/4] efi/x86: efistub: move shared dependencies to Date: Mon, 16 Jun 2014 17:14:45 +0200 Message-Id: <1402931688-23597-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140616_081508_338007_668D6F02 X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.171 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-efi@vger.kernel.org, Ard Biesheuvel , catalin.marinas@arm.com, leif.lindholm@linaro.org, roy.franz@linaro.org, hpa@zytor.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This moves definitions depended upon both by code under arch/x86/boot and under drivers/firmware/efi to . This is in preparation of turning the stub code under drivers/firmware/efi into a static library. Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/eboot.c | 5 +---- arch/x86/boot/compressed/eboot.h | 16 ---------------- arch/x86/include/asm/efi.h | 25 +++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 0331d765c2bb..2fd5e2643623 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -19,10 +19,7 @@ static efi_system_table_t *sys_table; -static struct efi_config *efi_early; - -#define efi_call_early(f, ...) \ - efi_early->call(efi_early->f, __VA_ARGS__); +struct efi_config *efi_early; #define BOOT_SERVICES(bits) \ static void setup_boot_services##bits(struct efi_config *c) \ diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h index c88c31ecad12..d487e727f1ec 100644 --- a/arch/x86/boot/compressed/eboot.h +++ b/arch/x86/boot/compressed/eboot.h @@ -103,20 +103,4 @@ struct efi_uga_draw_protocol { void *blt; }; -struct efi_config { - u64 image_handle; - u64 table; - u64 allocate_pool; - u64 allocate_pages; - u64 get_memory_map; - u64 free_pool; - u64 free_pages; - u64 locate_handle; - u64 handle_protocol; - u64 exit_boot_services; - u64 text_output; - efi_status_t (*call)(unsigned long, ...); - bool is64; -} __packed; - #endif /* BOOT_COMPRESSED_EBOOT_H */ diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 1eb5f6433ad8..55059a50a01f 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -156,6 +156,31 @@ static inline efi_status_t efi_thunk_set_virtual_address_map( return EFI_SUCCESS; } #endif /* CONFIG_EFI_MIXED */ + + +/* arch specific definitions used by the stub code */ + +struct efi_config { + u64 image_handle; + u64 table; + u64 allocate_pool; + u64 allocate_pages; + u64 get_memory_map; + u64 free_pool; + u64 free_pages; + u64 locate_handle; + u64 handle_protocol; + u64 exit_boot_services; + u64 text_output; + efi_status_t (*call)(unsigned long, ...); + bool is64; +} __packed; + +extern struct efi_config *efi_early; + +#define efi_call_early(f, ...) \ + efi_early->call(efi_early->f, __VA_ARGS__); + #else /* * IF EFI is not configured, have the EFI calls return -ENOSYS.