aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-10-01 03:13:28 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-10-01 03:13:28 -0400
commit1ef7cbbe2157274a7003e78ef60b7ad885a970b8 (patch)
tree185f7f05947938ffb8939916e15ea64343e83bb7 /arch
parenta64314e62d89562b6fc77593648bec3acc35bf61 (diff)
sh64: Move *_p() I/O routine variants to io.h.
These were implemented using an ugly macro for just simple wrapping, so we just make the wrapping explicit and move it to io.h instead. Also fixes up some modules: CC [M] drivers/net/8390.o In file included from drivers/net/8390.c:6: drivers/net/lib8390.c: In function 'ei_start_xmit': drivers/net/lib8390.c:329: error: implicit declaration of function 'outb_p' drivers/net/lib8390.c: In function '__ei_interrupt': drivers/net/lib8390.c:457: error: implicit declaration of function 'inb_p' make[2]: *** [drivers/net/8390.o] Error 1 make[1]: *** [drivers/net] Error 2 Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh64/lib/io.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/arch/sh64/lib/io.c b/arch/sh64/lib/io.c
index 587baa3dffb9..a3f3a2b8e25b 100644
--- a/arch/sh64/lib/io.c
+++ b/arch/sh64/lib/io.c
@@ -11,30 +11,11 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/module.h>
14#include <asm/system.h> 15#include <asm/system.h>
15#include <asm/processor.h> 16#include <asm/processor.h>
16#include <asm/io.h> 17#include <asm/io.h>
17 18
18/*
19 * readX/writeX() are used to access memory mapped devices. On some
20 * architectures the memory mapped IO stuff needs to be accessed
21 * differently. On the SuperH architecture, we just read/write the
22 * memory location directly.
23 */
24
25/* This is horrible at the moment - needs more work to do something sensible */
26#define IO_DELAY()
27
28#define OUT_DELAY(x,type) \
29void out##x##_p(unsigned type value,unsigned long port){out##x(value,port);IO_DELAY();}
30
31#define IN_DELAY(x,type) \
32unsigned type in##x##_p(unsigned long port) {unsigned type tmp=in##x(port);IO_DELAY();return tmp;}
33
34#if 1
35OUT_DELAY(b, long) OUT_DELAY(w, long) OUT_DELAY(l, long)
36 IN_DELAY(b, long) IN_DELAY(w, long) IN_DELAY(l, long)
37#endif
38/* Now for the string version of these functions */ 19/* Now for the string version of these functions */
39void outsb(unsigned long port, const void *addr, unsigned long count) 20void outsb(unsigned long port, const void *addr, unsigned long count)
40{ 21{
@@ -45,6 +26,7 @@ void outsb(unsigned long port, const void *addr, unsigned long count)
45 outb(*p, port); 26 outb(*p, port);
46 } 27 }
47} 28}
29EXPORT_SYMBOL(outsb);
48 30
49void insb(unsigned long port, void *addr, unsigned long count) 31void insb(unsigned long port, void *addr, unsigned long count)
50{ 32{
@@ -55,6 +37,7 @@ void insb(unsigned long port, void *addr, unsigned long count)
55 *p = inb(port); 37 *p = inb(port);
56 } 38 }
57} 39}
40EXPORT_SYMBOL(insb);
58 41
59/* For the 16 and 32 bit string functions, we have to worry about alignment. 42/* For the 16 and 32 bit string functions, we have to worry about alignment.
60 * The SH does not do unaligned accesses, so we have to read as bytes and 43 * The SH does not do unaligned accesses, so we have to read as bytes and
@@ -74,6 +57,7 @@ void outsw(unsigned long port, const void *addr, unsigned long count)
74 outw(tmp, port); 57 outw(tmp, port);
75 } 58 }
76} 59}
60EXPORT_SYMBOL(outsw);
77 61
78void insw(unsigned long port, void *addr, unsigned long count) 62void insw(unsigned long port, void *addr, unsigned long count)
79{ 63{
@@ -87,6 +71,7 @@ void insw(unsigned long port, void *addr, unsigned long count)
87 p[1] = (tmp >> 8) & 0xff; 71 p[1] = (tmp >> 8) & 0xff;
88 } 72 }
89} 73}
74EXPORT_SYMBOL(insw);
90 75
91void outsl(unsigned long port, const void *addr, unsigned long count) 76void outsl(unsigned long port, const void *addr, unsigned long count)
92{ 77{
@@ -100,6 +85,7 @@ void outsl(unsigned long port, const void *addr, unsigned long count)
100 outl(tmp, port); 85 outl(tmp, port);
101 } 86 }
102} 87}
88EXPORT_SYMBOL(outsl);
103 89
104void insl(unsigned long port, void *addr, unsigned long count) 90void insl(unsigned long port, void *addr, unsigned long count)
105{ 91{
@@ -116,6 +102,7 @@ void insl(unsigned long port, void *addr, unsigned long count)
116 102
117 } 103 }
118} 104}
105EXPORT_SYMBOL(insl);
119 106
120void memcpy_toio(void __iomem *to, const void *from, long count) 107void memcpy_toio(void __iomem *to, const void *from, long count)
121{ 108{
@@ -126,6 +113,7 @@ void memcpy_toio(void __iomem *to, const void *from, long count)
126 writeb(*p++, to++); 113 writeb(*p++, to++);
127 } 114 }
128} 115}
116EXPORT_SYMBOL(memcpy_toio);
129 117
130void memcpy_fromio(void *to, void __iomem *from, long count) 118void memcpy_fromio(void *to, void __iomem *from, long count)
131{ 119{
@@ -137,3 +125,4 @@ void memcpy_fromio(void *to, void __iomem *from, long count)
137 from++; 125 from++;
138 } 126 }
139} 127}
128EXPORT_SYMBOL(memcpy_fromio);