diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh64/lib/io.c | 29 |
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) \ | ||
29 | void out##x##_p(unsigned type value,unsigned long port){out##x(value,port);IO_DELAY();} | ||
30 | |||
31 | #define IN_DELAY(x,type) \ | ||
32 | unsigned type in##x##_p(unsigned long port) {unsigned type tmp=in##x(port);IO_DELAY();return tmp;} | ||
33 | |||
34 | #if 1 | ||
35 | OUT_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 */ |
39 | void outsb(unsigned long port, const void *addr, unsigned long count) | 20 | void 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 | } |
29 | EXPORT_SYMBOL(outsb); | ||
48 | 30 | ||
49 | void insb(unsigned long port, void *addr, unsigned long count) | 31 | void 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 | } |
40 | EXPORT_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 | } |
60 | EXPORT_SYMBOL(outsw); | ||
77 | 61 | ||
78 | void insw(unsigned long port, void *addr, unsigned long count) | 62 | void 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 | } |
74 | EXPORT_SYMBOL(insw); | ||
90 | 75 | ||
91 | void outsl(unsigned long port, const void *addr, unsigned long count) | 76 | void 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 | } |
88 | EXPORT_SYMBOL(outsl); | ||
103 | 89 | ||
104 | void insl(unsigned long port, void *addr, unsigned long count) | 90 | void 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 | } |
105 | EXPORT_SYMBOL(insl); | ||
119 | 106 | ||
120 | void memcpy_toio(void __iomem *to, const void *from, long count) | 107 | void 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 | } |
116 | EXPORT_SYMBOL(memcpy_toio); | ||
129 | 117 | ||
130 | void memcpy_fromio(void *to, void __iomem *from, long count) | 118 | void 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 | } |
128 | EXPORT_SYMBOL(memcpy_fromio); | ||