xref: /linux/arch/s390/include/asm/io.h (revision d8ce7263e1bc3b6b2b906fec0c5037bc27d21d6a)
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 #include <asm/page.h>
15 
16 #define IO_SPACE_LIMIT 0xffffffff
17 
18 /*
19  * Change virtual addresses to physical addresses and vv.
20  * These are pretty trivial
21  */
22 static inline unsigned long virt_to_phys(volatile void * address)
23 {
24 	unsigned long real_address;
25 	asm volatile(
26 		 "	lra	%0,0(%1)\n"
27 		 "	jz	0f\n"
28 		 "	la	%0,0\n"
29                  "0:"
30 		 : "=a" (real_address) : "a" (address) : "cc");
31         return real_address;
32 }
33 
34 static inline void * phys_to_virt(unsigned long address)
35 {
36 	return (void *) address;
37 }
38 
39 void *xlate_dev_mem_ptr(unsigned long phys);
40 void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
41 
42 /*
43  * Convert a virtual cached pointer to an uncached pointer
44  */
45 #define xlate_dev_kmem_ptr(p)	p
46 
47 #endif
48