Lines Matching full:port

33 #define PORT2ADDR(port)		_port2addr(port)  argument
34 #define PORT2ADDR_USB(port) _port2addr_usb(port) argument
36 static inline void *_port2addr(unsigned long port) in _port2addr() argument
38 return (void *)(port | NONCACHE_OFFSET); in _port2addr()
42 static inline void *__port2addr_ata(unsigned long port) in __port2addr_ata() argument
46 switch (port) { in __port2addr_ata()
68 static inline void *_port2addr_ne(unsigned long port) in _port2addr_ne() argument
70 return (void *)(port + 0x10000000); in _port2addr_ne()
72 static inline void *_port2addr_usb(unsigned long port) in _port2addr_usb() argument
74 return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); in _port2addr_usb()
86 #define PORT2ADDR_NE(port) _port2addr_ne(port) argument
116 unsigned char _inb(unsigned long port) in _inb() argument
118 if (port >= LAN_IOSTART && port < LAN_IOEND) in _inb()
119 return _ne_inb(PORT2ADDR_NE(port)); in _inb()
122 else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _inb()
123 return *(volatile unsigned char *)__port2addr_ata(port); in _inb()
127 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _inb()
129 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); in _inb()
134 return *(volatile unsigned char *)PORT2ADDR(port); in _inb()
137 unsigned short _inw(unsigned long port) in _inw() argument
139 if (port >= LAN_IOSTART && port < LAN_IOEND) in _inw()
140 return _ne_inw(PORT2ADDR_NE(port)); in _inw()
142 else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _inw()
143 return *(volatile unsigned short *)__port2addr_ata(port); in _inw()
147 else if(port >= 0x340 && port < 0x3a0) in _inw()
148 return *(volatile unsigned short *)PORT2ADDR_USB(port); in _inw()
151 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _inw()
153 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); in _inw()
157 return *(volatile unsigned short *)PORT2ADDR(port); in _inw()
160 unsigned long _inl(unsigned long port) in _inl() argument
163 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _inl()
165 pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); in _inl()
169 return *(volatile unsigned long *)PORT2ADDR(port); in _inl()
172 unsigned char _inb_p(unsigned long port) in _inb_p() argument
174 unsigned char v = _inb(port); in _inb_p()
179 unsigned short _inw_p(unsigned long port) in _inw_p() argument
181 unsigned short v = _inw(port); in _inw_p()
186 unsigned long _inl_p(unsigned long port) in _inl_p() argument
188 unsigned long v = _inl(port); in _inl_p()
193 void _outb(unsigned char b, unsigned long port) in _outb() argument
195 if (port >= LAN_IOSTART && port < LAN_IOEND) in _outb()
196 _ne_outb(b, PORT2ADDR_NE(port)); in _outb()
199 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _outb()
200 *(volatile unsigned char *)__port2addr_ata(port) = b; in _outb()
204 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _outb()
205 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); in _outb()
208 *(volatile unsigned char *)PORT2ADDR(port) = b; in _outb()
211 void _outw(unsigned short w, unsigned long port) in _outw() argument
213 if (port >= LAN_IOSTART && port < LAN_IOEND) in _outw()
214 _ne_outw(w, PORT2ADDR_NE(port)); in _outw()
217 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _outw()
218 *(volatile unsigned short *)__port2addr_ata(port) = w; in _outw()
222 if(port >= 0x340 && port < 0x3a0) in _outw()
223 *(volatile unsigned short *)PORT2ADDR_USB(port) = w; in _outw()
227 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _outw()
228 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); in _outw()
231 *(volatile unsigned short *)PORT2ADDR(port) = w; in _outw()
234 void _outl(unsigned long l, unsigned long port) in _outl() argument
237 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _outl()
238 pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); in _outl()
241 *(volatile unsigned long *)PORT2ADDR(port) = l; in _outl()
244 void _outb_p(unsigned char b, unsigned long port) in _outb_p() argument
246 _outb(b, port); in _outb_p()
250 void _outw_p(unsigned short w, unsigned long port) in _outw_p() argument
252 _outw(w, port); in _outw_p()
256 void _outl_p(unsigned long l, unsigned long port) in _outl_p() argument
258 _outl(l, port); in _outl_p()
262 void _insb(unsigned int port, void *addr, unsigned long count) in _insb() argument
264 if (port >= LAN_IOSTART && port < LAN_IOEND) in _insb()
265 _ne_insb(PORT2ADDR_NE(port), addr, count); in _insb()
267 else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _insb()
269 unsigned char *portp = __port2addr_ata(port); in _insb()
275 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _insb()
276 pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), in _insb()
282 unsigned char *portp = PORT2ADDR(port); in _insb()
288 void _insw(unsigned int port, void *addr, unsigned long count) in _insw() argument
293 if (port >= LAN_IOSTART && port < LAN_IOEND) { in _insw()
298 portp = PORT2ADDR_NE(port); in _insw()
302 } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _insw()
303 pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), in _insw()
307 } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _insw()
308 portp = __port2addr_ata(port); in _insw()
313 portp = PORT2ADDR(port); in _insw()
319 void _insl(unsigned int port, void *addr, unsigned long count) in _insl() argument
324 portp = PORT2ADDR(port); in _insl()
329 void _outsb(unsigned int port, const void *addr, unsigned long count) in _outsb() argument
334 if (port >= LAN_IOSTART && port < LAN_IOEND) { in _outsb()
335 portp = PORT2ADDR_NE(port); in _outsb()
339 } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _outsb()
340 portp = __port2addr_ata(port); in _outsb()
345 } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _outsb()
346 pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), in _outsb()
350 portp = PORT2ADDR(port); in _outsb()
356 void _outsw(unsigned int port, const void *addr, unsigned long count) in _outsw() argument
361 if (port >= LAN_IOSTART && port < LAN_IOEND) { in _outsw()
366 portp = PORT2ADDR_NE(port); in _outsw()
370 } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { in _outsw()
371 portp = __port2addr_ata(port); in _outsw()
376 } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { in _outsw()
377 pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), in _outsw()
381 portp = PORT2ADDR(port); in _outsw()
387 void _outsl(unsigned int port, const void *addr, unsigned long count) in _outsl() argument
392 portp = PORT2ADDR(port); in _outsl()