Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 2 | * Trivial I/O routine definitions, intentionally meant to be included |
| 3 | * multiple times. Ugly I/O routine concatenation helpers taken from |
| 4 | * alpha. Must be included _before_ io.h to avoid preprocessor-induced |
| 5 | * routine mismatch. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 7 | #define IO_CONCAT(a,b) _IO_CONCAT(a,b) |
| 8 | #define _IO_CONCAT(a,b) a ## _ ## b |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 10 | #ifndef __IO_PREFIX |
| 11 | #error "Don't include this header without a valid system prefix" |
| 12 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 14 | u8 IO_CONCAT(__IO_PREFIX,inb)(unsigned long); |
| 15 | u16 IO_CONCAT(__IO_PREFIX,inw)(unsigned long); |
| 16 | u32 IO_CONCAT(__IO_PREFIX,inl)(unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 18 | void IO_CONCAT(__IO_PREFIX,outb)(u8, unsigned long); |
| 19 | void IO_CONCAT(__IO_PREFIX,outw)(u16, unsigned long); |
| 20 | void IO_CONCAT(__IO_PREFIX,outl)(u32, unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 22 | u8 IO_CONCAT(__IO_PREFIX,inb_p)(unsigned long); |
| 23 | u16 IO_CONCAT(__IO_PREFIX,inw_p)(unsigned long); |
| 24 | u32 IO_CONCAT(__IO_PREFIX,inl_p)(unsigned long); |
| 25 | void IO_CONCAT(__IO_PREFIX,outb_p)(u8, unsigned long); |
| 26 | void IO_CONCAT(__IO_PREFIX,outw_p)(u16, unsigned long); |
| 27 | void IO_CONCAT(__IO_PREFIX,outl_p)(u32, unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 29 | void IO_CONCAT(__IO_PREFIX,insb)(unsigned long, void *dst, unsigned long count); |
| 30 | void IO_CONCAT(__IO_PREFIX,insw)(unsigned long, void *dst, unsigned long count); |
| 31 | void IO_CONCAT(__IO_PREFIX,insl)(unsigned long, void *dst, unsigned long count); |
| 32 | void IO_CONCAT(__IO_PREFIX,outsb)(unsigned long, const void *src, unsigned long count); |
| 33 | void IO_CONCAT(__IO_PREFIX,outsw)(unsigned long, const void *src, unsigned long count); |
| 34 | void IO_CONCAT(__IO_PREFIX,outsl)(unsigned long, const void *src, unsigned long count); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 36 | u8 IO_CONCAT(__IO_PREFIX,readb)(void __iomem *); |
| 37 | u16 IO_CONCAT(__IO_PREFIX,readw)(void __iomem *); |
| 38 | u32 IO_CONCAT(__IO_PREFIX,readl)(void __iomem *); |
| 39 | void IO_CONCAT(__IO_PREFIX,writeb)(u8, void __iomem *); |
| 40 | void IO_CONCAT(__IO_PREFIX,writew)(u16, void __iomem *); |
| 41 | void IO_CONCAT(__IO_PREFIX,writel)(u32, void __iomem *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 43 | void *IO_CONCAT(__IO_PREFIX,ioremap)(unsigned long offset, unsigned long size); |
| 44 | void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 46 | void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size); |
| 47 | void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
Paul Mundt | b66c1a3 | 2006-01-16 22:14:15 -0800 | [diff] [blame] | 49 | #undef __IO_PREFIX |