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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 98F97C7619A for ; Thu, 30 Mar 2023 21:33:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD16E85D9D; Thu, 30 Mar 2023 23:33:22 +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="cEK6Usj0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B01C85B34; Thu, 30 Mar 2023 23:33:19 +0200 (CEST) Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (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 3FFB685D9D for ; Thu, 30 Mar 2023 23:33:16 +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-pj1-x1029.google.com with SMTP id r7-20020a17090b050700b002404be7920aso19340398pjz.5 for ; Thu, 30 Mar 2023 14:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1680211994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JY1Fn+6XKDtbq3z+gxrPrC7zfQ2WFUZDLoT/h49u9XY=; b=cEK6Usj0JQ78aM2VS5qtwIwVCmvOcLyWISynNTc4XTjKuU0g1RrK4maK/aHu3xQ0fN nz4W/uHsjCm3rOoxPFCbGRm+OgyXY1TyaPRcu3W3pTzuYGYMFZuZlAcGVukTD7Z1jKU4 /C43JU5ZyZW6UOW8s/Fi1bmgFBJtzbe4biUAs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680211994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JY1Fn+6XKDtbq3z+gxrPrC7zfQ2WFUZDLoT/h49u9XY=; b=2VTY1c4tgM5PTNBXwdFOb2mI16WuIpP/7acCMKQEXMmzm4BsHAuCA/VUzze+K2dktp 0AdBBa2irjWzIHI5ZaT3KT6HbgJJz1oDj+E0zQmQ6WvhbOaTkmwV1jOG7gXrf0ynNs86 bkz+GVhutHSU/B6JpPp8SAJ6VFCMXUL/YW22MLPRnUrQRqBV4d/vJA45xp3k7Lh0uW// O6XUGKWMZtU+M5j4TnTkjT3P55gZsED8ndPOyHBdgQv7sO1jSvmBGt1utB2JgIfHufE5 9Ez4v4xTzHiS3zCcy/Mv/wZkj8lkyw/d4QeUwC+GQZvXWpRlYGykEyOCEn0l/xISCMKw gQyg== X-Gm-Message-State: AAQBX9ekZDWQBZG2cPumtnmZXDMCzR2eHrjY/lCbuIgbCW8L1i5cqQkl BldP/wbFqt73AKqQjRMuOJeD4vOw+2JV4Gn0zys= X-Google-Smtp-Source: AKy350bzgfQ4B/vYan9qpYZ5AHVz64gVn6NVJqv6dJtSUPz0nq8MBg7z9EHbubzHAWMLetUentbmgA== X-Received: by 2002:a17:902:d505:b0:1a1:e39c:d4d1 with SMTP id b5-20020a170902d50500b001a1e39cd4d1mr28844711plg.67.1680211994479; Thu, 30 Mar 2023 14:33:14 -0700 (PDT) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id q6-20020a170902b10600b001a282714f97sm144413plr.275.2023.03.30.14.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 14:33:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Heinrich Schuchardt , Simon Glass Subject: [PATCH 01/38] x86: Tidy up availability of string functions Date: Fri, 31 Mar 2023 10:31:50 +1300 Message-Id: <20230330213227.2142353-2-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog In-Reply-To: <20230330213227.2142353-1-sjg@chromium.org> References: <20230330213227.2142353-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean For now, just enable the fast-but-large string functions in 32-boot U-Boot proper only. Avoid using them in SPL. We cannot use then in 64-bit builds since we only have 32-bit assembly. Signed-off-by: Simon Glass --- arch/x86/include/asm/string.h | 6 +++++- arch/x86/lib/Makefile | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h index c15b264a5c08..5c49b0f009b7 100644 --- a/arch/x86/include/asm/string.h +++ b/arch/x86/include/asm/string.h @@ -14,7 +14,11 @@ extern char *strrchr(const char *s, int c); #undef __HAVE_ARCH_STRCHR extern char *strchr(const char *s, int c); -#ifdef CONFIG_X86_64 +/* + * Our assembly routines do not work on in 64-bit mode and we don't do a lot of + * copying in SPL, so code size is more important there. + */ +#if defined(CONFIG_SPL_BUILD) || !IS_ENABLED(CONFIG_X86_32BIT_INIT) #undef __HAVE_ARCH_MEMCPY extern void *memcpy(void *, const void *, __kernel_size_t); diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index a6f22441474b..b0612ae6dd5f 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -10,7 +10,9 @@ obj-y += bios.o obj-y += bios_asm.o obj-y += bios_interrupts.o endif -obj-y += string.o +endif +ifndef CONFIG_SPL_BUILD +obj-$(CONFIG_X86_32BIT_INIT) += string.o endif ifndef CONFIG_SPL_BUILD obj-$(CONFIG_CMD_BOOTM) += bootm.o -- 2.40.0.348.gf938b09366-goog