diff options
author | Suresh Warrier <warrier@linux.vnet.ibm.com> | 2016-08-19 01:35:45 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2016-09-09 02:17:59 -0400 |
commit | 07b1fdf5bd135d94eff2b3a6849b90c358963066 (patch) | |
tree | 4ca83bc39c1d4932fcec17b6392a6c5ef3359c2b | |
parent | 0eeede0c63305a33de31bd90b53b023c1d452c17 (diff) |
powerpc: Add simple cache inhibited MMIO accessors
Add simple cache inhibited accessors for memory mapped I/O.
Unlike the accessors built from the DEF_MMIO_* macros, these
don't include any hardware memory barriers, callers need to
manage memory barriers on their own. These can only be called
in hypervisor real mode.
Signed-off-by: Suresh Warrier <warrier@linux.vnet.ibm.com>
[paulus@ozlabs.org - added line to comment]
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rw-r--r-- | arch/powerpc/include/asm/io.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 2fd1690b79d2..f6fda8482f60 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h | |||
@@ -241,6 +241,35 @@ static inline void out_be64(volatile u64 __iomem *addr, u64 val) | |||
241 | #endif | 241 | #endif |
242 | #endif /* __powerpc64__ */ | 242 | #endif /* __powerpc64__ */ |
243 | 243 | ||
244 | |||
245 | /* | ||
246 | * Simple Cache inhibited accessors | ||
247 | * Unlike the DEF_MMIO_* macros, these don't include any h/w memory | ||
248 | * barriers, callers need to manage memory barriers on their own. | ||
249 | * These can only be used in hypervisor real mode. | ||
250 | */ | ||
251 | |||
252 | static inline u32 _lwzcix(unsigned long addr) | ||
253 | { | ||
254 | u32 ret; | ||
255 | |||
256 | __asm__ __volatile__("lwzcix %0,0, %1" | ||
257 | : "=r" (ret) : "r" (addr) : "memory"); | ||
258 | return ret; | ||
259 | } | ||
260 | |||
261 | static inline void _stbcix(u64 addr, u8 val) | ||
262 | { | ||
263 | __asm__ __volatile__("stbcix %0,0,%1" | ||
264 | : : "r" (val), "r" (addr) : "memory"); | ||
265 | } | ||
266 | |||
267 | static inline void _stwcix(u64 addr, u32 val) | ||
268 | { | ||
269 | __asm__ __volatile__("stwcix %0,0,%1" | ||
270 | : : "r" (val), "r" (addr) : "memory"); | ||
271 | } | ||
272 | |||
244 | /* | 273 | /* |
245 | * Low level IO stream instructions are defined out of line for now | 274 | * Low level IO stream instructions are defined out of line for now |
246 | */ | 275 | */ |