aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/arm/kernel/io.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/arm/kernel/io.c')
-rw-r--r--arch/arm/kernel/io.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
new file mode 100644
index 000000000000..6c20c1188b60
--- /dev/null
+++ b/arch/arm/kernel/io.c
@@ -0,0 +1,51 @@
1#include <linux/module.h>
2#include <linux/types.h>
3
4#include <asm/io.h>
5
6/*
7 * Copy data from IO memory space to "real" memory space.
8 * This needs to be optimized.
9 */
10void _memcpy_fromio(void *to, void __iomem *from, size_t count)
11{
12 unsigned char *t = to;
13 while (count) {
14 count--;
15 *t = readb(from);
16 t++;
17 from++;
18 }
19}
20
21/*
22 * Copy data from "real" memory space to IO memory space.
23 * This needs to be optimized.
24 */
25void _memcpy_toio(void __iomem *to, const void *from, size_t count)
26{
27 const unsigned char *f = from;
28 while (count) {
29 count--;
30 writeb(*f, to);
31 f++;
32 to++;
33 }
34}
35
36/*
37 * "memset" on IO memory space.
38 * This needs to be optimized.
39 */
40void _memset_io(void __iomem *dst, int c, size_t count)
41{
42 while (count) {
43 count--;
44 writeb(c, dst);
45 dst++;
46 }
47}
48
49EXPORT_SYMBOL(_memcpy_fromio);
50EXPORT_SYMBOL(_memcpy_toio);
51EXPORT_SYMBOL(_memset_io);