diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-07-25 13:54:40 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-07-25 13:54:40 +1000 |
commit | a0236ff1b112b24c355dd6e7bcf145530b4e73b1 (patch) | |
tree | d3aa4f22d777a837bf8ad93063ed41535edb9c6e /include/ppc970 | |
parent | 8751768a4894c64daa75135a4e0e0ba5e7360fef (diff) | |
download | SLOF-a0236ff1b112b24c355dd6e7bcf145530b4e73b1.zip SLOF-a0236ff1b112b24c355dd6e7bcf145530b4e73b1.tar.gz SLOF-a0236ff1b112b24c355dd6e7bcf145530b4e73b1.tar.bz2 |
Use a global definition of sync() and mb()
For memory barriers accross the board. Also move the compiler barrier
to cpu.h
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/ppc970')
-rw-r--r-- | include/ppc970/cpu.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/ppc970/cpu.h b/include/ppc970/cpu.h index a1a0932..0e66dff 100644 --- a/include/ppc970/cpu.h +++ b/include/ppc970/cpu.h @@ -86,14 +86,24 @@ clr_ci(void) asm volatile(EXPAND(CLRCI(%0)) : "=r"(tmp) :: "memory", "cc"); } -static inline void -eieio(void) +static inline void eieio(void) { asm volatile ("eieio":::"memory"); } -static inline void -flush_cache(void* r, long n) +static inline void barrier(void) +{ + asm volatile("" : : : "memory"); +} +#define cpu_relax() barrier() + +static inline void sync(void) +{ + asm volatile ("sync" ::: "memory"); +} +#define mb() sync() + +static inline void flush_cache(void* r, long n) { asm volatile(EXPAND(FLUSH_CACHE(%0, %1)) : "+r"(r), "+r"(n) :: "memory", "cc", "r0", "ctr"); } |