diff options
Diffstat (limited to 'include/asm-mips/io.h')
-rw-r--r-- | include/asm-mips/io.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index d42685747e7d..5a4c8a54b8f4 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | 19 | ||
20 | #include <asm/addrspace.h> | 20 | #include <asm/addrspace.h> |
21 | #include <asm/bug.h> | ||
22 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
23 | #include <asm/cpu.h> | 22 | #include <asm/cpu.h> |
24 | #include <asm/cpu-features.h> | 23 | #include <asm/cpu-features.h> |
@@ -57,38 +56,38 @@ | |||
57 | * variations of functions: non-prefixed ones that preserve the value | 56 | * variations of functions: non-prefixed ones that preserve the value |
58 | * and prefixed ones that preserve byte addresses. The latters are | 57 | * and prefixed ones that preserve byte addresses. The latters are |
59 | * typically used for moving raw data between a peripheral and memory (cf. | 58 | * typically used for moving raw data between a peripheral and memory (cf. |
60 | * string I/O functions), hence the "mem_" prefix. | 59 | * string I/O functions), hence the "__mem_" prefix. |
61 | */ | 60 | */ |
62 | #if defined(CONFIG_SWAP_IO_SPACE) | 61 | #if defined(CONFIG_SWAP_IO_SPACE) |
63 | 62 | ||
64 | # define ioswabb(x) (x) | 63 | # define ioswabb(x) (x) |
65 | # define mem_ioswabb(x) (x) | 64 | # define __mem_ioswabb(x) (x) |
66 | # ifdef CONFIG_SGI_IP22 | 65 | # ifdef CONFIG_SGI_IP22 |
67 | /* | 66 | /* |
68 | * IP22 seems braindead enough to swap 16bits values in hardware, but | 67 | * IP22 seems braindead enough to swap 16bits values in hardware, but |
69 | * not 32bits. Go figure... Can't tell without documentation. | 68 | * not 32bits. Go figure... Can't tell without documentation. |
70 | */ | 69 | */ |
71 | # define ioswabw(x) (x) | 70 | # define ioswabw(x) (x) |
72 | # define mem_ioswabw(x) le16_to_cpu(x) | 71 | # define __mem_ioswabw(x) le16_to_cpu(x) |
73 | # else | 72 | # else |
74 | # define ioswabw(x) le16_to_cpu(x) | 73 | # define ioswabw(x) le16_to_cpu(x) |
75 | # define mem_ioswabw(x) (x) | 74 | # define __mem_ioswabw(x) (x) |
76 | # endif | 75 | # endif |
77 | # define ioswabl(x) le32_to_cpu(x) | 76 | # define ioswabl(x) le32_to_cpu(x) |
78 | # define mem_ioswabl(x) (x) | 77 | # define __mem_ioswabl(x) (x) |
79 | # define ioswabq(x) le64_to_cpu(x) | 78 | # define ioswabq(x) le64_to_cpu(x) |
80 | # define mem_ioswabq(x) (x) | 79 | # define __mem_ioswabq(x) (x) |
81 | 80 | ||
82 | #else | 81 | #else |
83 | 82 | ||
84 | # define ioswabb(x) (x) | 83 | # define ioswabb(x) (x) |
85 | # define mem_ioswabb(x) (x) | 84 | # define __mem_ioswabb(x) (x) |
86 | # define ioswabw(x) (x) | 85 | # define ioswabw(x) (x) |
87 | # define mem_ioswabw(x) cpu_to_le16(x) | 86 | # define __mem_ioswabw(x) cpu_to_le16(x) |
88 | # define ioswabl(x) (x) | 87 | # define ioswabl(x) (x) |
89 | # define mem_ioswabl(x) cpu_to_le32(x) | 88 | # define __mem_ioswabl(x) cpu_to_le32(x) |
90 | # define ioswabq(x) (x) | 89 | # define ioswabq(x) (x) |
91 | # define mem_ioswabq(x) cpu_to_le32(x) | 90 | # define __mem_ioswabq(x) cpu_to_le32(x) |
92 | 91 | ||
93 | #endif | 92 | #endif |
94 | 93 | ||
@@ -343,7 +342,7 @@ static inline void pfx##write##bwlq(type val, \ | |||
343 | BUG(); \ | 342 | BUG(); \ |
344 | } \ | 343 | } \ |
345 | \ | 344 | \ |
346 | static inline type pfx##read##bwlq(volatile void __iomem *mem) \ | 345 | static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ |
347 | { \ | 346 | { \ |
348 | volatile type *__mem; \ | 347 | volatile type *__mem; \ |
349 | type __val; \ | 348 | type __val; \ |
@@ -418,7 +417,7 @@ __BUILD_MEMORY_SINGLE(bus, bwlq, type, 1) | |||
418 | \ | 417 | \ |
419 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ | 418 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ |
420 | __BUILD_MEMORY_PFX(, bwlq, type) \ | 419 | __BUILD_MEMORY_PFX(, bwlq, type) \ |
421 | __BUILD_MEMORY_PFX(mem_, bwlq, type) \ | 420 | __BUILD_MEMORY_PFX(__mem_, bwlq, type) \ |
422 | 421 | ||
423 | BUILDIO_MEM(b, u8) | 422 | BUILDIO_MEM(b, u8) |
424 | BUILDIO_MEM(w, u16) | 423 | BUILDIO_MEM(w, u16) |
@@ -431,7 +430,7 @@ BUILDIO_MEM(q, u64) | |||
431 | 430 | ||
432 | #define BUILDIO_IOPORT(bwlq, type) \ | 431 | #define BUILDIO_IOPORT(bwlq, type) \ |
433 | __BUILD_IOPORT_PFX(, bwlq, type) \ | 432 | __BUILD_IOPORT_PFX(, bwlq, type) \ |
434 | __BUILD_IOPORT_PFX(mem_, bwlq, type) | 433 | __BUILD_IOPORT_PFX(__mem_, bwlq, type) |
435 | 434 | ||
436 | BUILDIO_IOPORT(b, u8) | 435 | BUILDIO_IOPORT(b, u8) |
437 | BUILDIO_IOPORT(w, u16) | 436 | BUILDIO_IOPORT(w, u16) |
@@ -465,7 +464,7 @@ static inline void writes##bwlq(volatile void __iomem *mem, \ | |||
465 | const volatile type *__addr = addr; \ | 464 | const volatile type *__addr = addr; \ |
466 | \ | 465 | \ |
467 | while (count--) { \ | 466 | while (count--) { \ |
468 | mem_write##bwlq(*__addr, mem); \ | 467 | __mem_write##bwlq(*__addr, mem); \ |
469 | __addr++; \ | 468 | __addr++; \ |
470 | } \ | 469 | } \ |
471 | } \ | 470 | } \ |
@@ -476,7 +475,7 @@ static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \ | |||
476 | volatile type *__addr = addr; \ | 475 | volatile type *__addr = addr; \ |
477 | \ | 476 | \ |
478 | while (count--) { \ | 477 | while (count--) { \ |
479 | *__addr = mem_read##bwlq(mem); \ | 478 | *__addr = __mem_read##bwlq(mem); \ |
480 | __addr++; \ | 479 | __addr++; \ |
481 | } \ | 480 | } \ |
482 | } | 481 | } |
@@ -489,7 +488,7 @@ static inline void outs##bwlq(unsigned long port, const void *addr, \ | |||
489 | const volatile type *__addr = addr; \ | 488 | const volatile type *__addr = addr; \ |
490 | \ | 489 | \ |
491 | while (count--) { \ | 490 | while (count--) { \ |
492 | mem_out##bwlq(*__addr, port); \ | 491 | __mem_out##bwlq(*__addr, port); \ |
493 | __addr++; \ | 492 | __addr++; \ |
494 | } \ | 493 | } \ |
495 | } \ | 494 | } \ |
@@ -500,7 +499,7 @@ static inline void ins##bwlq(unsigned long port, void *addr, \ | |||
500 | volatile type *__addr = addr; \ | 499 | volatile type *__addr = addr; \ |
501 | \ | 500 | \ |
502 | while (count--) { \ | 501 | while (count--) { \ |
503 | *__addr = mem_in##bwlq(port); \ | 502 | *__addr = __mem_in##bwlq(port); \ |
504 | __addr++; \ | 503 | __addr++; \ |
505 | } \ | 504 | } \ |
506 | } | 505 | } |