diff options
author | viro@ZenIV.linux.org.uk <viro@ZenIV.linux.org.uk> | 2005-09-09 11:50:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 13:31:57 -0400 |
commit | 6c9afc655d4df902211d00a437e893881cdef588 (patch) | |
tree | 27515aaa98945c3df5ca8717876cb06573144eef /include/asm-ppc64 | |
parent | 2fd9d74b35efa9823f1f7d34cb421e2b9eee9650 (diff) |
[PATCH] basic iomem annotations (ppc64)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-ppc64')
-rw-r--r-- | include/asm-ppc64/eeh.h | 39 | ||||
-rw-r--r-- | include/asm-ppc64/io.h | 42 |
2 files changed, 41 insertions, 40 deletions
diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h index 94298b106a4b..40c8eb57493e 100644 --- a/include/asm-ppc64/eeh.h +++ b/include/asm-ppc64/eeh.h | |||
@@ -219,23 +219,24 @@ static inline void eeh_raw_writeq(u64 val, volatile void __iomem *addr) | |||
219 | static inline void eeh_memset_io(volatile void __iomem *addr, int c, | 219 | static inline void eeh_memset_io(volatile void __iomem *addr, int c, |
220 | unsigned long n) | 220 | unsigned long n) |
221 | { | 221 | { |
222 | void *p = (void __force *)addr; | ||
222 | u32 lc = c; | 223 | u32 lc = c; |
223 | lc |= lc << 8; | 224 | lc |= lc << 8; |
224 | lc |= lc << 16; | 225 | lc |= lc << 16; |
225 | 226 | ||
226 | while(n && !EEH_CHECK_ALIGN(addr, 4)) { | 227 | while(n && !EEH_CHECK_ALIGN(p, 4)) { |
227 | *((volatile u8 *)addr) = c; | 228 | *((volatile u8 *)p) = c; |
228 | addr = (void *)((unsigned long)addr + 1); | 229 | p++; |
229 | n--; | 230 | n--; |
230 | } | 231 | } |
231 | while(n >= 4) { | 232 | while(n >= 4) { |
232 | *((volatile u32 *)addr) = lc; | 233 | *((volatile u32 *)p) = lc; |
233 | addr = (void *)((unsigned long)addr + 4); | 234 | p += 4; |
234 | n -= 4; | 235 | n -= 4; |
235 | } | 236 | } |
236 | while(n) { | 237 | while(n) { |
237 | *((volatile u8 *)addr) = c; | 238 | *((volatile u8 *)p) = c; |
238 | addr = (void *)((unsigned long)addr + 1); | 239 | p++; |
239 | n--; | 240 | n--; |
240 | } | 241 | } |
241 | __asm__ __volatile__ ("sync" : : : "memory"); | 242 | __asm__ __volatile__ ("sync" : : : "memory"); |
@@ -250,22 +251,22 @@ static inline void eeh_memcpy_fromio(void *dest, const volatile void __iomem *sr | |||
250 | while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { | 251 | while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { |
251 | *((u8 *)dest) = *((volatile u8 *)vsrc); | 252 | *((u8 *)dest) = *((volatile u8 *)vsrc); |
252 | __asm__ __volatile__ ("eieio" : : : "memory"); | 253 | __asm__ __volatile__ ("eieio" : : : "memory"); |
253 | vsrc = (void *)((unsigned long)vsrc + 1); | 254 | vsrc++; |
254 | dest = (void *)((unsigned long)dest + 1); | 255 | dest++; |
255 | n--; | 256 | n--; |
256 | } | 257 | } |
257 | while(n > 4) { | 258 | while(n > 4) { |
258 | *((u32 *)dest) = *((volatile u32 *)vsrc); | 259 | *((u32 *)dest) = *((volatile u32 *)vsrc); |
259 | __asm__ __volatile__ ("eieio" : : : "memory"); | 260 | __asm__ __volatile__ ("eieio" : : : "memory"); |
260 | vsrc = (void *)((unsigned long)vsrc + 4); | 261 | vsrc += 4; |
261 | dest = (void *)((unsigned long)dest + 4); | 262 | dest += 4; |
262 | n -= 4; | 263 | n -= 4; |
263 | } | 264 | } |
264 | while(n) { | 265 | while(n) { |
265 | *((u8 *)dest) = *((volatile u8 *)vsrc); | 266 | *((u8 *)dest) = *((volatile u8 *)vsrc); |
266 | __asm__ __volatile__ ("eieio" : : : "memory"); | 267 | __asm__ __volatile__ ("eieio" : : : "memory"); |
267 | vsrc = (void *)((unsigned long)vsrc + 1); | 268 | vsrc++; |
268 | dest = (void *)((unsigned long)dest + 1); | 269 | dest++; |
269 | n--; | 270 | n--; |
270 | } | 271 | } |
271 | __asm__ __volatile__ ("sync" : : : "memory"); | 272 | __asm__ __volatile__ ("sync" : : : "memory"); |
@@ -286,20 +287,20 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src, | |||
286 | 287 | ||
287 | while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) { | 288 | while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) { |
288 | *((volatile u8 *)vdest) = *((u8 *)src); | 289 | *((volatile u8 *)vdest) = *((u8 *)src); |
289 | src = (void *)((unsigned long)src + 1); | 290 | src++; |
290 | vdest = (void *)((unsigned long)vdest + 1); | 291 | vdest++; |
291 | n--; | 292 | n--; |
292 | } | 293 | } |
293 | while(n > 4) { | 294 | while(n > 4) { |
294 | *((volatile u32 *)vdest) = *((volatile u32 *)src); | 295 | *((volatile u32 *)vdest) = *((volatile u32 *)src); |
295 | src = (void *)((unsigned long)src + 4); | 296 | src += 4; |
296 | vdest = (void *)((unsigned long)vdest + 4); | 297 | vdest += 4; |
297 | n-=4; | 298 | n-=4; |
298 | } | 299 | } |
299 | while(n) { | 300 | while(n) { |
300 | *((volatile u8 *)vdest) = *((u8 *)src); | 301 | *((volatile u8 *)vdest) = *((u8 *)src); |
301 | src = (void *)((unsigned long)src + 1); | 302 | src++; |
302 | vdest = (void *)((unsigned long)vdest + 1); | 303 | vdest++; |
303 | n--; | 304 | n--; |
304 | } | 305 | } |
305 | __asm__ __volatile__ ("sync" : : : "memory"); | 306 | __asm__ __volatile__ ("sync" : : : "memory"); |
diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h index aba1dfa388ba..59c958aea4db 100644 --- a/include/asm-ppc64/io.h +++ b/include/asm-ppc64/io.h | |||
@@ -20,10 +20,10 @@ | |||
20 | 20 | ||
21 | #include <asm-generic/iomap.h> | 21 | #include <asm-generic/iomap.h> |
22 | 22 | ||
23 | #define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 *)(p), (a), (c)) | 23 | #define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c)) |
24 | #define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 *)(p), (a), (c)) | 24 | #define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c)) |
25 | #define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 *)(p), (a), (c)) | 25 | #define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c)) |
26 | #define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 *)(p), (a), (c)) | 26 | #define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c)) |
27 | 27 | ||
28 | 28 | ||
29 | #define SIO_CONFIG_RA 0x398 | 29 | #define SIO_CONFIG_RA 0x398 |
@@ -71,8 +71,8 @@ extern unsigned long io_page_mask; | |||
71 | * Neither do the standard versions now, these are just here | 71 | * Neither do the standard versions now, these are just here |
72 | * for older code. | 72 | * for older code. |
73 | */ | 73 | */ |
74 | #define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) | 74 | #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) |
75 | #define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) | 75 | #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) |
76 | #else | 76 | #else |
77 | 77 | ||
78 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) | 78 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) |
@@ -136,9 +136,9 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) | |||
136 | #define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) | 136 | #define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) |
137 | #define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) | 137 | #define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) |
138 | 138 | ||
139 | #define outsb(port, buf, ns) _outsb((u8 *)((port)+pci_io_base), (buf), (ns)) | 139 | #define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) |
140 | #define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) | 140 | #define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) |
141 | #define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) | 141 | #define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) |
142 | 142 | ||
143 | #endif | 143 | #endif |
144 | 144 | ||
@@ -147,16 +147,16 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) | |||
147 | #define readl_relaxed(addr) readl(addr) | 147 | #define readl_relaxed(addr) readl(addr) |
148 | #define readq_relaxed(addr) readq(addr) | 148 | #define readq_relaxed(addr) readq(addr) |
149 | 149 | ||
150 | extern void _insb(volatile u8 *port, void *buf, int ns); | 150 | extern void _insb(volatile u8 __iomem *port, void *buf, int ns); |
151 | extern void _outsb(volatile u8 *port, const void *buf, int ns); | 151 | extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns); |
152 | extern void _insw(volatile u16 *port, void *buf, int ns); | 152 | extern void _insw(volatile u16 __iomem *port, void *buf, int ns); |
153 | extern void _outsw(volatile u16 *port, const void *buf, int ns); | 153 | extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns); |
154 | extern void _insl(volatile u32 *port, void *buf, int nl); | 154 | extern void _insl(volatile u32 __iomem *port, void *buf, int nl); |
155 | extern void _outsl(volatile u32 *port, const void *buf, int nl); | 155 | extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl); |
156 | extern void _insw_ns(volatile u16 *port, void *buf, int ns); | 156 | extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns); |
157 | extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); | 157 | extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns); |
158 | extern void _insl_ns(volatile u32 *port, void *buf, int nl); | 158 | extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl); |
159 | extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); | 159 | extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); |
160 | 160 | ||
161 | #define mmiowb() | 161 | #define mmiowb() |
162 | 162 | ||
@@ -176,8 +176,8 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); | |||
176 | * Neither do the standard versions now, these are just here | 176 | * Neither do the standard versions now, these are just here |
177 | * for older code. | 177 | * for older code. |
178 | */ | 178 | */ |
179 | #define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) | 179 | #define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) |
180 | #define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) | 180 | #define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) |
181 | 181 | ||
182 | 182 | ||
183 | #define IO_SPACE_LIMIT ~(0UL) | 183 | #define IO_SPACE_LIMIT ~(0UL) |