~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/kernel/io.c

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * linux/arch/sh/kernel/io.c
  3  *
  4  * Copyright (C) 2000  Stuart Menefy
  5  *
  6  * Provide real functions which expand to whatever the header file defined.
  7  * Also definitions of machine independent IO functions.
  8  */
  9 
 10 #include <asm/io.h>
 11 #include <linux/module.h>
 12 
 13 unsigned char _inb(unsigned long port)
 14 {
 15         return __inb(port);
 16 }
 17 EXPORT_SYMBOL(_inb);
 18 
 19 unsigned short _inw(unsigned long port)
 20 {
 21         return __inw(port);
 22 }
 23 EXPORT_SYMBOL(_inw);
 24 
 25 unsigned int _inl(unsigned long port)
 26 {
 27         return __inl(port);
 28 }
 29 EXPORT_SYMBOL(_inl);
 30 
 31 void _outb(unsigned char b, unsigned long port)
 32 {
 33         __outb(b, port);
 34 }
 35 EXPORT_SYMBOL(_outb);
 36 
 37 void _outw(unsigned short b, unsigned long port)
 38 {
 39         __outw(b, port);
 40 }
 41 EXPORT_SYMBOL(_outw);
 42 
 43 
 44 void _outl(unsigned int b, unsigned long port)
 45 {
 46         __outl(b, port);
 47 }
 48 EXPORT_SYMBOL(_outl);
 49 
 50 
 51 unsigned char _inb_p(unsigned long port)
 52 {
 53         return __inb_p(port);
 54 }
 55 EXPORT_SYMBOL(_inb_p);
 56 
 57 unsigned short _inw_p(unsigned long port)
 58 {
 59         return __inw_p(port);
 60 }
 61 EXPORT_SYMBOL(_inw_p);
 62 
 63 
 64 void _outb_p(unsigned char b, unsigned long port)
 65 {
 66         __outb_p(b, port);
 67 }
 68 EXPORT_SYMBOL(_outb_p);
 69 
 70 void _outw_p(unsigned short b, unsigned long port)
 71 {
 72         __outw_p(b, port);
 73 }
 74 EXPORT_SYMBOL(_outw_p);
 75 
 76 void _insb(unsigned long port, void *buffer, unsigned long count)
 77 {
 78         return __insb(port, buffer, count);
 79 }
 80 EXPORT_SYMBOL(_insb);
 81 
 82 void _insw(unsigned long port, void *buffer, unsigned long count)
 83 {
 84         __insw(port, buffer, count);
 85 }
 86 EXPORT_SYMBOL(_insw);
 87 
 88 void _insl(unsigned long port, void *buffer, unsigned long count)
 89 {
 90         __insl(port, buffer, count);
 91 }
 92 EXPORT_SYMBOL(_insl);
 93 
 94 void _outsb(unsigned long port, const void *buffer, unsigned long count)
 95 {
 96         __outsb(port, buffer, count);
 97 }
 98 EXPORT_SYMBOL(_outsb);
 99 
100 void _outsw(unsigned long port, const void *buffer, unsigned long count)
101 {
102         __outsw(port, buffer, count);
103 }
104 EXPORT_SYMBOL(_outsw);
105 
106 void _outsl(unsigned long port, const void *buffer, unsigned long count)
107 {
108         __outsl(port, buffer, count);
109 
110 }
111 EXPORT_SYMBOL(_outsl);
112 
113 unsigned char ___raw_readb(unsigned long addr)
114 {
115         return __readb(addr);
116 }
117 EXPORT_SYMBOL(___raw_readb);
118 
119 unsigned short ___raw_readw(unsigned long addr)
120 {
121         return __readw(addr);
122 }
123 EXPORT_SYMBOL(___raw_readw);
124 
125 unsigned int ___raw_readl(unsigned long addr)
126 {
127         return __readl(addr);
128 }
129 EXPORT_SYMBOL(___raw_readl);
130 
131 unsigned char _readb(unsigned long addr)
132 {
133         unsigned long r = __readb(addr);
134         mb();
135         return r;
136 }
137 EXPORT_SYMBOL(_readb);
138 
139 unsigned short _readw(unsigned long addr)
140 {
141         unsigned long r = __readw(addr);
142         mb();
143         return r;
144 }
145 EXPORT_SYMBOL(_readw);
146 
147 unsigned int _readl(unsigned long addr)
148 {
149         unsigned long r = __readl(addr);
150         mb();
151         return r;
152 }
153 EXPORT_SYMBOL(_readl);
154 
155 void ___raw_writeb(unsigned char b, unsigned long addr)
156 {
157         __writeb(b, addr);
158 }
159 
160 void ___raw_writew(unsigned short b, unsigned long addr)
161 {
162         __writew(b, addr);
163 }
164 EXPORT_SYMBOL(___raw_writew);
165 
166 void ___raw_writel(unsigned int b, unsigned long addr)
167 {
168         __writel(b, addr);
169 }
170 EXPORT_SYMBOL(___raw_writel);
171 
172 void _writeb(unsigned char b, unsigned long addr)
173 {
174         __writeb(b, addr);
175         mb();
176 }
177 EXPORT_SYMBOL(_writeb);
178 
179 void _writew(unsigned short b, unsigned long addr)
180 {
181         __writew(b, addr);
182         mb();
183 }
184 EXPORT_SYMBOL(_writew);
185 
186 void _writel(unsigned int b, unsigned long addr)
187 {
188         __writel(b, addr);
189         mb();
190 }
191 EXPORT_SYMBOL(_writel);
192 
193 /*
194  * Copy data from IO memory space to "real" memory space.
195  * This needs to be optimized.
196  */
197 void  memcpy_fromio(void * to, unsigned long from, unsigned long count)
198 {
199         while (count) {
200                 count--;
201                 *(char *) to = readb(from);
202                 ((char *) to)++;
203                 from++;
204         }
205 }
206  
207 /*
208  * Copy data from "real" memory space to IO memory space.
209  * This needs to be optimized.
210  */
211 void  memcpy_toio(unsigned long to, const void * from, unsigned long count)
212 {
213         while (count) {
214                 count--;
215                 writeb(*(char *) from, to);
216                 ((char *) from)++;
217                 to++;
218         }
219 }
220  
221 /*
222  * "memset" on IO memory space.
223  * This needs to be optimized.
224  */
225 void  memset_io(unsigned long dst, int c, unsigned long count)
226 {
227         while (count) {
228                 count--;
229                 writeb(c, dst);
230                 dst++;
231         }
232 }
233 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp