diff options
author | David Howells <dhowells@redhat.com> | 2008-04-10 17:11:05 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-10 22:41:29 +0200 |
commit | f17520e1f19172057328e50ffed01a42534921e9 (patch) | |
tree | 34d23d8bfff4511687b91c93d9bb09b4fa9d931f /include/asm-frv | |
parent | FRV: Make NOMMU-mode work with base addresses other than 0xC0000000 [try #2] (diff) | |
download | linux-f17520e1f19172057328e50ffed01a42534921e9.tar.xz linux-f17520e1f19172057328e50ffed01a42534921e9.zip |
FRV: Don't make smp_{r, w, }mb() interpolate MEMBAR when CONFIG_SMP=n [try #2]
Don't make smp_{r,w,}mb() interpolate a MEMBAR instruction when CONFIG_SMP=n as
SMP memory barries on UP systems should interpolate a compiler barrier only.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-frv')
-rw-r--r-- | include/asm-frv/system.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 2c57f4734746..30a67a9da11a 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -179,14 +179,23 @@ do { \ #define mb() asm volatile ("membar" : : :"memory") #define rmb() asm volatile ("membar" : : :"memory") #define wmb() asm volatile ("membar" : : :"memory") -#define set_mb(var, value) do { var = value; mb(); } while (0) +#define read_barrier_depends() barrier() -#define smp_mb() mb() -#define smp_rmb() rmb() -#define smp_wmb() wmb() - -#define read_barrier_depends() do {} while(0) +#ifdef CONFIG_SMP +#define smp_mb() mb() +#define smp_rmb() rmb() +#define smp_wmb() wmb() #define smp_read_barrier_depends() read_barrier_depends() +#define set_mb(var, value) \ + do { xchg(&var, (value)); } while (0) +#else +#define smp_mb() barrier() +#define smp_rmb() barrier() +#define smp_wmb() barrier() +#define smp_read_barrier_depends() do {} while(0) +#define set_mb(var, value) \ + do { var = (value); barrier(); } while (0) +#endif #define HARD_RESET_NOW() \ do { \ |