diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-18 13:23:30 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-18 13:23:30 +0900 |
commit | b8f7918f332873a79e4c820e90e7a245ce4d3042 (patch) | |
tree | 646ba9c3abeb7919c0346cfb6c6222e76196204d | |
parent | d53a0d33bc3a50ea0e8dd1680a2e8435770b162a (diff) | |
download | linux-b8f7918f332873a79e4c820e90e7a245ce4d3042.tar.bz2 |
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>
-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) __raw_readw(generic_io_base); } +#define __BUILD_UNCACHED_IO(bwlq, type) \ +static inline type read##bwlq##_uncached(unsigned long addr) \ +{ \ + type ret; \ + jump_to_uncached(); \ + ret = __raw_read##bwlq(addr); \ + back_to_cached(); \ + return ret; \ +} \ + \ +static inline void write##bwlq##_uncached(type v, unsigned long addr) \ +{ \ + jump_to_uncached(); \ + __raw_write##bwlq(v, addr); \ + back_to_cached(); \ +} + +__BUILD_UNCACHED_IO(b, u8) +__BUILD_UNCACHED_IO(w, u16) +__BUILD_UNCACHED_IO(l, u32) +__BUILD_UNCACHED_IO(q, u64) + #define __BUILD_MEMORY_STRING(bwlq, type) \ \ static inline void __raw_writes##bwlq(volatile void __iomem *mem, \ |