From patchwork Wed Jul 2 12:54:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 32978 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 87BBD20560 for ; Wed, 2 Jul 2014 12:57:31 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id dc16sf23362023qab.1 for ; Wed, 02 Jul 2014 05:57:31 -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 :in-reply-to:references: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=5vaKGapScxkXGQgWYe21OXTgc/RseOucp0P88gv5btY=; b=EgTRX/9lB1FxfVpfE7zoYrk/L8b5OowxxzX01K3F8PxJJpnCIZuf9ZRaFTqY3VpcFz Pg5AQgUsF9hmKlAzy9WpO1cqVUn/1KZxfOMfPQBlLVaKz9ahmorFsDqjnTqhOMIso6hW kkhc/8r8ur+IFmFYg9Yv9eP0I7UIBAN704f+bHXUz/P183LL1BwSbO5srOzwWkM5EMIE lYN+pGiLiA1KLWPrvKV5OY8WzipXZSvHleU/Fsmda8lKV/fXN2VPDQxhplYLNjdSlSWu FxDwOWblEshZIot00NCjQG0wz0lh0Q4ET0/nFa+MirteI/uhhmsrOw0nSnKgoEx8g7KK m2JQ== X-Gm-Message-State: ALoCoQkBS0j6aNtMySVPeykLv06mgTQNEzQkEn3Wf13pMo0TVZIbgP5PFON09W8IOezunBZg6u79 X-Received: by 10.58.209.227 with SMTP id mp3mr28125867vec.29.1404305851388; Wed, 02 Jul 2014 05:57:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.235 with SMTP id s98ls29152qge.79.gmail; Wed, 02 Jul 2014 05:57:31 -0700 (PDT) X-Received: by 10.58.197.193 with SMTP id iw1mr151035vec.57.1404305851249; Wed, 02 Jul 2014 05:57:31 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id yw1si12825665vdb.44.2014.07.02.05.57.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 05:57:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hy4so10385474vcb.34 for ; Wed, 02 Jul 2014 05:57:31 -0700 (PDT) X-Received: by 10.52.241.76 with SMTP id wg12mr41297403vdc.5.1404305851156; Wed, 02 Jul 2014 05:57:31 -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.37.5 with SMTP id tc5csp291144vcb; Wed, 2 Jul 2014 05:57:30 -0700 (PDT) X-Received: by 10.68.171.193 with SMTP id aw1mr69369639pbc.117.1404305850368; Wed, 02 Jul 2014 05:57:30 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id qx10si30190442pbb.182.2014.07.02.05.57.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jul 2014 05:57:30 -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 1X2K4M-0007hm-KX; Wed, 02 Jul 2014 12:55:26 +0000 Received: from mail-we0-f174.google.com ([74.125.82.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2K4G-0006Za-C9 for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 12:55:21 +0000 Received: by mail-we0-f174.google.com with SMTP id u57so10993208wes.5 for ; Wed, 02 Jul 2014 05:54:58 -0700 (PDT) X-Received: by 10.180.75.75 with SMTP id a11mr42766415wiw.3.1404305698294; Wed, 02 Jul 2014 05:54:58 -0700 (PDT) Received: from ards-macbook-pro.local ([37.183.67.249]) by mx.google.com with ESMTPSA id r9sm54934910wia.17.2014.07.02.05.54.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 05:54:57 -0700 (PDT) From: Ard Biesheuvel To: matt.fleming@intel.com, x86@kernel.org Subject: [PATCH v3 2/5] efi/x86: efistub: Move shared dependencies to Date: Wed, 2 Jul 2014 14:54:40 +0200 Message-Id: <1404305683-26501-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1404305683-26501-1-git-send-email-ard.biesheuvel@linaro.org> References: <1404305683-26501-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140702_055520_569347_14B31DAE X-CRM114-Status: GOOD ( 12.52 ) 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.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.174 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-efi@vger.kernel.org, Ard Biesheuvel , catalin.marinas@arm.com, msalter@redhat.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.175 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 Signed-off-by: Matt Fleming --- 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 385f42c200bc..c066bc4e3051 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 3dbf56eb540d..9043f365ebf5 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -158,6 +158,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.