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

parisc: Remove memcpy_fromio

Fully migrate parisc to the IO functions from lib/iomem_copy.c. In a
recent patch the functions memset_io and memcpy_toio were removed, but
the memcpy_fromio was kept, because for very short sequences it does
half word accesses, whereas the functions in lib/iomem_copy.c do byte
accesses until the memory is naturally aligned and then do machine word
accesses. But I don't think the single half-word access merits keeping
the arch specific implementation, so, remove it as well.

Signed-off-by: Julian Vetter <julian@outer-limits.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Julian Vetter and committed by
Helge Deller
4e3ff3c5 579e5fd9

-65
-3
arch/parisc/include/asm/io.h
··· 135 135 136 136 #define pci_iounmap pci_iounmap 137 137 138 - void memcpy_fromio(void *dst, const volatile void __iomem *src, int count); 139 - #define memcpy_fromio memcpy_fromio 140 - 141 138 /* Port-space IO */ 142 139 143 140 #define inb_p inb
-1
arch/parisc/kernel/parisc_ksyms.c
··· 43 43 #endif 44 44 45 45 #include <asm/io.h> 46 - EXPORT_SYMBOL(memcpy_fromio); 47 46 48 47 extern void $$divI(void); 49 48 extern void $$divU(void);
-61
arch/parisc/lib/io.c
··· 13 13 #include <asm/io.h> 14 14 15 15 /* 16 - ** Copies a block of memory from a device in an efficient manner. 17 - ** Assumes the device can cope with 32-bit transfers. If it can't, 18 - ** don't use this function. 19 - ** 20 - ** CR16 counts on C3000 reading 256 bytes from Symbios 896 RAM: 21 - ** 27341/64 = 427 cyc per int 22 - ** 61311/128 = 478 cyc per short 23 - ** 122637/256 = 479 cyc per byte 24 - ** Ergo bus latencies dominant (not transfer size). 25 - ** Minimize total number of transfers at cost of CPU cycles. 26 - ** TODO: only look at src alignment and adjust the stores to dest. 27 - */ 28 - void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) 29 - { 30 - /* first compare alignment of src/dst */ 31 - if ( (((unsigned long)dst ^ (unsigned long)src) & 1) || (count < 2) ) 32 - goto bytecopy; 33 - 34 - if ( (((unsigned long)dst ^ (unsigned long)src) & 2) || (count < 4) ) 35 - goto shortcopy; 36 - 37 - /* Then check for misaligned start address */ 38 - if ((unsigned long)src & 1) { 39 - *(u8 *)dst = readb(src); 40 - src++; 41 - dst++; 42 - count--; 43 - if (count < 2) goto bytecopy; 44 - } 45 - 46 - if ((unsigned long)src & 2) { 47 - *(u16 *)dst = __raw_readw(src); 48 - src += 2; 49 - dst += 2; 50 - count -= 2; 51 - } 52 - 53 - while (count > 3) { 54 - *(u32 *)dst = __raw_readl(src); 55 - dst += 4; 56 - src += 4; 57 - count -= 4; 58 - } 59 - 60 - shortcopy: 61 - while (count > 1) { 62 - *(u16 *)dst = __raw_readw(src); 63 - src += 2; 64 - dst += 2; 65 - count -= 2; 66 - } 67 - 68 - bytecopy: 69 - while (count--) { 70 - *(char *)dst = readb(src); 71 - src++; 72 - dst++; 73 - } 74 - } 75 - 76 - /* 77 16 * Read COUNT 8-bit bytes from port PORT into memory starting at 78 17 * SRC. 79 18 */