3 * Copyright IBM Corp. 1999
6 * Derived from "include/asm-i386/io.h"
12 #include <linux/kernel.h>
14 #include <asm/pci_io.h>
17 * Change virtual addresses to physical addresses and vv.
18 * These are pretty trivial
20 static inline unsigned long virt_to_phys(volatile void * address)
22 unsigned long real_address;
28 : "=a" (real_address) : "a" (address) : "cc");
31 #define virt_to_phys virt_to_phys
33 static inline void * phys_to_virt(unsigned long address)
35 return (void *) address;
38 void *xlate_dev_mem_ptr(unsigned long phys);
39 void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
42 * Convert a virtual cached pointer to an uncached pointer
44 #define xlate_dev_kmem_ptr(p) p
46 #define IO_SPACE_LIMIT 0
50 #define ioremap_nocache(addr, size) ioremap(addr, size)
51 #define ioremap_wc ioremap_nocache
53 /* TODO: s390 cannot support io_remap_pfn_range... */
54 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
55 remap_pfn_range(vma, vaddr, pfn, size, prot)
57 static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
59 return (void __iomem *) offset;
62 static inline void iounmap(volatile void __iomem *addr)
67 * s390 needs a private implementation of pci_iomap since ioremap with its
68 * offset parameter isn't sufficient. That's because BAR spaces are not
69 * disjunctive on s390 so we need the bar parameter of pci_iomap to find
70 * the corresponding device and create the mapping cookie.
72 #define pci_iomap pci_iomap
73 #define pci_iounmap pci_iounmap
75 #define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
76 #define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
77 #define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
79 #define __raw_readb zpci_read_u8
80 #define __raw_readw zpci_read_u16
81 #define __raw_readl zpci_read_u32
82 #define __raw_readq zpci_read_u64
83 #define __raw_writeb zpci_write_u8
84 #define __raw_writew zpci_write_u16
85 #define __raw_writel zpci_write_u32
86 #define __raw_writeq zpci_write_u64
88 #define readb_relaxed readb
89 #define readw_relaxed readw
90 #define readl_relaxed readl
91 #define readq_relaxed readq
93 #endif /* CONFIG_PCI */
95 #include <asm-generic/io.h>