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 497E8C77B7D for ; Tue, 18 Apr 2023 15:33:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 101B986130; Tue, 18 Apr 2023 17:31:36 +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="G0hl4JoV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 61F88860C8; Tue, 18 Apr 2023 17:31:25 +0200 (CEST) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 B2637860AF for ; Tue, 18 Apr 2023 17:31: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=sjg@chromium.org Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7606ce9bfdeso291350739f.0 for ; Tue, 18 Apr 2023 08:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681831881; x=1684423881; 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=fmXDEs9obPEZ8VnvKDpNR1ONA5+bpTqFnofZnRjPL2E=; b=G0hl4JoVGNNCoq41FwMwRL35Ji6TKGkQAteBz8dap12qiHVrPCXrg7oLjfSmQL0DCY ri8Nm8oO7tmIxJi9Mi0LuRYA6nYcwdee24iMKzXRRrfX7OzSdYFvB6OzZSdCaAwyGx5p /aRizQ1QEhKGmFwr1ZAmh+jXoADdmLMgmFehM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681831881; x=1684423881; 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=fmXDEs9obPEZ8VnvKDpNR1ONA5+bpTqFnofZnRjPL2E=; b=IBopqszRhMhiXWXvBUYorbTSIvN/IOx/A4eZAgNrQfY3s8A7ZDUX1MGDm6ctW0WM1o IXtV+uTk0uXz148FjpSdlb1OYepJb21yR2+elhdhJgxk3p/RYjeVoUW+YHrVp3Ucq1lU kriW3iH4veDMkubEdnotcOFAGtgYpcPk/rCFfTSM2PSqBhAdyufAEtOYr3hkKgrXdhGy /I9hDf1+zj92wETvGx0jS6UIlFB7OCFhBCX/MQUykygkoF/hZHtFayprVp6jUpmWgW52 5pa72ybvfuWXiJTy9A4j+4EpXgOBgsCt0vVPdBS3dRVXev4ABlfdWwJwhAFootD+45tT Npog== X-Gm-Message-State: AAQBX9edmAa9diEUFfq66rinxzX5ljeNjRL5gb427q6skCSE7cONqL2x G3zQ29D19cs/kmyNVpO2vSGpu9Bpb2n0GO2sU70= X-Google-Smtp-Source: AKy350Y/WjAumwCK3SzRXc9jTVF6DswJi6ly37Bq6YBuZZUiWMqmz0cs5fM+qRzqsR+rVF3OQL95Dw== X-Received: by 2002:a6b:4f19:0:b0:74c:c6ed:6de with SMTP id d25-20020a6b4f19000000b0074cc6ed06demr2346267iob.12.1681831881235; Tue, 18 Apr 2023 08:31:21 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id x8-20020a5d9448000000b0075845625e38sm4005945ior.28.2023.04.18.08.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 08:31:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v2 08/18] x86: Tidy up availability of string functions Date: Wed, 19 Apr 2023 03:30:51 +1200 Message-ID: <20230418153101.115816-9-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230418153101.115816-1-sjg@chromium.org> References: <20230418153101.115816-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 --- (no changes since v1) 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.634.g4ca3ef3211-goog