Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / arch / s390 / include / asm / io.h
blobb7ff6afc3caa87fd5d92d4b238a77dd8efced069
1 /*
2 * include/asm-s390/io.h
4 * S390 version
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
8 * Derived from "include/asm-i386/io.h"
9 */
11 #ifndef _S390_IO_H
12 #define _S390_IO_H
14 #ifdef __KERNEL__
16 #include <asm/page.h>
18 #define IO_SPACE_LIMIT 0xffffffff
21 * Change virtual addresses to physical addresses and vv.
22 * These are pretty trivial
24 static inline unsigned long virt_to_phys(volatile void * address)
26 unsigned long real_address;
27 asm volatile(
28 " lra %0,0(%1)\n"
29 " jz 0f\n"
30 " la %0,0\n"
31 "0:"
32 : "=a" (real_address) : "a" (address) : "cc");
33 return real_address;
36 static inline void * phys_to_virt(unsigned long address)
38 return (void *) address;
42 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
43 * access
45 #define xlate_dev_mem_ptr(p) __va(p)
48 * Convert a virtual cached pointer to an uncached pointer
50 #define xlate_dev_kmem_ptr(p) p
52 #endif /* __KERNEL__ */
54 #endif