blob: 1934d9340e2cd6d5c0ca4c58f4ce1869edf97453 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __UM_IO_H
2#define __UM_IO_H
3
4#include "asm/page.h"
5
6#define IO_SPACE_LIMIT 0xdeadbeef /* Sure hope nothing uses this */
7
8static inline int inb(unsigned long i) { return(0); }
9static inline void outb(char c, unsigned long i) { }
10
11/*
12 * Change virtual addresses to physical addresses and vv.
13 * These are pretty trivial
14 */
15static inline unsigned long virt_to_phys(volatile void * address)
16{
17 return __pa((void *) address);
18}
19
20static inline void * phys_to_virt(unsigned long address)
21{
22 return __va(address);
23}
24
25/*
26 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
27 * access
28 */
29#define xlate_dev_mem_ptr(p) __va(p)
30
31/*
32 * Convert a virtual cached pointer to an uncached pointer
33 */
34#define xlate_dev_kmem_ptr(p) p
35
Jeff Dikeea1eae72006-01-18 17:42:38 -080036static inline void writeb(unsigned char b, volatile void __iomem *addr)
37{
38 *(volatile unsigned char __force *) addr = b;
39}
40static inline void writew(unsigned short b, volatile void __iomem *addr)
41{
42 *(volatile unsigned short __force *) addr = b;
43}
44static inline void writel(unsigned int b, volatile void __iomem *addr)
45{
46 *(volatile unsigned int __force *) addr = b;
47}
48#define __raw_writeb writeb
49#define __raw_writew writew
50#define __raw_writel writel
51
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#endif