Skip to content

Commit 4e3ff3c

Browse files
d3athjest3rhdeller
authored andcommitted
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>
1 parent 579e5fd commit 4e3ff3c

File tree

3 files changed

+0
-65
lines changed

3 files changed

+0
-65
lines changed

arch/parisc/include/asm/io.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
135135

136136
#define pci_iounmap pci_iounmap
137137

138-
void memcpy_fromio(void *dst, const volatile void __iomem *src, int count);
139-
#define memcpy_fromio memcpy_fromio
140-
141138
/* Port-space IO */
142139

143140
#define inb_p inb

arch/parisc/kernel/parisc_ksyms.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ EXPORT_SYMBOL($global$);
4343
#endif
4444

4545
#include <asm/io.h>
46-
EXPORT_SYMBOL(memcpy_fromio);
4746

4847
extern void $$divI(void);
4948
extern void $$divU(void);

arch/parisc/lib/io.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,6 @@
1212
#include <linux/module.h>
1313
#include <asm/io.h>
1414

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-
7615
/*
7716
* Read COUNT 8-bit bytes from port PORT into memory starting at
7817
* SRC.

0 commit comments

Comments
 (0)