sync hh.org
[hh.org.git] / include / asm-um / io.h
blob44e8b8c772ae8b1d3c0fc6da06b128f5f0874eed
1 #ifndef __UM_IO_H
2 #define __UM_IO_H
4 #include "asm/page.h"
6 #define IO_SPACE_LIMIT 0xdeadbeef /* Sure hope nothing uses this */
8 static inline int inb(unsigned long i) { return(0); }
9 static inline void outb(char c, unsigned long i) { }
12 * Change virtual addresses to physical addresses and vv.
13 * These are pretty trivial
15 static inline unsigned long virt_to_phys(volatile void * address)
17 return __pa((void *) address);
20 static inline void * phys_to_virt(unsigned long address)
22 return __va(address);
26 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
27 * access
29 #define xlate_dev_mem_ptr(p) __va(p)
32 * Convert a virtual cached pointer to an uncached pointer
34 #define xlate_dev_kmem_ptr(p) p
36 static inline void writeb(unsigned char b, volatile void __iomem *addr)
38 *(volatile unsigned char __force *) addr = b;
40 static inline void writew(unsigned short b, volatile void __iomem *addr)
42 *(volatile unsigned short __force *) addr = b;
44 static inline void writel(unsigned int b, volatile void __iomem *addr)
46 *(volatile unsigned int __force *) addr = b;
48 static inline void writeq(unsigned int b, volatile void __iomem *addr)
50 *(volatile unsigned long long __force *) addr = b;
52 #define __raw_writeb writeb
53 #define __raw_writew writew
54 #define __raw_writel writel
55 #define __raw_writeq writeq
57 #endif