Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Al Viro and committed by
Arnd Bergmann
5d753151 fec50db7

+21
+2
arch/alpha/include/asm/vga.h
··· 13 13 #define VT_BUF_HAVE_RW 14 14 #define VT_BUF_HAVE_MEMSETW 15 15 #define VT_BUF_HAVE_MEMCPYW 16 + #define VT_BUF_HAVE_MEMMOVEW 16 17 17 18 static inline void scr_writew(u16 val, volatile u16 *addr) 18 19 { ··· 41 40 42 41 /* Do not trust that the usage will be correct; analyze the arguments. */ 43 42 extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count); 43 + extern void scr_memmovew(u16 *d, const u16 *s, unsigned int count); 44 44 45 45 /* ??? These are currently only used for downloading character sets. As 46 46 such, they don't need memory barriers. Is this all they are intended
+19
arch/alpha/kernel/io.c
··· 647 647 648 648 EXPORT_SYMBOL(_memset_c_io); 649 649 650 + #if IS_ENABLED(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE) 651 + 652 + #include <asm/vga.h> 653 + 650 654 /* A version of memcpy used by the vga console routines to move data around 651 655 arbitrarily between screen and main memory. */ 652 656 ··· 684 680 } 685 681 686 682 EXPORT_SYMBOL(scr_memcpyw); 683 + 684 + void scr_memmovew(u16 *d, const u16 *s, unsigned int count) 685 + { 686 + if (d < s) 687 + scr_memcpyw(d, s, count); 688 + else { 689 + count /= 2; 690 + d += count; 691 + s += count; 692 + while (count--) 693 + scr_writew(scr_readw(--s), --d); 694 + } 695 + } 696 + EXPORT_SYMBOL(scr_memmovew); 697 + #endif 687 698 688 699 void __iomem *ioport_map(unsigned long port, unsigned int size) 689 700 {