~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/kernel/iomap.c

Version: ~ [ linux-5.3 ] ~ [ linux-5.2.14 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.72 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.143 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.192 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.192 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.73 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * ppc64 "iomap" interface implementation.
  3  *
  4  * (C) Copyright 2004 Linus Torvalds
  5  */
  6 #include <linux/pci.h>
  7 #include <linux/mm.h>
  8 #include <linux/export.h>
  9 #include <asm/io.h>
 10 #include <asm/pci-bridge.h>
 11 
 12 /*
 13  * Here comes the ppc64 implementation of the IOMAP 
 14  * interfaces.
 15  */
 16 unsigned int ioread8(void __iomem *addr)
 17 {
 18         return readb(addr);
 19 }
 20 unsigned int ioread16(void __iomem *addr)
 21 {
 22         return readw(addr);
 23 }
 24 unsigned int ioread16be(void __iomem *addr)
 25 {
 26         return readw_be(addr);
 27 }
 28 unsigned int ioread32(void __iomem *addr)
 29 {
 30         return readl(addr);
 31 }
 32 unsigned int ioread32be(void __iomem *addr)
 33 {
 34         return readl_be(addr);
 35 }
 36 EXPORT_SYMBOL(ioread8);
 37 EXPORT_SYMBOL(ioread16);
 38 EXPORT_SYMBOL(ioread16be);
 39 EXPORT_SYMBOL(ioread32);
 40 EXPORT_SYMBOL(ioread32be);
 41 #ifdef __powerpc64__
 42 u64 ioread64(void __iomem *addr)
 43 {
 44         return readq(addr);
 45 }
 46 u64 ioread64be(void __iomem *addr)
 47 {
 48         return readq_be(addr);
 49 }
 50 EXPORT_SYMBOL(ioread64);
 51 EXPORT_SYMBOL(ioread64be);
 52 #endif /* __powerpc64__ */
 53 
 54 void iowrite8(u8 val, void __iomem *addr)
 55 {
 56         writeb(val, addr);
 57 }
 58 void iowrite16(u16 val, void __iomem *addr)
 59 {
 60         writew(val, addr);
 61 }
 62 void iowrite16be(u16 val, void __iomem *addr)
 63 {
 64         writew_be(val, addr);
 65 }
 66 void iowrite32(u32 val, void __iomem *addr)
 67 {
 68         writel(val, addr);
 69 }
 70 void iowrite32be(u32 val, void __iomem *addr)
 71 {
 72         writel_be(val, addr);
 73 }
 74 EXPORT_SYMBOL(iowrite8);
 75 EXPORT_SYMBOL(iowrite16);
 76 EXPORT_SYMBOL(iowrite16be);
 77 EXPORT_SYMBOL(iowrite32);
 78 EXPORT_SYMBOL(iowrite32be);
 79 #ifdef __powerpc64__
 80 void iowrite64(u64 val, void __iomem *addr)
 81 {
 82         writeq(val, addr);
 83 }
 84 void iowrite64be(u64 val, void __iomem *addr)
 85 {
 86         writeq_be(val, addr);
 87 }
 88 EXPORT_SYMBOL(iowrite64);
 89 EXPORT_SYMBOL(iowrite64be);
 90 #endif /* __powerpc64__ */
 91 
 92 /*
 93  * These are the "repeat read/write" functions. Note the
 94  * non-CPU byte order. We do things in "IO byteorder"
 95  * here.
 96  *
 97  * FIXME! We could make these do EEH handling if we really
 98  * wanted. Not clear if we do.
 99  */
100 void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
101 {
102         readsb(addr, dst, count);
103 }
104 void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
105 {
106         readsw(addr, dst, count);
107 }
108 void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
109 {
110         readsl(addr, dst, count);
111 }
112 EXPORT_SYMBOL(ioread8_rep);
113 EXPORT_SYMBOL(ioread16_rep);
114 EXPORT_SYMBOL(ioread32_rep);
115 
116 void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
117 {
118         writesb(addr, src, count);
119 }
120 void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
121 {
122         writesw(addr, src, count);
123 }
124 void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
125 {
126         writesl(addr, src, count);
127 }
128 EXPORT_SYMBOL(iowrite8_rep);
129 EXPORT_SYMBOL(iowrite16_rep);
130 EXPORT_SYMBOL(iowrite32_rep);
131 
132 void __iomem *ioport_map(unsigned long port, unsigned int len)
133 {
134         return (void __iomem *) (port + _IO_BASE);
135 }
136 
137 void ioport_unmap(void __iomem *addr)
138 {
139         /* Nothing to do */
140 }
141 EXPORT_SYMBOL(ioport_map);
142 EXPORT_SYMBOL(ioport_unmap);
143 
144 #ifdef CONFIG_PCI
145 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
146 {
147         if (isa_vaddr_is_ioport(addr))
148                 return;
149         if (pcibios_vaddr_is_ioport(addr))
150                 return;
151         iounmap(addr);
152 }
153 
154 EXPORT_SYMBOL(pci_iounmap);
155 #endif /* CONFIG_PCI */
156 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp