Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1630966lqm; Fri, 3 May 2024 01:13:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgH0PzY24nSsEk1SlPsDncohllpq0wn2406hGUxtTAIyOIHwj51nnAoPPZuyqOYpnseoVvBRcIQGO6r8n9zuSqeDopUWBZO1F2jZYvSA== X-Google-Smtp-Source: AGHT+IFEpbs9dwamVoc3/5R/9OygCEg4QhyfPHj8k6CSSGHnctH5ociHPbGlLVomttK3jozKpaRc X-Received: by 2002:a05:6a20:d043:b0:1a7:55f2:c92c with SMTP id hv3-20020a056a20d04300b001a755f2c92cmr2378246pzb.45.1714724018145; Fri, 03 May 2024 01:13:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714724018; cv=pass; d=google.com; s=arc-20160816; b=K/1NPxYnxAIGrlWkSDLFTCA9Ip84Z58X3Op398Lac85QEaz3PMpOvwOvOCosfnn6Yb UYFK6KFo/eaNMiInmjJ7U8hjAkH7DUjAfIEXVA2GHwsM0wT+s5ShZXadcWPLWUN2RWRW djyEL+xQK2SpUaU1uirdlev8TDtPtAMl8QD1PoehNgvieZdyLvmsmPuOMvH7NbrF/YnA TcW+fzKZOwCIu733yN7Nj976AxalDvuzivV2JMA0rKTtAeLu6OeleO7V2wkIViN9HIxf lLRTya07zAs/3bB0QqG96/ZQy0Mv0p7QnN5eQvgJmmHEiTh7nPETQuHCI/7jvX3oe4bg qBKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VEqzYYO9i8B69u3iokverwgSU99Bi3OJCOwoMx/yn1c=; fh=KsdebulFSTDgUgDP2OamvZF2uEg8nzoUdEjFl7UPhdc=; b=NZUZz6o6hU7j8ARHcvk8PtSakD1m5PiCOma2ctir/GFrR3Ct1ZlUJVj24MKYJ0STE3 KWuglUcyQ+RipN+SlPypLWrCREDXSQCSzPk9aHtzRRQJ8N1tidZH71tSu8hG0aMQQD+w sZv+U5RMhkTIg3fowavWnu7FXx5E5RPLIER4dA5osW0A8fZ24C6h7yt9ORr5MSBT7YGL 23Eswp0p9n8KY+kjoMRLD4UuTDOIMJj234CPhjsJ82BZpVViDq8xZNA2pQTZyK+ONTpv oA2rjrnKCYKSUDQuSgwdDSQLDxQqhMih1sIGfdWZq2ZutH1J3nDz3TNNBpGMc1PgFpHp vZnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f4i6Ch0Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167353-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id im15-20020a170902bb0f00b001ed3ad04f70si789555plb.301.2024.05.03.01.13.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 01:13:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167353-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f4i6Ch0Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167353-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 121C5B225A9 for ; Fri, 3 May 2024 08:12:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EE63149C6B; Fri, 3 May 2024 08:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f4i6Ch0Y" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7773B148FF3; Fri, 3 May 2024 08:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714723929; cv=none; b=uRJOacK9xkplDnu2pxrqP9uPrtlSDfVGWTmpPm92vFh41T8Jy2Hppa9O9CmxAcDJgAxZoM0nA7K043Sp3/XY0HbrjyFheVozx7fWEHyeE2S/+go8Iqrr+f5Q6DCxQkbDr4yaNYbuZSILlLwD5sQZ9FYI8UkoCeJK4vs2GUk1xgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714723929; c=relaxed/simple; bh=9O73EmjeYBY7iwhf3ePFN3iterJdli5ckZiBCP/CfUQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=me8h4RKbIInsIeWgFnk5K1dIR7nofiEz/oSDgrXbCsEHofakadjAp3H35/ccQ7tKJHgbHHfh459OJbKWDybwqg0IZ2HB8GGkzA3LvMdbC8ch/1/aTpGOugGvwOKDZlTX37qEdICy4Kj3HxhHUKLB9UqgcsAptbFkMzYkB8gBqYo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f4i6Ch0Y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D04C1C4AF18; Fri, 3 May 2024 08:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714723929; bh=9O73EmjeYBY7iwhf3ePFN3iterJdli5ckZiBCP/CfUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4i6Ch0YRVVJYdTMNATrJPzeAhRA7nosPIwfGWzCIgUuGhUkwxhcH1nglvd0+adKh tdWIwwIy7wxljULJBAoe94AdptvMHdFN3cn5FgPuiUCgYKWQfDUDS0a0mTBS7TLjG1 +CIlwzycBO4F9DJOV6rfNMSPn2mIj2gAA/ZCg+GPodptNw1OL6j3jpZIegpyrRls0d qq+xoDUEi6PNksH+Xc5kFTH2H0ffxC+lROev/e/HFW27bE74KFbIXWZdusiCJNnqaw psEkPeOAAVHJlpp0KXu1ehEriYpisQrmJUJfe6sJkd+VF4K/Xra8CpfXRpsWr0GXwW MK0eYPcfLjFwA== From: Arnd Bergmann To: linux-alpha@vger.kernel.org Cc: Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexander Viro , Marc Zyngier , Linus Torvalds , "Paul E. McKenney" , linux-kernel@vger.kernel.org Subject: [PATCH 01/14] alpha: sort scr_mem{cpy,move}w() out Date: Fri, 3 May 2024 10:11:12 +0200 Message-Id: <20240503081125.67990-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503081125.67990-1-arnd@kernel.org> References: <20240503081125.67990-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Al Viro Take scr_memmove() out of line, make both it and scr_memcpyw() conditional upon VGA_CONSOLE or MDA_CONSOLE (if neither is selected, we are certain to be working with the kernel-allocated buffer rather than VRAM and defaults will work just fine). That allows to clean vt_buffer.h, but that's a separate story Signed-off-by: Al Viro Signed-off-by: Arnd Bergmann --- arch/alpha/include/asm/vga.h | 2 ++ arch/alpha/kernel/io.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/arch/alpha/include/asm/vga.h b/arch/alpha/include/asm/vga.h index 4c347a8454c7..919931cb5b63 100644 --- a/arch/alpha/include/asm/vga.h +++ b/arch/alpha/include/asm/vga.h @@ -13,6 +13,7 @@ #define VT_BUF_HAVE_RW #define VT_BUF_HAVE_MEMSETW #define VT_BUF_HAVE_MEMCPYW +#define VT_BUF_HAVE_MEMMOVEW static inline void scr_writew(u16 val, volatile u16 *addr) { @@ -40,6 +41,7 @@ static inline void scr_memsetw(u16 *s, u16 c, unsigned int count) /* Do not trust that the usage will be correct; analyze the arguments. */ extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count); +extern void scr_memmovew(u16 *d, const u16 *s, unsigned int count); /* ??? These are currently only used for downloading character sets. As such, they don't need memory barriers. Is this all they are intended diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c index eda09778268f..c28035d6d1e6 100644 --- a/arch/alpha/kernel/io.c +++ b/arch/alpha/kernel/io.c @@ -647,6 +647,10 @@ void _memset_c_io(volatile void __iomem *to, unsigned long c, long count) EXPORT_SYMBOL(_memset_c_io); +#if IS_ENABLED(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE) + +#include + /* A version of memcpy used by the vga console routines to move data around arbitrarily between screen and main memory. */ @@ -681,6 +685,21 @@ scr_memcpyw(u16 *d, const u16 *s, unsigned int count) EXPORT_SYMBOL(scr_memcpyw); +void scr_memmovew(u16 *d, const u16 *s, unsigned int count) +{ + if (d < s) + scr_memcpyw(d, s, count); + else { + count /= 2; + d += count; + s += count; + while (count--) + scr_writew(scr_readw(--s), --d); + } +} +EXPORT_SYMBOL(scr_memmovew); +#endif + void __iomem *ioport_map(unsigned long port, unsigned int size) { return IO_CONCAT(__IO_PREFIX,ioportmap) (port); -- 2.39.2