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 A3A33C6FD19 for ; Mon, 13 Mar 2023 03:13:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B72D586109; Mon, 13 Mar 2023 04:11:51 +0100 (CET) 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="XRmIbKtt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 35820858ED; Mon, 13 Mar 2023 04:11:36 +0100 (CET) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 E26E386022 for ; Mon, 13 Mar 2023 04:11:32 +0100 (CET) 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-il1-x136.google.com with SMTP id x10so6299110ill.12 for ; Sun, 12 Mar 2023 20:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678677091; 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=1eeEoYPIuGpjlxw1zyr5GTEiDzfdn90QI/GYWFubmv4=; b=XRmIbKtt/WokiZIzSDYPR+Qii+dCAk5eCyXKEMDgED/hutrTmFHl+3Pz1E3+R9Zbr4 PXaIn/XpL1od140n/1r878xk7PKPfgen5iJQybHum1qt6/9QwjaYCfkJis402y/cQIHX FokrofJ6I30rvIOTuFRCCv+ZXUl+IznkND2Qg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678677091; 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=1eeEoYPIuGpjlxw1zyr5GTEiDzfdn90QI/GYWFubmv4=; b=BUwi7YJut9/Ld4WP1lJyC+9DnIgIKy5eYmncV0WVIgFh6gVROvF0DJnXa6WntPlFb0 0JxqEp6tAyMi7Z34I+BUU2MyaIZjfFiUDmUGWXmT3Oxgyaeqk8H4SGodY7btHhc6vT4d 4xqPG7S4gRTPDZFQnHLyzVvbfOaJIgre6f42fV4oegTkpcMdgth2N1YmNejBgHFX3yae A3c7+1t6T88XfOTcHeXRp+kC047htmVvjMR3H6eEsmkzDAUU5Yt6rjlMv8zj0Gfno99+ Ef7woWmxquw8tyYsqd6Ua5xfRcshueASLaVnJMdPLQhMWET6v7ODkU9XIItmyFdYe4bE GpUQ== X-Gm-Message-State: AO0yUKVKUnB5KNy08dmETF9DzMV1Tx9TTXH4UdZ7XV7PRE0M1lM/ANlY Lww0gB7jH1jZvtd5ELvm8d1KHuCKO5lkEppjA2c= X-Google-Smtp-Source: AK7set9JFU3wuHBD7yNtQ0Nej6zZMT2IygyZop7dQuTIYmS9tg92bUvnecaT7RTNCQJyUpPTKhkpPw== X-Received: by 2002:a05:6e02:1686:b0:319:6826:5577 with SMTP id f6-20020a056e02168600b0031968265577mr29932435ila.23.1678677091456; Sun, 12 Mar 2023 20:11:31 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id b7-20020a02a587000000b003c4f902cca5sm2089409jam.172.2023.03.12.20.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 20:11:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH 06/13] x86: Tidy up availability of string functions Date: Sun, 12 Mar 2023 21:11:03 -0600 Message-Id: <20230313031111.725395-7-sjg@chromium.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230313031111.725395-1-sjg@chromium.org> References: <20230313031111.725395-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.rc1.284.g88254d51c5-goog