[PATCH] compound page: no access_process_vm check
[linux-2.6.22.y-op.git] / arch / ia64 / lib / io.c
blob8949e44091acbec9bdc063237759047bdec0a93d
1 #include <linux/config.h>
2 #include <linux/module.h>
3 #include <linux/types.h>
5 #include <asm/io.h>
7 /*
8 * Copy data from IO memory space to "real" memory space.
9 * This needs to be optimized.
11 void memcpy_fromio(void *to, const volatile void __iomem *from, long count)
13 char *dst = to;
15 while (count) {
16 count--;
17 *dst++ = readb(from++);
20 EXPORT_SYMBOL(memcpy_fromio);
23 * Copy data from "real" memory space to IO memory space.
24 * This needs to be optimized.
26 void memcpy_toio(volatile void __iomem *to, const void *from, long count)
28 const char *src = from;
30 while (count) {
31 count--;
32 writeb(*src++, to++);
35 EXPORT_SYMBOL(memcpy_toio);
38 * "memset" on IO memory space.
39 * This needs to be optimized.
41 void memset_io(volatile void __iomem *dst, int c, long count)
43 unsigned char ch = (char)(c & 0xff);
45 while (count) {
46 count--;
47 writeb(ch, dst);
48 dst++;
51 EXPORT_SYMBOL(memset_io);
53 #ifdef CONFIG_IA64_GENERIC
55 #undef __ia64_inb
56 #undef __ia64_inw
57 #undef __ia64_inl
58 #undef __ia64_outb
59 #undef __ia64_outw
60 #undef __ia64_outl
61 #undef __ia64_readb
62 #undef __ia64_readw
63 #undef __ia64_readl
64 #undef __ia64_readq
65 #undef __ia64_readb_relaxed
66 #undef __ia64_readw_relaxed
67 #undef __ia64_readl_relaxed
68 #undef __ia64_readq_relaxed
69 #undef __ia64_writeb
70 #undef __ia64_writew
71 #undef __ia64_writel
72 #undef __ia64_writeq
73 #undef __ia64_mmiowb
75 unsigned int
76 __ia64_inb (unsigned long port)
78 return ___ia64_inb(port);
81 unsigned int
82 __ia64_inw (unsigned long port)
84 return ___ia64_inw(port);
87 unsigned int
88 __ia64_inl (unsigned long port)
90 return ___ia64_inl(port);
93 void
94 __ia64_outb (unsigned char val, unsigned long port)
96 ___ia64_outb(val, port);
99 void
100 __ia64_outw (unsigned short val, unsigned long port)
102 ___ia64_outw(val, port);
105 void
106 __ia64_outl (unsigned int val, unsigned long port)
108 ___ia64_outl(val, port);
111 unsigned char
112 __ia64_readb (void __iomem *addr)
114 return ___ia64_readb (addr);
117 unsigned short
118 __ia64_readw (void __iomem *addr)
120 return ___ia64_readw (addr);
123 unsigned int
124 __ia64_readl (void __iomem *addr)
126 return ___ia64_readl (addr);
129 unsigned long
130 __ia64_readq (void __iomem *addr)
132 return ___ia64_readq (addr);
135 unsigned char
136 __ia64_readb_relaxed (void __iomem *addr)
138 return ___ia64_readb (addr);
141 unsigned short
142 __ia64_readw_relaxed (void __iomem *addr)
144 return ___ia64_readw (addr);
147 unsigned int
148 __ia64_readl_relaxed (void __iomem *addr)
150 return ___ia64_readl (addr);
153 unsigned long
154 __ia64_readq_relaxed (void __iomem *addr)
156 return ___ia64_readq (addr);
159 void
160 __ia64_mmiowb(void)
162 ___ia64_mmiowb();
165 #endif /* CONFIG_IA64_GENERIC */