blob: 92fc6070d7b3a8aa6affe26f09a52581d47c0148 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Paul Mundtb66c1a32006-01-16 22:14:15 -08002 * 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 Torvalds1da177e2005-04-16 15:20:36 -07006 */
Paul Mundtb66c1a32006-01-16 22:14:15 -08007#define IO_CONCAT(a,b) _IO_CONCAT(a,b)
8#define _IO_CONCAT(a,b) a ## _ ## b
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
Paul Mundtb66c1a32006-01-16 22:14:15 -080010#ifndef __IO_PREFIX
11#error "Don't include this header without a valid system prefix"
12#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Paul Mundtb66c1a32006-01-16 22:14:15 -080014u8 IO_CONCAT(__IO_PREFIX,inb)(unsigned long);
15u16 IO_CONCAT(__IO_PREFIX,inw)(unsigned long);
16u32 IO_CONCAT(__IO_PREFIX,inl)(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Paul Mundtb66c1a32006-01-16 22:14:15 -080018void IO_CONCAT(__IO_PREFIX,outb)(u8, unsigned long);
19void IO_CONCAT(__IO_PREFIX,outw)(u16, unsigned long);
20void IO_CONCAT(__IO_PREFIX,outl)(u32, unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Paul Mundtb66c1a32006-01-16 22:14:15 -080022u8 IO_CONCAT(__IO_PREFIX,inb_p)(unsigned long);
23u16 IO_CONCAT(__IO_PREFIX,inw_p)(unsigned long);
24u32 IO_CONCAT(__IO_PREFIX,inl_p)(unsigned long);
25void IO_CONCAT(__IO_PREFIX,outb_p)(u8, unsigned long);
26void IO_CONCAT(__IO_PREFIX,outw_p)(u16, unsigned long);
27void IO_CONCAT(__IO_PREFIX,outl_p)(u32, unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Paul Mundtb66c1a32006-01-16 22:14:15 -080029void IO_CONCAT(__IO_PREFIX,insb)(unsigned long, void *dst, unsigned long count);
30void IO_CONCAT(__IO_PREFIX,insw)(unsigned long, void *dst, unsigned long count);
31void IO_CONCAT(__IO_PREFIX,insl)(unsigned long, void *dst, unsigned long count);
32void IO_CONCAT(__IO_PREFIX,outsb)(unsigned long, const void *src, unsigned long count);
33void IO_CONCAT(__IO_PREFIX,outsw)(unsigned long, const void *src, unsigned long count);
34void IO_CONCAT(__IO_PREFIX,outsl)(unsigned long, const void *src, unsigned long count);
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Paul Mundtb66c1a32006-01-16 22:14:15 -080036u8 IO_CONCAT(__IO_PREFIX,readb)(void __iomem *);
37u16 IO_CONCAT(__IO_PREFIX,readw)(void __iomem *);
38u32 IO_CONCAT(__IO_PREFIX,readl)(void __iomem *);
39void IO_CONCAT(__IO_PREFIX,writeb)(u8, void __iomem *);
40void IO_CONCAT(__IO_PREFIX,writew)(u16, void __iomem *);
41void IO_CONCAT(__IO_PREFIX,writel)(u32, void __iomem *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Paul Mundtb66c1a32006-01-16 22:14:15 -080043void *IO_CONCAT(__IO_PREFIX,ioremap)(unsigned long offset, unsigned long size);
44void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Paul Mundtb66c1a32006-01-16 22:14:15 -080046void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size);
47void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Paul Mundtb66c1a32006-01-16 22:14:15 -080049#undef __IO_PREFIX