Go to the documentation of this file.
11 #ifndef __ASM_GENERIC_IO_H
12 #define __ASM_GENERIC_IO_H
15 #include <asm/cacheflush.h>
16 #include <linux/types.h>
18 #ifdef CONFIG_GENERIC_IOMAP
25 #define mmiowb() do {} while (0)
38 return *(
const volatile u8 __force *) addr;
56 #define readb __raw_readb
57 #define readw(addr) __le16_to_cpu(__raw_readw(addr))
58 #define readl(addr) __le32_to_cpu(__raw_readl(addr))
81 #define writeb __raw_writeb
82 #define writew(b,addr) __raw_writew(__cpu_to_le16(b),addr)
83 #define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr)
90 #define readq(addr) __le64_to_cpu(__raw_readq(addr))
96 #define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr)
100 #define PCI_IOBASE ((void __iomem *) 0)
138 #define inb_p(addr) inb(addr)
139 #define inw_p(addr) inw(addr)
140 #define inl_p(addr) inl(addr)
141 #define outb_p(x, addr) outb((x), (addr))
142 #define outw_p(x, addr) outw((x), (addr))
143 #define outl_p(x, addr) outl((x), (addr))
172 static inline void insl(
unsigned long addr,
void *buffer,
int count)
185 static inline void outsb(
unsigned long addr,
const void *buffer,
int count)
197 static inline void outsw(
unsigned long addr,
const void *buffer,
int count)
209 static inline void outsl(
unsigned long addr,
const void *buffer,
int count)
250 #ifndef CONFIG_GENERIC_IOMAP
251 #define ioread8(addr) readb(addr)
252 #define ioread16(addr) readw(addr)
253 #define ioread16be(addr) be16_to_cpu(ioread16(addr))
254 #define ioread32(addr) readl(addr)
255 #define ioread32be(addr) be32_to_cpu(ioread32(addr))
257 #define iowrite8(v, addr) writeb((v), (addr))
258 #define iowrite16(v, addr) writew((v), (addr))
259 #define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr))
260 #define iowrite32(v, addr) writel((v), (addr))
261 #define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr))
263 #define ioread8_rep(p, dst, count) \
264 insb((unsigned long) (p), (dst), (count))
265 #define ioread16_rep(p, dst, count) \
266 insw((unsigned long) (p), (dst), (count))
267 #define ioread32_rep(p, dst, count) \
268 insl((unsigned long) (p), (dst), (count))
270 #define iowrite8_rep(p, src, count) \
271 outsb((unsigned long) (p), (src), (count))
272 #define iowrite16_rep(p, src, count) \
273 outsw((unsigned long) (p), (src), (count))
274 #define iowrite32_rep(p, src, count) \
275 outsl((unsigned long) (p), (src), (count))
278 #ifndef IO_SPACE_LIMIT
279 #define IO_SPACE_LIMIT 0xffff
285 #define __io_virt(x) ((void __force *) (x))
287 #ifndef CONFIG_GENERIC_IOMAP
300 return __pa((
unsigned long)address);
305 return __va(address);
320 #define __ioremap(offset, size, flags) ioremap(offset, size)
322 #ifndef ioremap_nocache
323 #define ioremap_nocache ioremap
327 #define ioremap_wc ioremap_nocache
335 #ifdef CONFIG_HAS_IOPORT
336 #ifndef CONFIG_GENERIC_IOMAP
351 #define xlate_dev_kmem_ptr(p) p
352 #define xlate_dev_mem_ptr(p) __va(p)
355 static inline unsigned long virt_to_bus(
volatile void *address)
357 return ((
unsigned long) address);
360 static inline void *
bus_to_virt(
unsigned long address)
366 #define memset_io(a, b, c) memset(__io_virt(a), (b), (c))
367 #define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c))
368 #define memcpy_toio(a, b, c) memcpy(__io_virt(a), (b), (c))