Linux 3.0.62
[linux/fpc-iii.git] / arch / ia64 / lib / io.c
blobbcd16f8ad9d958ef9981c6504f3028cd48ba1a81
1 #include <linux/module.h>
2 #include <linux/types.h>
4 #include <asm/io.h>
6 /*
7 * Copy data from IO memory space to "real" memory space.
8 * This needs to be optimized.
9 */
10 void memcpy_fromio(void *to, const volatile void __iomem *from, long count)
12 char *dst = to;
14 while (count) {
15 count--;
16 *dst++ = readb(from++);
19 EXPORT_SYMBOL(memcpy_fromio);
22 * Copy data from "real" memory space to IO memory space.
23 * This needs to be optimized.
25 void memcpy_toio(volatile void __iomem *to, const void *from, long count)
27 const char *src = from;
29 while (count) {
30 count--;
31 writeb(*src++, to++);
34 EXPORT_SYMBOL(memcpy_toio);
37 * "memset" on IO memory space.
38 * This needs to be optimized.
40 void memset_io(volatile void __iomem *dst, int c, long count)
42 unsigned char ch = (char)(c & 0xff);
44 while (count) {
45 count--;
46 writeb(ch, dst);
47 dst++;
50 EXPORT_SYMBOL(memset_io);
52 #ifdef CONFIG_IA64_GENERIC
54 #undef __ia64_inb
55 #undef __ia64_inw
56 #undef __ia64_inl
57 #undef __ia64_outb
58 #undef __ia64_outw
59 #undef __ia64_outl
60 #undef __ia64_readb
61 #undef __ia64_readw
62 #undef __ia64_readl
63 #undef __ia64_readq
64 #undef __ia64_readb_relaxed
65 #undef __ia64_readw_relaxed
66 #undef __ia64_readl_relaxed
67 #undef __ia64_readq_relaxed
68 #undef __ia64_writeb
69 #undef __ia64_writew
70 #undef __ia64_writel
71 #undef __ia64_writeq
72 #undef __ia64_mmiowb
74 unsigned int
75 __ia64_inb (unsigned long port)
77 return ___ia64_inb(port);
80 unsigned int
81 __ia64_inw (unsigned long port)
83 return ___ia64_inw(port);
86 unsigned int
87 __ia64_inl (unsigned long port)
89 return ___ia64_inl(port);
92 void
93 __ia64_outb (unsigned char val, unsigned long port)
95 ___ia64_outb(val, port);
98 void
99 __ia64_outw (unsigned short val, unsigned long port)
101 ___ia64_outw(val, port);
104 void
105 __ia64_outl (unsigned int val, unsigned long port)
107 ___ia64_outl(val, port);
110 unsigned char
111 __ia64_readb (void __iomem *addr)
113 return ___ia64_readb (addr);
116 unsigned short
117 __ia64_readw (void __iomem *addr)
119 return ___ia64_readw (addr);
122 unsigned int
123 __ia64_readl (void __iomem *addr)
125 return ___ia64_readl (addr);
128 unsigned long
129 __ia64_readq (void __iomem *addr)
131 return ___ia64_readq (addr);
134 unsigned char
135 __ia64_readb_relaxed (void __iomem *addr)
137 return ___ia64_readb (addr);
140 unsigned short
141 __ia64_readw_relaxed (void __iomem *addr)
143 return ___ia64_readw (addr);
146 unsigned int
147 __ia64_readl_relaxed (void __iomem *addr)
149 return ___ia64_readl (addr);
152 unsigned long
153 __ia64_readq_relaxed (void __iomem *addr)
155 return ___ia64_readq (addr);
158 void
159 __ia64_mmiowb(void)
161 ___ia64_mmiowb();
164 #endif /* CONFIG_IA64_GENERIC */