|
12 | 12 | #include <linux/module.h> |
13 | 13 | #include <asm/io.h> |
14 | 14 |
|
15 | | -/* Copies a block of memory to a device in an efficient manner. |
16 | | - * Assumes the device can cope with 32-bit transfers. If it can't, |
17 | | - * don't use this function. |
18 | | - */ |
19 | | -void memcpy_toio(volatile void __iomem *dst, const void *src, int count) |
20 | | -{ |
21 | | - if (((unsigned long)dst & 3) != ((unsigned long)src & 3)) |
22 | | - goto bytecopy; |
23 | | - while ((unsigned long)dst & 3) { |
24 | | - writeb(*(char *)src, dst++); |
25 | | - src++; |
26 | | - count--; |
27 | | - } |
28 | | - while (count > 3) { |
29 | | - __raw_writel(*(u32 *)src, dst); |
30 | | - src += 4; |
31 | | - dst += 4; |
32 | | - count -= 4; |
33 | | - } |
34 | | - bytecopy: |
35 | | - while (count--) { |
36 | | - writeb(*(char *)src, dst++); |
37 | | - src++; |
38 | | - } |
39 | | -} |
40 | | - |
41 | 15 | /* |
42 | 16 | ** Copies a block of memory from a device in an efficient manner. |
43 | 17 | ** Assumes the device can cope with 32-bit transfers. If it can't, |
@@ -99,27 +73,6 @@ void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) |
99 | 73 | } |
100 | 74 | } |
101 | 75 |
|
102 | | -/* Sets a block of memory on a device to a given value. |
103 | | - * Assumes the device can cope with 32-bit transfers. If it can't, |
104 | | - * don't use this function. |
105 | | - */ |
106 | | -void memset_io(volatile void __iomem *addr, unsigned char val, int count) |
107 | | -{ |
108 | | - u32 val32 = (val << 24) | (val << 16) | (val << 8) | val; |
109 | | - while ((unsigned long)addr & 3) { |
110 | | - writeb(val, addr++); |
111 | | - count--; |
112 | | - } |
113 | | - while (count > 3) { |
114 | | - __raw_writel(val32, addr); |
115 | | - addr += 4; |
116 | | - count -= 4; |
117 | | - } |
118 | | - while (count--) { |
119 | | - writeb(val, addr++); |
120 | | - } |
121 | | -} |
122 | | - |
123 | 76 | /* |
124 | 77 | * Read COUNT 8-bit bytes from port PORT into memory starting at |
125 | 78 | * SRC. |
|
0 commit comments