From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E35AC433F5 for ; Wed, 8 Sep 2021 13:35:52 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD3B1611C8 for ; Wed, 8 Sep 2021 13:35:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BD3B1611C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2814B833C4; Wed, 8 Sep 2021 15:34:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="W47aGTas"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B6AFB833A3; Wed, 8 Sep 2021 15:34:41 +0200 (CEST) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B92DA8337C for ; Wed, 8 Sep 2021 15:34:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wr1-x432.google.com with SMTP id x6so3305745wrv.13 for ; Wed, 08 Sep 2021 06:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OF3mmoSUTSUu0sDNzH0BY0s3PRPEpRLKw0aIBN0QLDA=; b=W47aGTasjPoYfXS8caBnnMW9CSLIfIOdHd+8SgNDqTBvhI1LbxZf5hYnVomB4zUpn/ B3We9pWvu0ANQE2XWr9vQlLYyd5PRjUR6HahuVRFwlJIikgq1aJ9gxTRuQLrioEmqjtV KMhJHWW2tLJgxuajWwRgRLCVso7cxZC4Rz+yo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OF3mmoSUTSUu0sDNzH0BY0s3PRPEpRLKw0aIBN0QLDA=; b=ZJy95fxsVo+SwDkDkuL80WqYsAP0XzYiM94WILwM0jgRAHiHtAEQt1q0DbuEUghrlb recoTrLtHCG8iKSjiQuxC8/IrghScsBwIeQEwSq9bYJyGu1uvx7TCsHR5vijFsnxStJR OZ4JS0WkgN2oAT9vtb+olNFRQWPE1+hyRzLperFgZR1NYFrxvnCsx0U50Mxnkm/triVi MwRo2htOEJ7cxRpUCDIRc7ocui2TH9A8HW4ym1OzMeAZ/Yf+QLsQJxqJtKonBgdYyDOO lwpvJzjBL1zj9csWr/GyucUHPNtKwRBm+yFQbX3v5nYggFKa+rl6JjKebVJvJ0NJkLnX xL3g== X-Gm-Message-State: AOAM5333yjpagX+KDwvJkIDv1YF6sWJfo7ek4TaHDE5OIbHPRMbx1s3/ NRgTcUzphcaOEsPa/A44g8CAFHDkZmgCNgt8 X-Google-Smtp-Source: ABdhPJzdV8LOVLNbh2zji4i3Qoy4NYiq1z+lXhK0A9eGOfYF3gC1ldC9EIA3yfCXUNhzbhxigiDH5w== X-Received: by 2002:a05:6000:374:: with SMTP id f20mr4138598wrf.305.1631108070890; Wed, 08 Sep 2021 06:34:30 -0700 (PDT) Received: from sjg1.roam.corp.google.com (82-69-54-180.dsl.in-addr.zen.co.uk. [82.69.54.180]) by smtp.gmail.com with ESMTPSA id l2sm2209065wmi.1.2021.09.08.06.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 06:34:30 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Heinrich Schuchardt , Bin Meng , Tom Rini , Christian Melki , Simon Glass Subject: [PATCH 08/35] x86: Don't duplicate global_ptr in 64-bit EFI app Date: Wed, 8 Sep 2021 07:33:38 -0600 Message-Id: <20210908073355.8.I9d50716f5114e41fc0d82bf3306c4bbb9c5e3e76@changeid> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog In-Reply-To: <20210908133405.696481-1-sjg@chromium.org> References: <20210908133405.696481-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This variable is already defined by the EFI code. Drop the duplicate definition when building a 64-bit EFI app. Signed-off-by: Simon Glass --- arch/x86/cpu/x86_64/cpu.c | 16 ---------------- arch/x86/cpu/x86_64/misc.c | 16 ++++++++++++++++ lib/efi/efi.c | 9 +++++++++ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c index fb501218e25..a3674e8e29a 100644 --- a/arch/x86/cpu/x86_64/cpu.c +++ b/arch/x86/cpu/x86_64/cpu.c @@ -10,22 +10,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - -/* - * Global declaration of gd. - * - * As we write to it before relocation we have to make sure it is not put into - * a .bss section which may overlap a .rela section. Initialization forces it - * into a .data section which cannot overlap any .rela section. - */ -struct global_data *global_data_ptr = (struct global_data *)~0; - -void arch_setup_gd(gd_t *new_gd) -{ - global_data_ptr = new_gd; -} - int cpu_has_64bit(void) { return true; diff --git a/arch/x86/cpu/x86_64/misc.c b/arch/x86/cpu/x86_64/misc.c index 02587ff0c50..691b67ff68a 100644 --- a/arch/x86/cpu/x86_64/misc.c +++ b/arch/x86/cpu/x86_64/misc.c @@ -7,6 +7,22 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + +/* + * Global declaration of gd. + * + * As we write to it before relocation we have to make sure it is not put into + * a .bss section which may overlap a .rela section. Initialization forces it + * into a .data section which cannot overlap any .rela section. + */ +struct global_data *global_data_ptr = (struct global_data *)~0; + +void arch_setup_gd(gd_t *new_gd) +{ + global_data_ptr = new_gd; +} + int misc_init_r(void) { return 0; diff --git a/lib/efi/efi.c b/lib/efi/efi.c index 0c16a5fdd38..69e52e45748 100644 --- a/lib/efi/efi.c +++ b/lib/efi/efi.c @@ -17,6 +17,15 @@ #include #include +/* + * Global declaration of gd. + * + * As we write to it before relocation we have to make sure it is not put into + * a .bss section which may overlap a .rela section. Initialization forces it + * into a .data section which cannot overlap any .rela section. + */ +struct global_data *global_data_ptr = (struct global_data *)~0; + /* * Unfortunately we cannot access any code outside what is built especially * for the stub. lib/string.c is already being built for the U-Boot payload -- 2.33.0.153.gba50c8fa24-goog