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

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

Version: ~ [ linux-5.2-rc5 ] ~ [ linux-5.1.12 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.53 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.128 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.182 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.182 ] ~ [ 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.68 ] ~ [ 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.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ 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  * arch/sh/kernel/iomap.c
  3  *
  4  * Copyright (C) 2000  Niibe Yutaka
  5  * Copyright (C) 2005 - 2007 Paul Mundt
  6  *
  7  * This file is subject to the terms and conditions of the GNU General Public
  8  * License.  See the file "COPYING" in the main directory of this archive
  9  * for more details.
 10  */
 11 #include <linux/module.h>
 12 #include <linux/io.h>
 13 
 14 unsigned int ioread8(void __iomem *addr)
 15 {
 16         return readb(addr);
 17 }
 18 EXPORT_SYMBOL(ioread8);
 19 
 20 unsigned int ioread16(void __iomem *addr)
 21 {
 22         return readw(addr);
 23 }
 24 EXPORT_SYMBOL(ioread16);
 25 
 26 unsigned int ioread16be(void __iomem *addr)
 27 {
 28         return be16_to_cpu(__raw_readw(addr));
 29 }
 30 EXPORT_SYMBOL(ioread16be);
 31 
 32 unsigned int ioread32(void __iomem *addr)
 33 {
 34         return readl(addr);
 35 }
 36 EXPORT_SYMBOL(ioread32);
 37 
 38 unsigned int ioread32be(void __iomem *addr)
 39 {
 40         return be32_to_cpu(__raw_readl(addr));
 41 }
 42 EXPORT_SYMBOL(ioread32be);
 43 
 44 void iowrite8(u8 val, void __iomem *addr)
 45 {
 46         writeb(val, addr);
 47 }
 48 EXPORT_SYMBOL(iowrite8);
 49 
 50 void iowrite16(u16 val, void __iomem *addr)
 51 {
 52         writew(val, addr);
 53 }
 54 EXPORT_SYMBOL(iowrite16);
 55 
 56 void iowrite16be(u16 val, void __iomem *addr)
 57 {
 58         __raw_writew(cpu_to_be16(val), addr);
 59 }
 60 EXPORT_SYMBOL(iowrite16be);
 61 
 62 void iowrite32(u32 val, void __iomem *addr)
 63 {
 64         writel(val, addr);
 65 }
 66 EXPORT_SYMBOL(iowrite32);
 67 
 68 void iowrite32be(u32 val, void __iomem *addr)
 69 {
 70         __raw_writel(cpu_to_be32(val), addr);
 71 }
 72 EXPORT_SYMBOL(iowrite32be);
 73 
 74 /*
 75  * These are the "repeat MMIO read/write" functions.
 76  * Note the "__raw" accesses, since we don't want to
 77  * convert to CPU byte order. We write in "IO byte
 78  * order" (we also don't have IO barriers).
 79  */
 80 static inline void mmio_insb(void __iomem *addr, u8 *dst, int count)
 81 {
 82         while (--count >= 0) {
 83                 u8 data = __raw_readb(addr);
 84                 *dst = data;
 85                 dst++;
 86         }
 87 }
 88 
 89 static inline void mmio_insw(void __iomem *addr, u16 *dst, int count)
 90 {
 91         while (--count >= 0) {
 92                 u16 data = __raw_readw(addr);
 93                 *dst = data;
 94                 dst++;
 95         }
 96 }
 97 
 98 static inline void mmio_insl(void __iomem *addr, u32 *dst, int count)
 99 {
100         while (--count >= 0) {
101                 u32 data = __raw_readl(addr);
102                 *dst = data;
103                 dst++;
104         }
105 }
106 
107 static inline void mmio_outsb(void __iomem *addr, const u8 *src, int count)
108 {
109         while (--count >= 0) {
110                 __raw_writeb(*src, addr);
111                 src++;
112         }
113 }
114 
115 static inline void mmio_outsw(void __iomem *addr, const u16 *src, int count)
116 {
117         while (--count >= 0) {
118                 __raw_writew(*src, addr);
119                 src++;
120         }
121 }
122 
123 static inline void mmio_outsl(void __iomem *addr, const u32 *src, int count)
124 {
125         while (--count >= 0) {
126                 __raw_writel(*src, addr);
127                 src++;
128         }
129 }
130 
131 void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
132 {
133         mmio_insb(addr, dst, count);
134 }
135 EXPORT_SYMBOL(ioread8_rep);
136 
137 void ioread16_rep(void __iomem *addr, void *dst, unsigned long count)
138 {
139         mmio_insw(addr, dst, count);
140 }
141 EXPORT_SYMBOL(ioread16_rep);
142 
143 void ioread32_rep(void __iomem *addr, void *dst, unsigned long count)
144 {
145         mmio_insl(addr, dst, count);
146 }
147 EXPORT_SYMBOL(ioread32_rep);
148 
149 void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count)
150 {
151         mmio_outsb(addr, src, count);
152 }
153 EXPORT_SYMBOL(iowrite8_rep);
154 
155 void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count)
156 {
157         mmio_outsw(addr, src, count);
158 }
159 EXPORT_SYMBOL(iowrite16_rep);
160 
161 void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)
162 {
163         mmio_outsl(addr, src, count);
164 }
165 EXPORT_SYMBOL(iowrite32_rep);
166 

~ [ 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