Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / include / asm-s390 / io.h
1 /*
2  *  include/asm-s390/io.h
3  *
4  *  S390 version
5  *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
7  *
8  *  Derived from "include/asm-i386/io.h"
9  */
10
11 #ifndef _S390_IO_H
12 #define _S390_IO_H
13
14 #ifdef __KERNEL__
15
16 #include <asm/page.h>
17
18 #define IO_SPACE_LIMIT 0xffffffff
19
20 #define __io_virt(x)            ((void *)(PAGE_OFFSET | (unsigned long)(x)))
21
22 /*
23  * Change virtual addresses to physical addresses and vv.
24  * These are pretty trivial
25  */
26 static inline unsigned long virt_to_phys(volatile void * address)
27 {
28         unsigned long real_address;
29         asm volatile(
30                  "      lra     %0,0(%1)\n"
31                  "      jz      0f\n"
32                  "      la      %0,0\n"
33                  "0:"
34                  : "=a" (real_address) : "a" (address) : "cc");
35         return real_address;
36 }
37
38 static inline void * phys_to_virt(unsigned long address)
39 {
40         return __io_virt(address);
41 }
42
43 #define mmiowb()        do { } while (0)
44
45 /*
46  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
47  * access
48  */
49 #define xlate_dev_mem_ptr(p)    __va(p)
50
51 /*
52  * Convert a virtual cached pointer to an uncached pointer
53  */
54 #define xlate_dev_kmem_ptr(p)   p
55
56 #endif /* __KERNEL__ */
57
58 #endif