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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFD59C433EF for ; Sat, 25 Sep 2021 00:33:59 +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 4E37D61212 for ; Sat, 25 Sep 2021 00:33:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4E37D61212 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 73FF2834E7; Sat, 25 Sep 2021 02:33:52 +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="C8G8COjE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4801D8352D; Sat, 25 Sep 2021 02:31:47 +0200 (CEST) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 AEFFF834FB for ; Sat, 25 Sep 2021 02:31:13 +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-ot1-x329.google.com with SMTP id 5-20020a9d0685000000b0054706d7b8e5so15493282otx.3 for ; Fri, 24 Sep 2021 17:31:13 -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=0GQkwwtMgsZrr5rNmbb+E4CAKgmDTZcwA+t1izc1/5U=; b=C8G8COjEBe6Jt5xERKKjHUAAFu2swFY/hkTpuw1h25bH9MyyFjn6uuko9Es/W0S9oA LBQFHAywcSf1V28XJws8mEFTX3DA1WXlkrEucI4PRDuQLtiu+8hTZR9d1oDLU67YfgB5 w/n9jjfpJWQAaWpeep9o6c6XliuzskeoZP0aE= 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=0GQkwwtMgsZrr5rNmbb+E4CAKgmDTZcwA+t1izc1/5U=; b=2i/aLH0lc+YQXPS8+/m2R188i0IF7HZRXr83b18+RDp/1znCZSF0POpaae/2nhtvWX VBi4BkrDOcL05AcqkaTTzjDc8YIPVQJ3CTuqSrU6rkzLIy+9aJ58eF/eoh/QAtOy6sPp 8YEPljTJj7j3ZIsz2r57E/24VHBo5wqj6b205+HgwIVm2dZWk+0e109gKPI6Ubc5X0yD aNnZLD1/IJVtec19qjmHmx4J0sSnBmxmMsCZfhNq5/rsoZBFlsoYHsZosGInwWEFaReO HFNk7LqtTv6qsJkH+mdRdCi85untqEc74gYedx75Kao3q3eciBuEclYoUKc1mziaWs6q 9v8A== X-Gm-Message-State: AOAM531GZdbcs4+6gvN2Z9rsqyXeq8DMgYNwFF8f9yeoq4XDo+PDAyMV 4EGbzLJvqLuaVc8rm2w2WXKPELsUXhBv1g== X-Google-Smtp-Source: ABdhPJxjSo4hflFDRaJ/2hT/tJpRY4uB/+Z99PjaLd5woSekjdAELyrUV7R86bikzoascTeSGVGxqw== X-Received: by 2002:a05:6830:1c1:: with SMTP id r1mr6586907ota.372.1632529872118; Fri, 24 Sep 2021 17:31:12 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id y83sm2491462oia.47.2021.09.24.17.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 17:31:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Bin Meng , Christian Melki , Tom Rini , Ilias Apalodimas , Simon Glass Subject: [PATCH v2 12/39] x86: Don't duplicate global_ptr in 64-bit EFI app Date: Fri, 24 Sep 2021 18:30:28 -0600 Message-Id: <20210924183029.v2.12.I9d50716f5114e41fc0d82bf3306c4bbb9c5e3e76@changeid> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog In-Reply-To: <20210925003055.759305-1-sjg@chromium.org> References: <20210925003055.759305-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 --- (no changes since v1) 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.685.g46640cef36-goog