]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/asm-s390/io.h
[PATCH] Switch s390 to NO_IOMEM
[net-next-2.6.git] / include / asm-s390 / io.h
CommitLineData
1da177e4
LT
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
1da177e4
LT
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 */
4448aaf0 26static inline unsigned long virt_to_phys(volatile void * address)
1da177e4
LT
27{
28 unsigned long real_address;
94c12cc7 29 asm volatile(
94c12cc7 30 " lra %0,0(%1)\n"
94c12cc7
MS
31 " jz 0f\n"
32 " la %0,0\n"
1da177e4 33 "0:"
94c12cc7 34 : "=a" (real_address) : "a" (address) : "cc");
1da177e4
LT
35 return real_address;
36}
37
4448aaf0 38static inline void * phys_to_virt(unsigned long address)
1da177e4
LT
39{
40 return __io_virt(address);
41}
42
39b083fe 43#define mmiowb() do { } while (0)
1da177e4
LT
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