2 * arch/s390/mm/ioremap.c
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Hartmut Penner (hp@de.ibm.com)
8 * Derived from "arch/i386/mm/extable.c"
9 * (C) Copyright 1995 1996 Linus Torvalds
11 * Re-map IO memory to kernel address space so that we can access it.
12 * This is needed for high PCI addresses that aren't mapped in the
13 * 640k-1MB IO memory area on PC's
16 #include <linux/vmalloc.h>
19 #include <asm/pgalloc.h>
22 * Generic mapping function (not visible outside):
26 * Remap an arbitrary physical address space into the kernel virtual
27 * address space. Needed when the kernel wants to access high addresses
30 void * __ioremap(unsigned long phys_addr
, unsigned long size
, unsigned long flags
)
33 struct vm_struct
* area
;
35 if (phys_addr
< virt_to_phys(high_memory
))
36 return phys_to_virt(phys_addr
);
37 if (phys_addr
& ~PAGE_MASK
)
39 size
= PAGE_ALIGN(size
);
40 if (!size
|| size
> phys_addr
+ size
)
42 area
= get_vm_area(size
, VM_IOREMAP
);
46 if (ioremap_page_range((unsigned long)addr
, (unsigned long)addr
+ size
,
47 phys_addr
, __pgprot(flags
))) {
54 void iounmap(void *addr
)
56 if (addr
> high_memory
)