barrier: ppc64 memory barriers
Introduce memory barriers for ppc64. Change-Id: Ie51f959dd8d677f5af3ce6843e5304dd5e24a1e9 Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com> Reviewed-on: https://review.gerrithub.io/383726 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
258c5ea47a
commit
1a2dc66189
@ -2,6 +2,7 @@
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright (c) Intel Corporation.
|
||||
* Copyright (c) 2017, IBM Corporation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -48,10 +49,18 @@ extern "C" {
|
||||
#define spdk_compiler_barrier() __asm volatile("" ::: "memory")
|
||||
|
||||
/** Write memory barrier */
|
||||
#ifdef __PPC64__
|
||||
#define spdk_wmb() __asm volatile("sync" ::: "memory")
|
||||
#else
|
||||
#define spdk_wmb() __asm volatile("sfence" ::: "memory")
|
||||
#endif
|
||||
|
||||
/** Full read/write memory barrier */
|
||||
#ifdef __PPC64__
|
||||
#define spdk_mb() __asm volatile("sync" ::: "memory")
|
||||
#else
|
||||
#define spdk_mb() __asm volatile("mfence" ::: "memory")
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user