diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-17 23:23:30 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-17 23:23:30 -0500 |
commit | b8f7918f332873a79e4c820e90e7a245ce4d3042 (patch) | |
tree | 646ba9c3abeb7919c0346cfb6c6222e76196204d /arch/sh/include/asm/io.h | |
parent | d53a0d33bc3a50ea0e8dd1680a2e8435770b162a (diff) |
sh: Provide uncached I/O helpers.
There are lots of registers that can only be updated from the uncached
mapping, so we add some helpers for those cases in order to make it
easier to ensure that we only make the jump when it's absolutely
necessary.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/io.h')
-rw-r--r-- | arch/sh/include/asm/io.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index bd5fafa23eb4..7dab7b23a5ec 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h | |||
@@ -133,6 +133,28 @@ static inline void ctrl_delay(void) | |||
133 | __raw_readw(generic_io_base); | 133 | __raw_readw(generic_io_base); |
134 | } | 134 | } |
135 | 135 | ||
136 | #define __BUILD_UNCACHED_IO(bwlq, type) \ | ||
137 | static inline type read##bwlq##_uncached(unsigned long addr) \ | ||
138 | { \ | ||
139 | type ret; \ | ||
140 | jump_to_uncached(); \ | ||
141 | ret = __raw_read##bwlq(addr); \ | ||
142 | back_to_cached(); \ | ||
143 | return ret; \ | ||
144 | } \ | ||
145 | \ | ||
146 | static inline void write##bwlq##_uncached(type v, unsigned long addr) \ | ||
147 | { \ | ||
148 | jump_to_uncached(); \ | ||
149 | __raw_write##bwlq(v, addr); \ | ||
150 | back_to_cached(); \ | ||
151 | } | ||
152 | |||
153 | __BUILD_UNCACHED_IO(b, u8) | ||
154 | __BUILD_UNCACHED_IO(w, u16) | ||
155 | __BUILD_UNCACHED_IO(l, u32) | ||
156 | __BUILD_UNCACHED_IO(q, u64) | ||
157 | |||
136 | #define __BUILD_MEMORY_STRING(bwlq, type) \ | 158 | #define __BUILD_MEMORY_STRING(bwlq, type) \ |
137 | \ | 159 | \ |
138 | static inline void __raw_writes##bwlq(volatile void __iomem *mem, \ | 160 | static inline void __raw_writes##bwlq(volatile void __iomem *mem, \ |