From mboxrd@z Thu Jan 1 00:00:00 1970 From: pbonzini@redhat.com (Paolo Bonzini) Date: Tue, 20 Sep 2011 09:12:48 +0200 Subject: [ltt-dev] [URCU PATCH] cmm: provide lightweight rmb/wmb on PPC Message-ID: <1316502769-576-1-git-send-email-pbonzini@redhat.com> lwsync orders loads with respect to other loads, and stores with respect to other stores. eieio instead only orders stores. Use them to implement rmb/wmb/smp_wmb. --- urcu/arch/ppc.h | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/urcu/arch/ppc.h b/urcu/arch/ppc.h index a03d688..3a6c702 100644 --- a/urcu/arch/ppc.h +++ b/urcu/arch/ppc.h @@ -32,7 +32,14 @@ extern "C" { /* Include size of POWER5+ L3 cache lines: 256 bytes */ #define CAA_CACHE_LINE_SIZE 256 -#define cmm_mb() asm volatile("sync":::"memory") +#define cmm_mb() asm volatile("sync":::"memory") +#define cmm_rmb() asm volatile("lwsync":::"memory") +#define cmm_wmb() asm volatile("lwsync":::"memory") + +/* eieio is good for a write memory barrier, assuming we don't + * need to order cacheable and non-cacheable stores with respect + * to each other. */ +#define cmm_smp_wmb() asm volatile("eieio":::"memory") #define mftbl() \ ({ \ -- 1.7.6