alpha: sort scr_mem{cpy,move}w() out

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 <viro@zeniv.linux.org.uk>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Al Viro 2024-01-30 14:25:43 -05:00 committed by Arnd Bergmann
parent fec50db703
commit 5d75315174
2 changed files with 21 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#define VT_BUF_HAVE_RW #define VT_BUF_HAVE_RW
#define VT_BUF_HAVE_MEMSETW #define VT_BUF_HAVE_MEMSETW
#define VT_BUF_HAVE_MEMCPYW #define VT_BUF_HAVE_MEMCPYW
#define VT_BUF_HAVE_MEMMOVEW
static inline void scr_writew(u16 val, volatile u16 *addr) 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. */ /* 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_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 /* ??? These are currently only used for downloading character sets. As
such, they don't need memory barriers. Is this all they are intended such, they don't need memory barriers. Is this all they are intended

View File

@ -647,6 +647,10 @@ void _memset_c_io(volatile void __iomem *to, unsigned long c, long count)
EXPORT_SYMBOL(_memset_c_io); EXPORT_SYMBOL(_memset_c_io);
#if IS_ENABLED(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE)
#include <asm/vga.h>
/* A version of memcpy used by the vga console routines to move data around /* A version of memcpy used by the vga console routines to move data around
arbitrarily between screen and main memory. */ arbitrarily between screen and main memory. */
@ -681,6 +685,21 @@ scr_memcpyw(u16 *d, const u16 *s, unsigned int count)
EXPORT_SYMBOL(scr_memcpyw); 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) void __iomem *ioport_map(unsigned long port, unsigned int size)
{ {
return IO_CONCAT(__IO_PREFIX,ioportmap) (port); return IO_CONCAT(__IO_PREFIX,ioportmap) (port);